XRootD
XrdXrootdPio Class Reference

#include <XrdXrootdPio.hh>

+ Collaboration diagram for XrdXrootdPio:

Public Member Functions

 XrdXrootdPio (XrdXrootdPio *np=0)
 
 ~XrdXrootdPio ()
 
XrdXrootdPioClear (XrdXrootdPio *np=0)
 
void Recycle ()
 
void Set (int(XrdXrootdProtocol::*Invoke)(), XrdXrootd::IOParms &io, const kXR_char *theSID)
 

Static Public Member Functions

static XrdXrootdPioAlloc (int n=1)
 

Public Attributes

XrdXrootd::IOParms IO
 
XrdXrootdPioNext
 
int(XrdXrootdProtocol::* ResumePio )()
 
kXR_char StreamID [2]
 

Detailed Description

Definition at line 39 of file XrdXrootdPio.hh.

Constructor & Destructor Documentation

◆ XrdXrootdPio()

XrdXrootdPio::XrdXrootdPio ( XrdXrootdPio np = 0)
inline

Definition at line 66 of file XrdXrootdPio.hh.

66 {Clear(np);}
XrdXrootdPio * Clear(XrdXrootdPio *np=0)
Definition: XrdXrootdPio.hh:50

References Clear().

Referenced by Alloc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~XrdXrootdPio()

XrdXrootdPio::~XrdXrootdPio ( )
inline

Definition at line 67 of file XrdXrootdPio.hh.

67 {}

Member Function Documentation

◆ Alloc()

XrdXrootdPio * XrdXrootdPio::Alloc ( int  n = 1)
static

Definition at line 45 of file XrdXrootdPio.cc.

46 {
47  XrdXrootdPio *lqp, *qp=0;
48 
49 
50 // Allocate from the free stack
51 //
52  myMutex.Lock();
53  if ((qp = Free))
54  {do {FreeNum--; Num--; lqp = Free;}
55  while((Free = Free->Next) && Num);
56  lqp->Next = 0;
57  }
58  myMutex.UnLock();
59 
60 // Allocate additional if we have not allocated enough
61 //
62  while(Num--) qp = new XrdXrootdPio(qp);
63 
64 // All done
65 //
66  return qp;
67 }
XrdXrootdPio * Next
Definition: XrdXrootdPio.hh:43
XrdXrootdPio(XrdXrootdPio *np=0)
Definition: XrdXrootdPio.hh:66

References XrdXrootdPio(), XrdSysMutex::Lock(), Next, and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

◆ Clear()

XrdXrootdPio* XrdXrootdPio::Clear ( XrdXrootdPio np = 0)
inline

Definition at line 50 of file XrdXrootdPio.hh.

51  {ResumePio = 0;
52  memset(&IO, 0, sizeof(IO));
53  StreamID[0] = 0; StreamID[1] = 0;
54  Next = np; return this;
55  }
XrdXrootd::IOParms IO
Definition: XrdXrootdPio.hh:45
int(XrdXrootdProtocol::* ResumePio)()
Definition: XrdXrootdPio.hh:44
kXR_char StreamID[2]
Definition: XrdXrootdPio.hh:46

References IO, Next, ResumePio, and StreamID.

Referenced by XrdXrootdPio(), and Recycle().

+ Here is the caller graph for this function:

◆ Recycle()

void XrdXrootdPio::Recycle ( void  )

Definition at line 73 of file XrdXrootdPio.cc.

74 {
75 
76 // Check if we can hold on to this or must delete it
77 //
78  myMutex.Lock();
79  if (FreeNum >= FreeMax) {myMutex.UnLock(); delete this; return;}
80 
81 // Clean this up and push the element on the free stack
82 //
83  Free = Clear(Free); FreeNum++;
84  myMutex.UnLock();
85 }

References Clear(), XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

◆ Set()

void XrdXrootdPio::Set ( int(XrdXrootdProtocol::*)()  Invoke,
XrdXrootd::IOParms io,
const kXR_char theSID 
)
inline

Definition at line 59 of file XrdXrootdPio.hh.

61  {ResumePio = Invoke;
62  IO = io;
63  StreamID[0] = theSID[0]; StreamID[1] = theSID[1];
64  }

References IO, ResumePio, and StreamID.

Member Data Documentation

◆ IO

XrdXrootd::IOParms XrdXrootdPio::IO

Definition at line 45 of file XrdXrootdPio.hh.

Referenced by Clear(), and Set().

◆ Next

XrdXrootdPio* XrdXrootdPio::Next

Definition at line 43 of file XrdXrootdPio.hh.

Referenced by Alloc(), and Clear().

◆ ResumePio

int(XrdXrootdProtocol::* XrdXrootdPio::ResumePio) ()

Definition at line 44 of file XrdXrootdPio.hh.

Referenced by Clear(), and Set().

◆ StreamID

kXR_char XrdXrootdPio::StreamID[2]

Definition at line 46 of file XrdXrootdPio.hh.

Referenced by Clear(), and Set().


The documentation for this class was generated from the following files: