XRootD
XrdSfsXio.cc
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d S f s X i o . h h */
4 /* */
5 /* (c) 2013 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* Produced by Andrew Hanushevsky for Stanford University under contract */
7 /* DE-AC02-76-SFO0515 with the Department of Energy */
8 /* */
9 /* This file is part of the XRootD software suite. */
10 /* */
11 /* XRootD is free software: you can redistribute it and/or modify it under */
12 /* the terms of the GNU Lesser General Public License as published by the */
13 /* Free Software Foundation, either version 3 of the License, or (at your */
14 /* option) any later version. */
15 /* */
16 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19 /* License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24 /* */
25 /* The copyright holder's institutional names and contributor's names may not */
26 /* be used to endorse or promote products derived from this software without */
27 /* specific prior written permission of the institution or contributor. */
28 /******************************************************************************/
29 
30 #include "XrdSfs/XrdSfsXio.hh"
31 #include "XrdSfs/XrdSfsXioImpl.hh"
32 
33 namespace
34 {
35 class Impl
36 {
37 public:
38 
39 static XrdSfsXioImpl *xio;
40 
41  Impl(XrdSfsXioImpl &xioimpl) {xio = &xioimpl;}
42 
43  ~Impl() {}
44 };
45 XrdSfsXioImpl *Impl::xio = 0;
46 }
47 
48 /******************************************************************************/
49 /* C o n s t r u c t o r */
50 /******************************************************************************/
51 
53 {
54  static Impl dummy(xioimpl); // Occurs only once
55 }
56 
57 /******************************************************************************/
58 /* B u f f e r */
59 /******************************************************************************/
60 
61 char *XrdSfsXio::Buffer(XrdSfsXioHandle theHand, int *bsz)
62 {
63  return Impl::xio->Buffer(theHand, bsz);
64 }
65 
66 /******************************************************************************/
67 /* R e c l a i m */
68 /******************************************************************************/
69 
71 {
72  Impl::xio->Reclaim(theHand);
73 }
class XrdBuffer * XrdSfsXioHandle
Definition: XrdSfsXio.hh:46
static void Reclaim(XrdSfsXioHandle theHand)
Definition: XrdSfsXio.cc:70
static char * Buffer(XrdSfsXioHandle theHand, int *buffsz=0)
Definition: XrdSfsXio.cc:61
XrdSfsXio(XrdSfsXioImpl &xioimpl)
Definition: XrdSfsXio.cc:52