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

TZeroInitialiseExpandableBuffer Class Template Reference
[Templates]

Inheritance diagram for TZeroInitialiseExpandableBuffer:
Collaboration diagram for TZeroInitialiseExpandableBuffer:

List of all members.


Detailed Description

template<class T>
class JetByteTools::Core::TZeroInitialiseExpandableBuffer< 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

 TZeroInitialiseExpandableBuffer (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.
 TZeroInitialiseExpandableBuffer (const TZeroInitialiseExpandableBuffer &rhs)
TZeroInitialiseExpandableBufferoperator= (const TZeroInitialiseExpandableBuffer &rhs)
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.
template<>
void ZeroFillBuffer (BYTE *pT, const size_t size)
T * GetBuffer () const
 Access the buffer.
 operator T * () const
 Access the buffer.
size_t GetSize () const
 Obtain the size of the buffer.
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

TZeroInitialiseExpandableBuffer ( 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.


Member Function Documentation

TZeroInitialiseExpandableBuffer< T > & operator= ( const TZeroInitialiseExpandableBuffer< T > &  rhs  )  [inline]

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 from TExpandableBuffer.

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 from TExpandableBuffer.

void ZeroFillBuffer ( BYTE pT,
const size_t  size 
) [inline]

T * GetBuffer (  )  const [inline, inherited]

Access the buffer.

operator T * (  )  const [inline, inherited]

Access the buffer.

size_t GetSize (  )  const [inline, inherited]

Obtain the size of the buffer.

T * ReleaseBuffer (  )  [inline, inherited]

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, inherited]

Swap the internal storage and state from this buffer with the supplied buffer.


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