xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
XrdSfsXio Class Referenceabstract

#include <XrdSfsXio.hh>

Inheritance diagram for XrdSfsXio:
Inheritance graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

Constructor & Destructor Documentation

◆ XrdSfsXio()

XrdSfsXio::XrdSfsXio ( XrdSfsXioImpl xioimpl)

Constructor and destructor

Parameters
xioimplReference to static method implementations.

◆ ~XrdSfsXio()

virtual XrdSfsXio::~XrdSfsXio ( )
inlinevirtual

Constructor and destructor.

Member Function Documentation

◆ Buffer()

static 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.

◆ 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()

static 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.

◆ 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 file: