xrootd
XrdXrootdPio.hh
Go to the documentation of this file.
1 #ifndef __XRDXROOTDPIO__
2 #define __XRDXROOTDPIO__
3 /******************************************************************************/
4 /* */
5 /* X r d X r o o t d P i o . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include "XProtocol/XPtypes.hh"
34 #include "XrdSys/XrdSysPthread.hh"
35 
36 class XrdXrootdFile;
37 
39 {
40 public:
41 
44  long long myOffset;
45  int myIOLen;
46  unsigned short myFlags;
48  bool isWrite;
49  bool isPGio;
50 
51 static XrdXrootdPio *Alloc(int n=1);
52 
54  {const kXR_char zed[2] = {0,0};
55  Set(0, 0, 0, 0, zed, false, false);
56  Next = np; return this;
57  }
58 
59  void Recycle();
60 
61 inline void Set(XrdXrootdFile *theFile, long long theOffset,
62  int theIOLen, unsigned short theFlags,
63  const kXR_char *theSID, bool theW, bool theP)
64  {myFile = theFile;
65  myOffset = theOffset;
66  myIOLen = theIOLen;
67  myFlags = theFlags,
68  StreamID[0] = theSID[0]; StreamID[1] = theSID[1];
69  isWrite = theW;
70  isPGio = theP;
71  }
72 
75 
76 private:
77 
78 static const int FreeMax = 256;
81 static int FreeNum;
82 };
83 #endif
~XrdXrootdPio()
Definition: XrdXrootdPio.hh:74
unsigned char kXR_char
Definition: XPtypes.hh:65
bool isWrite
Definition: XrdXrootdPio.hh:48
XrdXrootdPio * Clear(XrdXrootdPio *np=0)
Definition: XrdXrootdPio.hh:53
static XrdSysMutex myMutex
Definition: XrdXrootdPio.hh:79
int myIOLen
Definition: XrdXrootdPio.hh:45
unsigned short myFlags
Definition: XrdXrootdPio.hh:46
static XrdXrootdPio * Alloc(int n=1)
long long myOffset
Definition: XrdXrootdPio.hh:44
Definition: XrdXrootdPio.hh:38
void Set(XrdXrootdFile *theFile, long long theOffset, int theIOLen, unsigned short theFlags, const kXR_char *theSID, bool theW, bool theP)
Definition: XrdXrootdPio.hh:61
Definition: XrdXrootdFile.hh:99
Definition: XrdSysPthread.hh:165
kXR_char StreamID[2]
Definition: XrdXrootdPio.hh:47
XrdXrootdPio(XrdXrootdPio *np=0)
Definition: XrdXrootdPio.hh:73
static XrdXrootdPio * Free
Definition: XrdXrootdPio.hh:80
XrdXrootdFile * myFile
Definition: XrdXrootdPio.hh:43
XrdXrootdPio * Next
Definition: XrdXrootdPio.hh:42
void Recycle()
static const int FreeMax
Definition: XrdXrootdPio.hh:78
bool isPGio
Definition: XrdXrootdPio.hh:49
static int FreeNum
Definition: XrdXrootdPio.hh:81