XRootD
XrdSfsXio Class Referenceabstract

#include <XrdSfsXio.hh>

+ Inheritance diagram for XrdSfsXio:
+ Collaboration diagram for XrdSfsXio:

Public Member Functions

 XrdSfsXio (XrdSfsXioImpl &xioimpl)
 
virtual ~XrdSfsXio ()
 Constructor and destructor. More...
 
virtual XrdSfsXioHandle Claim (const char *curBuff, int datasz, int minasz)=0
 
virtual XrdSfsXioHandle Swap (const char *curBuff, XrdSfsXioHandle oldHand=0)=0
 

Static Public Member Functions

static char * Buffer (XrdSfsXioHandle theHand, int *buffsz=0)
 
static void Reclaim (XrdSfsXioHandle theHand)
 

Detailed Description

Definition at line 54 of file XrdSfsXio.hh.

Constructor & Destructor Documentation

◆ XrdSfsXio()

XrdSfsXio::XrdSfsXio ( XrdSfsXioImpl xioimpl)

Constructor and destructor

Parameters
xioimplReference to static method implementations.

Definition at line 52 of file XrdSfsXio.cc.

53 {
54  static Impl dummy(xioimpl); // Occurs only once
55 }

◆ ~XrdSfsXio()

virtual XrdSfsXio::~XrdSfsXio ( )
inlinevirtual

Constructor and destructor.

Definition at line 128 of file XrdSfsXio.hh.

128 {}

Member Function Documentation

◆ Buffer()

char * XrdSfsXio::Buffer ( XrdSfsXioHandle  theHand,
int *  buffsz = 0 
)
static

Get the address and size of the buffer associated with a handle.

Parameters
theHand- The handle associated with the buffer.
buffsz- If not nil, the size of the buffer is returned. The size will always be >= to the original data length.
Returns
A pointer to the buffer.

Definition at line 61 of file XrdSfsXio.cc.

62 {
63  return Impl::xio->Buffer(theHand, bsz);
64 }

Referenced by XrdSsiFileReq::GetRequest().

+ Here is the caller graph for this function:

◆ Claim()

virtual XrdSfsXioHandle XrdSfsXio::Claim ( const char *  curBuff,
int  datasz,
int  minasz 
)
pure virtual

Claim ownership of the current buffer if it is memory effecient to do so.

Parameters
curBuff- The address of the current buffer. It must match the the buffer that was most recently passed to the caller.
datasz- Number of useful bytes in the buffer (i.e. write size).
minasz- Minimum buffer size that would be allocated to copy data.
Returns
!0 The buffer handle of the current buffer is returned along with ownership rights.
=0 Too much memory would be wasted by transferring ownership (errno == 0) or an error ocurred (errno != 0). When an error see Swap() below for possible types of errors.

Implemented in XrdXrootdProtocol.

◆ Reclaim()

void XrdSfsXio::Reclaim ( XrdSfsXioHandle  theHand)
static

Return a buffer previously gotten from a Claim() or Swap() call.

Parameters
theHand- The handle associated with the buffer.

Definition at line 70 of file XrdSfsXio.cc.

71 {
72  Impl::xio->Reclaim(theHand);
73 }

Referenced by XrdSsiFileReq::RelRequestBuffer().

+ Here is the caller graph for this function:

◆ Swap()

virtual XrdSfsXioHandle XrdSfsXio::Swap ( const char *  curBuff,
XrdSfsXioHandle  oldHand = 0 
)
pure virtual

Swap the current I/O buffer

Parameters
curBuff- The address of the current buffer. It must match the the buffer that was most recently passed to the caller.
oldHand- The handle associated with a buffer returned by a previous call to Swap(). A value of zero indicates that the caller is taking control of the buffer but has no replacement buffer.
Returns
!0 The buffer handle of the current buffer is returned along with ownership rights. If oldHand was not nil, the caller's ownership of the associated buffer is reclaimed.
=0 An error occurred and nothing has changed; errno holds the reason for the error. Typically, EINVAL - curBuff doe not match current buffer. ENOBUFS - not enough memory to give up buffer. ENOTSUP - unsupported context for call.

Implemented in XrdXrootdProtocol.


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