#include <buffer.hh>
Public Types | |
| typedef unsigned long | size_type |
Public Member Functions | |
| buffer (size_type length) | |
| Constructor. | |
| ~buffer (void) | |
| Destructor. | |
| size_type | capacity (void) const |
| Buffer capacity. | |
| void | clear (void) |
| Clear data buffer. | |
| const char * | data (void) const |
| Data pointer. | |
| char * | data (void) |
| Data pointer. | |
| void | free (void) |
| Return buffer to the appropriate free list. | |
| char & | operator[] (size_type inx) |
| Ith data byte. | |
| char | operator[] (size_type inx) const |
| Ith data byte. | |
| void | power_clean (void) |
| Scour data from buffer. | |
| void | purge (void) |
| Purge the buffer. | |
| size_type | push (size_type n) |
| Increment the data length pointer. | |
| void | resize (size_type n) |
| Reset the data length. | |
| void | reserve (size_type n) |
| Reserve specified length buffer. | |
| void | set_pool (buffer_pool *pool) |
| Data length. | |
| size_type | size (void) const |
| Data length. | |
The buffer class defines a preallocated fixed length buffer with a variable current size pointer.
| typedef unsigned long sends::buffer::size_type |
Data type used for length variables.
| sends::buffer::buffer | ( | size_type | length | ) |
Constructor.
Construct a buffer with the specified length and free queue. The current length pointer is set to zero.
| length | Buffer capacity in bytes. | |
| q | Free queue pointer. |
| sends::buffer::~buffer | ( | void | ) |
Destructor.
Destroy a buffer.
| buffer::size_type sends::buffer::capacity | ( | void | ) | const [inline] |
Buffer capacity.
Return the allocated capacity of the buffer.
| void sends::buffer::clear | ( | void | ) |
| const char * sends::buffer::data | ( | void | ) | const [inline] |
| char * sends::buffer::data | ( | void | ) | [inline] |
| void sends::buffer::free | ( | void | ) |
| char & sends::buffer::operator[] | ( | size_type | inx | ) | [inline] |
Ith data byte.
Return a referece to the ith byte in the data buffer.
| inx | Index of character to be referenced. |
| char sends::buffer::operator[] | ( | size_type | inx | ) | const [inline] |
Ith data byte.
Return a constant reference to the ith byte in the data buffer.
| inx | Index of character to be referenced. |
| void sends::buffer::power_clean | ( | void | ) |
| void sends::buffer::purge | ( | void | ) |
| void sends::buffer::resize | ( | size_type | n | ) |
| void sends::buffer::reserve | ( | size_type | n | ) |
Reserve specified length buffer.
Expand the buffer capacity to the specified number of bytes. Any data currently contain in the buffer are lost and the current data length is set to zero. No action is taken if the current capacity of the buffer is greater than or equal to the requested length.
| n | New length of buffer. |
| void sends::buffer::set_pool | ( | buffer_pool * | pool | ) |
Data length.
Get the current data length.
| pool | Pointer to pool. |
| buffer::size_type sends::buffer::size | ( | void | ) | const [inline] |
Data length.
Get the current data length.
1.5.5