The C++ framework for developing highly scalable, high performance servers on Windows platforms.

TExpandableBuffer Class Template Reference
[Templates]

Inheritance diagram for TExpandableBuffer:
Collaboration diagram for TExpandableBuffer:

List of all members.


Detailed Description

template<class T>
class JetByteTools::Core::TExpandableBuffer< T >

A template class for an expandable buffer, that is a buffer that can be expanded and which will, if expanded, maintain its contents.

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 ()
TExpandableBufferoperator= (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.

Constructor & Destructor Documentation

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]


Member Function Documentation

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.


Generated on Sun Sep 12 19:08:27 2021 for The Server Framework - v7.4 by doxygen 1.5.3