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
#include "
XrdXrootd/XrdXrootdProtocol.hh
"
36
37
class
XrdXrootdFile
;
38
39
class
XrdXrootdPio
40
{
41
public
:
42
43
XrdXrootdPio
*
Next
;
44
int (
XrdXrootdProtocol
::*
ResumePio
)();
45
XrdXrootd::IOParms
IO
;
46
kXR_char
StreamID
[2];
47
48
static
XrdXrootdPio
*
Alloc
(
int
n=1);
49
50
inline
XrdXrootdPio
*
Clear
(
XrdXrootdPio
*np=0)
51
{
ResumePio
= 0;
52
memset(&
IO
, 0,
sizeof
(
IO
));
53
StreamID
[0] = 0;
StreamID
[1] = 0;
54
Next
= np;
return
this
;
55
}
56
57
void
Recycle
();
58
59
inline
void
Set
(
int
(
XrdXrootdProtocol
::*Invoke)(),
60
XrdXrootd::IOParms
&io,
const
kXR_char
*theSID)
61
{
ResumePio
= Invoke;
62
IO
= io;
63
StreamID
[0] = theSID[0];
StreamID
[1] = theSID[1];
64
}
65
66
XrdXrootdPio
(
XrdXrootdPio
*np=0) {
Clear
(np);}
67
~XrdXrootdPio
() {}
68
69
private
:
70
71
static
const
int
FreeMax = 256;
72
static
XrdSysMutex
myMutex;
73
static
XrdXrootdPio
*Free;
74
static
int
FreeNum;
75
};
76
#endif
XPtypes.hh
kXR_char
unsigned char kXR_char
Definition:
XPtypes.hh:65
XrdSysPthread.hh
XrdXrootdProtocol.hh
XrdSysMutex
Definition:
XrdSysPthread.hh:165
XrdXrootdFile
Definition:
XrdXrootdFile.hh:101
XrdXrootdPio
Definition:
XrdXrootdPio.hh:40
XrdXrootdPio::Next
XrdXrootdPio * Next
Definition:
XrdXrootdPio.hh:43
XrdXrootdPio::Clear
XrdXrootdPio * Clear(XrdXrootdPio *np=0)
Definition:
XrdXrootdPio.hh:50
XrdXrootdPio::IO
XrdXrootd::IOParms IO
Definition:
XrdXrootdPio.hh:45
XrdXrootdPio::Recycle
void Recycle()
Definition:
XrdXrootdPio.cc:73
XrdXrootdPio::XrdXrootdPio
XrdXrootdPio(XrdXrootdPio *np=0)
Definition:
XrdXrootdPio.hh:66
XrdXrootdPio::ResumePio
int(XrdXrootdProtocol::* ResumePio)()
Definition:
XrdXrootdPio.hh:44
XrdXrootdPio::Alloc
static XrdXrootdPio * Alloc(int n=1)
Definition:
XrdXrootdPio.cc:45
XrdXrootdPio::~XrdXrootdPio
~XrdXrootdPio()
Definition:
XrdXrootdPio.hh:67
XrdXrootdPio::StreamID
kXR_char StreamID[2]
Definition:
XrdXrootdPio.hh:46
XrdXrootdPio::Set
void Set(int(XrdXrootdProtocol::*Invoke)(), XrdXrootd::IOParms &io, const kXR_char *theSID)
Definition:
XrdXrootdPio.hh:59
XrdXrootdProtocol
Definition:
XrdXrootdProtocol.hh:156
XrdXrootd::IOParms
Definition:
XrdXrootdProtocol.hh:133
XrdXrootd
XrdXrootdPio.hh
Generated by
1.9.1