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. | |
Private Member Functions | |
void | Steal (Buffer &&buffer) |
Buffer (const Buffer &) | |
Buffer & | operator= (const Buffer &) |
Private Attributes | |
char * | pBuffer |
uint32_t | pSize |
uint32_t | pCursor |
Binary blob representation.
XrdCl::Buffer::Buffer | ( | uint32_t | size = 0 |
) | [inline] |
Constructor.
References Allocate().
virtual XrdCl::Buffer::~Buffer | ( | ) | [inline, virtual] |
Destructor.
References Free().
XrdCl::Buffer::Buffer | ( | const Buffer & | ) | [private] |
void XrdCl::Buffer::AdvanceCursor | ( | uint32_t | delta | ) | [inline] |
Advance the cursor.
References pCursor.
void XrdCl::Buffer::Allocate | ( | uint32_t | size | ) | [inline] |
void XrdCl::Buffer::Append | ( | const char * | buffer, | |
uint32_t | size, | |||
uint32_t | offset | |||
) | [inline] |
Append data at the given offset.
References pBuffer, pSize, and ReAllocate().
void XrdCl::Buffer::Append | ( | const char * | buffer, | |
uint32_t | size | |||
) | [inline] |
Append data at the position pointed to by the append cursor.
References pBuffer, pCursor, pSize, and ReAllocate().
void XrdCl::Buffer::Free | ( | ) | [inline] |
void XrdCl::Buffer::FromString | ( | const std::string | str | ) | [inline] |
Fill the buffer from a string.
References pBuffer, and ReAllocate().
char* XrdCl::Buffer::GetBuffer | ( | uint32_t | offset = 0 |
) | [inline] |
Get the message buffer.
References pBuffer.
const char* XrdCl::Buffer::GetBuffer | ( | uint32_t | offset = 0 |
) | const [inline] |
Get the message buffer.
References pBuffer.
Referenced by XrdCl::MessageUtils::CreateRequest(), and GetBufferAtCursor().
const char* XrdCl::Buffer::GetBufferAtCursor | ( | ) | const [inline] |
Get the buffer pointer at the append cursor.
References GetBuffer(), and pCursor.
char* XrdCl::Buffer::GetBufferAtCursor | ( | ) | [inline] |
Get the buffer pointer at the append cursor.
References GetBuffer(), and pCursor.
uint32_t XrdCl::Buffer::GetCursor | ( | ) | const [inline] |
Get append cursor.
References pCursor.
uint32_t XrdCl::Buffer::GetSize | ( | ) | const [inline] |
Get the size of the message.
References pSize.
void XrdCl::Buffer::Grab | ( | char * | buffer, | |
uint32_t | size | |||
) | [inline] |
Move assignment operator.
References Steal().
void XrdCl::Buffer::ReAllocate | ( | uint32_t | size | ) | [inline] |
Reallocate the buffer to a new location of a given size.
References pBuffer, and pSize.
Referenced by Append(), and FromString().
char* XrdCl::Buffer::Release | ( | ) | [inline] |
void XrdCl::Buffer::SetCursor | ( | uint32_t | cursor | ) | [inline] |
Set the cursor.
References pCursor.
void XrdCl::Buffer::Steal | ( | Buffer && | buffer | ) | [inline, private] |
References pBuffer, pCursor, and pSize.
Referenced by Buffer(), and operator=().
std::string XrdCl::Buffer::ToString | ( | ) | const [inline] |
void XrdCl::Buffer::Zero | ( | ) | [inline] |
Zero.
References pBuffer, and pSize.
Referenced by XrdCl::MessageUtils::CreateRequest(), and XrdCl::Message::Message().
char* XrdCl::Buffer::pBuffer [private] |
Referenced by Allocate(), Append(), Free(), FromString(), GetBuffer(), Grab(), ReAllocate(), Release(), Steal(), ToString(), and Zero().
uint32_t XrdCl::Buffer::pCursor [private] |
Referenced by AdvanceCursor(), Append(), Free(), GetBufferAtCursor(), GetCursor(), Release(), SetCursor(), and Steal().
uint32_t XrdCl::Buffer::pSize [private] |
Referenced by Allocate(), Append(), Free(), GetSize(), Grab(), ReAllocate(), Release(), Steal(), ToString(), and Zero().