Public Member Functions | |
TExpandableBuffer (size_t initialSize=0) | |
Create a buffer of the specified initialSize. If the size is 0 then the buffer must be resized or expanded before use. | |
TExpandableBuffer (const T *pInitialData, size_t initialSize) | |
TExpandableBuffer (const TExpandableBuffer &rhs) | |
~TExpandableBuffer () | |
TExpandableBuffer & | operator= (const TExpandableBuffer &rhs) |
T * | GetBuffer () const |
Access the buffer. | |
operator T * () const | |
Access the buffer. | |
size_t | GetSize () const |
Obtain the size of the buffer. | |
size_t | Resize (size_t newSize) |
Make the buffer bigger, but do not copy the previous contents to the new buffer. Return the new size. | |
size_t | Expand (size_t newSize) |
Make the buffer bigger and copy the previous contents to the new buffer. Return the new size. | |
T * | ReleaseBuffer () |
Remove the actual memory used to store the date from the buffer. The buffer is left with a buffer of size 0. The caller is responsible for destroying the memory returned, using delete [], once they've finished with it. | |
void | Swap (TExpandableBuffer &rhs) |
Swap the internal storage and state from this buffer with the supplied buffer. |
TExpandableBuffer | ( | size_t | initialSize = 0 |
) | [inline, explicit] |
Create a buffer of the specified initialSize. If the size is 0 then the buffer must be resized or expanded before use.
TExpandableBuffer | ( | const T * | pInitialData, | |
size_t | initialSize | |||
) | [inline] |
TExpandableBuffer | ( | const TExpandableBuffer< T > & | rhs | ) | [inline] |
~TExpandableBuffer | ( | ) | [inline] |
TExpandableBuffer< T > & operator= | ( | const TExpandableBuffer< T > & | rhs | ) | [inline] |
T * GetBuffer | ( | ) | const [inline] |
Access the buffer.
operator T * | ( | ) | const [inline] |
Access the buffer.
size_t GetSize | ( | ) | const [inline] |
Obtain the size of the buffer.
size_t Resize | ( | size_t | newSize | ) | [inline] |
Make the buffer bigger, but do not copy the previous contents to the new buffer. Return the new size.
Reimplemented in TZeroInitialiseExpandableBuffer.
size_t Expand | ( | size_t | newSize | ) | [inline] |
Make the buffer bigger and copy the previous contents to the new buffer. Return the new size.
Reimplemented in TZeroInitialiseExpandableBuffer.
T * ReleaseBuffer | ( | ) | [inline] |
Remove the actual memory used to store the date from the buffer. The buffer is left with a buffer of size 0. The caller is responsible for destroying the memory returned, using delete [], once they've finished with it.
void Swap | ( | TExpandableBuffer< T > & | rhs | ) | [inline] |
Swap the internal storage and state from this buffer with the supplied buffer.