xrootd
|
Binary blob representation. More...
#include <XrdClBuffer.hh>
Public Member Functions | |
Buffer (uint32_t size=0) | |
Constructor. | |
Buffer (Buffer &&buffer) | |
Move Constructor. | |
Buffer & | operator= (Buffer &&buffer) |
Move assignment operator. | |
virtual | ~Buffer () |
Destructor. | |
const char * | GetBuffer (uint32_t offset=0) const |
Get the message buffer. | |
char * | GetBuffer (uint32_t offset=0) |
Get the message buffer. | |
void | ReAllocate (uint32_t size) |
Reallocate the buffer to a new location of a given size. | |
void | Free () |
Free the buffer. | |
void | Allocate (uint32_t size) |
Allocate the buffer. | |
void | Zero () |
Zero. | |
uint32_t | GetSize () const |
Get the size of the message. | |
uint32_t | GetCursor () const |
Get append cursor. | |
void | SetCursor (uint32_t cursor) |
Set the cursor. | |
void | AdvanceCursor (uint32_t delta) |
Advance the cursor. | |
void | Append (const char *buffer, uint32_t size) |
Append data at the position pointed to by the append cursor. | |
void | Append (const char *buffer, uint32_t size, uint32_t offset) |
Append data at the given offset. | |
char * | GetBufferAtCursor () |
Get the buffer pointer at the append cursor. | |
const char * | GetBufferAtCursor () const |
Get the buffer pointer at the append cursor. | |
void | FromString (const std::string str) |
Fill the buffer from a string. | |
std::string | ToString () const |
Convert the buffer to a string. | |
void | Grab (char *buffer, uint32_t size) |
Grab a buffer allocated outside. | |
char * | Release () |
Release the buffer. | |
Protected Member Functions | |
void | Steal (Buffer &&buffer) |
Private Member Functions | |
Buffer (const Buffer &) | |
Buffer & | operator= (const Buffer &) |
Private Attributes | |
char * | pBuffer |
uint32_t | pSize |
uint32_t | pCursor |
Binary blob representation.
|
inline |
Constructor.
References Allocate().
|
inlinevirtual |
Destructor.
References Free().
|
private |
|
inline |
Advance the cursor.
References pCursor.
Referenced by XrdEc::WrtBuff::Pad(), and XrdEc::WrtBuff::Write().
|
inline |
Allocate the buffer.
References pBuffer, and pSize.
Referenced by Buffer(), and XrdEc::WrtBuff::Pad().
|
inline |
Append data at the position pointed to by the append cursor.
References pBuffer, pCursor, pSize, and ReAllocate().
Referenced by XrdCl::MessageUtils::CreateXAttrBody().
|
inline |
Append data at the given offset.
References pBuffer, pSize, and ReAllocate().
|
inline |
|
inline |
Fill the buffer from a string.
References pBuffer, and ReAllocate().
|
inline |
Get the message buffer.
References pBuffer.
|
inline |
Get the message buffer.
References pBuffer.
Referenced by XrdCl::MessageUtils::CreateRequest(), XrdCl::MessageUtils::CreateXAttrBody(), XrdEc::WrtBuff::Encode(), GetBufferAtCursor(), GetBufferAtCursor(), XrdCl::XRootDTransport::MarshallRequest(), XrdEc::WrtBuff::Pad(), XrdCl::XRootDTransport::SetDescription(), XrdEc::WrtBuff::WrtBuff(), and XrdCl::XRootDMsgHandler::XRootDMsgHandler().
|
inline |
Get the buffer pointer at the append cursor.
References GetBuffer(), and pCursor.
Referenced by XrdEc::WrtBuff::Write().
|
inline |
Get the buffer pointer at the append cursor.
References GetBuffer(), and pCursor.
|
inline |
Get append cursor.
References pCursor.
Referenced by XrdEc::WrtBuff::Complete(), XrdEc::WrtBuff::Empty(), XrdEc::WrtBuff::GetBlkSize(), XrdEc::WrtBuff::GetStrpSize(), and XrdEc::WrtBuff::Write().
|
inline |
Get the size of the message.
References pSize.
Referenced by XrdEc::WrtBuff::Empty(), XrdEc::WrtBuff::Pad(), XrdCl::FcntlAction::Serialize(), XrdCl::AsyncMsgWriter::Write(), and XrdEc::WrtBuff::WrtBuff().
|
inline |
Move assignment operator.
References Steal().
|
inline |
Reallocate the buffer to a new location of a given size.
References pBuffer, and pSize.
Referenced by Append(), Append(), and FromString().
|
inline |
|
inline |
Set the cursor.
References pCursor.
Referenced by XrdEc::WrtBuff::Pad(), and XrdCl::AsyncMsgWriter::Write().
|
inlineprotected |
References pBuffer, pCursor, and pSize.
Referenced by Buffer(), operator=(), and XrdCl::Message::operator=().
|
inline |
|
inline |
Zero.
References pBuffer, and pSize.
Referenced by XrdCl::MessageUtils::CreateRequest(), and XrdCl::Message::Message().
|
private |
Referenced by Allocate(), Append(), Append(), Free(), FromString(), GetBuffer(), GetBuffer(), Grab(), ReAllocate(), Release(), Steal(), ToString(), and Zero().
|
private |
Referenced by AdvanceCursor(), Append(), Free(), GetBufferAtCursor(), GetBufferAtCursor(), GetCursor(), Release(), SetCursor(), and Steal().
|
private |
Referenced by Allocate(), Append(), Append(), Free(), GetSize(), Grab(), ReAllocate(), Release(), Steal(), ToString(), and Zero().