#include <Buffer.hh>
Public Member Functions | |
| Buffer (size_type size, char *data=0) | |
| Constructor. | |
| ~Buffer (void) | |
| Destructor. | |
| const char * | getBuffer (void) const |
| Get buffer pointer. | |
| const char * | getDataAddr (void) const |
| Get data pointer. | |
| const MsgHeader & | getHeader (void) const |
| Get a header reference. | |
| size_type | getLength (void) const |
| Get message length. | |
| size_type | getSize (void) const |
| Buffer length. | |
| size_type | getDataSize (void) const |
| Get maximum data length. | |
| size_type | getDataLength (void) const |
| Current data length. | |
| char * | getBuffer (void) |
| Get buffer pointer. | |
| char * | getDataAddr (void) |
| Get data pointer. | |
| MsgHeader & | getHeader (void) |
| Get a header reference. | |
| void | Return (void) |
| Return the buffer to pool. | |
| void | setLength (size_type length) |
| Set total message length. | |
| void | setDataLength (size_type length) |
| Set the data length. | |
| void | setPool (BufferPool &pool) |
| Set the buffer pool address. | |
Preallocated uffer used in csocket I/O.
| lmsg::Buffer::Buffer | ( | size_type | size, | |
| char * | data = 0 | |||
| ) |
Constructor.
Construct an empty buffer of a specified size. If the data address is null the buffer is marked as local and a data segment of the specified length is allocated. The allocated buffer is released when the buffer is deleted.
| size | Length of buffer | |
| data | Pointer to buffer to be used. |
| lmsg::Buffer::~Buffer | ( | void | ) |
Destructor.
Destroy a buffer and free the data storage if it is local.
| const char * lmsg::Buffer::getBuffer | ( | void | ) | const [inline] |
Get buffer pointer.
Get a constant pointer to the start of the buffer.
| const char * lmsg::Buffer::getDataAddr | ( | void | ) | const [inline] |
Get data pointer.
Get a constant pointer to the start of the message data.
| const lmsg::MsgHeader & lmsg::Buffer::getHeader | ( | void | ) | const [inline] |
Get a header reference.
Get a constant reference to the header of the message stored in the buffer.
| lmsg::size_type lmsg::Buffer::getLength | ( | void | ) | const [inline] |
Get message length.
Get total message (data + header) length.
| lmsg::size_type lmsg::Buffer::getSize | ( | void | ) | const [inline] |
| lmsg::size_type lmsg::Buffer::getDataSize | ( | void | ) | const [inline] |
Get maximum data length.
Get maximum allowable length of the message data.
| lmsg::size_type lmsg::Buffer::getDataLength | ( | void | ) | const [inline] |
Current data length.
Get the current length of the data portion of the message.
| char * lmsg::Buffer::getBuffer | ( | void | ) | [inline] |
Get buffer pointer.
Get a writable pointer to the start of the buffer.
| char * lmsg::Buffer::getDataAddr | ( | void | ) | [inline] |
Get data pointer.
Get a writable pointer to the start of the message data.
| lmsg::MsgHeader & lmsg::Buffer::getHeader | ( | void | ) | [inline] |
Get a header reference.
Get a reference to the header of the message stored in the buffer.
| void lmsg::Buffer::Return | ( | void | ) |
Return the buffer to pool.
Return the buffer to its pool.
| void lmsg::Buffer::setLength | ( | size_type | length | ) |
| void lmsg::Buffer::setDataLength | ( | size_type | length | ) |
Set the data length.
Set the message data length. Note that the header length is added to the data length to give the total message length.
| length | Message data length. |
| void lmsg::Buffer::setPool | ( | BufferPool & | pool | ) |
Set the buffer pool address.
Specify the pool to which the buffer will be returned.
| pool | reference to pool the buffer is to be returned to. |
1.5.4