BufferManager Class Reference

#include <BufferManager.hpp>

List of all members.

Public Member Functions

 BufferManager (UInt32 preferredAllocSize=defaultAllocChunkSize, UInt32 preferredAllocChunkSize=defaultAllocChunkSize)
 ~BufferManager ()
UInt32 getBuffer (Byte **buffer)
UInt32 getWritePointer ()
UInt32 setWritePointer (UInt32 newWritePointer)
UInt32 getReadPointer ()
UInt32 setReadPointer (UInt32 newReadPointer)
UInt32 writeData (Byte *buffer, UInt32 count)
UInt32 writeByte (Byte data)
UInt32 writeUInt16 (UInt16 data)
UInt32 writeUInt32 (UInt32 data)
UInt32 writebit (UInt32 bitCount, UInt32 data)
UInt32 readData (Byte *buffer, UInt32 count)
UInt32 readByte (Byte *data)
UInt32 readUInt16 (UInt16 *data)
UInt32 readUInt32 (UInt32 *data)
UInt32 readbit (UInt32 bitCount, UInt32 *data)


Detailed Description

Class BufferManager, provides the functionality for endian handling, reading and writing data from and to a vector buffer in "Network Byte Order"


Constructor & Destructor Documentation

BufferManager::BufferManager ( UInt32  preferredAllocSize = defaultAllocChunkSize,
UInt32  preferredAllocChunkSize = defaultAllocChunkSize 
)

Buffer Manager constructor

Parameters:
preferredAllocSize The allocation size initially
preferredAllocChunkSize The chunk size used for each re-allocation

BufferManager::~BufferManager (  ) 

Buffer Manager destructor


Member Function Documentation

UInt32 BufferManager::getBuffer ( Byte **  buffer  ) 

Return the actual storage area of data (the "network bytes" as a vector) along with the size of the data contained.

Parameters:
buffer Place where the addess of the storage is saved
Returns:
The data size in the storage

UInt32 BufferManager::getReadPointer (  ) 

Get the current write pointer

UInt32 BufferManager::getWritePointer (  ) 

Get the current write pointer in the buffer

UInt32 BufferManager::readbit ( UInt32  bitCount,
UInt32 *  data 
)

Read bits in multiple of 8. The read pointer is updated

Parameters:
bitCount Number of bits to read, must be a multiple of 8
data The location where read data is stored
Returns:
The new read pointer

UInt32 BufferManager::readByte ( Byte *  data  ) 

Read a byte of network byte to the buffer at the write pointer. The read pointer is updated.

Parameters:
data The location where read byte is stored
Returns:
The new read pointer

UInt32 BufferManager::readData ( Byte *  buffer,
UInt32  count 
)

Read directly bytes of data into storage.

Parameters:
buffer Address of location where data is to be added
count Number of bytes to read

UInt32 BufferManager::readUInt16 ( UInt16 *  data  ) 

Read a 16 bit unsigned short int. Endian convesion from network byte order is also done. The read pointer is updated.

Parameters:
data The location where read data is stored
Returns:
The new read pointer

UInt32 BufferManager::readUInt32 ( UInt32 *  data  ) 

Read a 32 bit unsigned int. Endian convesion from network byte order is also done. The read pointer is updated.

Parameters:
data The location where read data is stored
Returns:
The new read pointer

UInt32 BufferManager::setReadPointer ( UInt32  newReadPointer  ) 

Set the network read pointer to desired value. Has no other checks and effects. This will not effect the data size of the buffer until something is actually read from the new location.

Parameters:
newReadPointer The new value of network read pointer to set.
Returns:
The updated read address

UInt32 BufferManager::setWritePointer ( UInt32  newWritePointer  ) 

Set the network write pointer to desired value.Has no other checks and effects. This will not effect the data size of the buffer until something is actually written to the new location.

Parameters:
newWritePointer The new value of network write pointer to set.
Returns:
The updated write address

UInt32 BufferManager::writebit ( UInt32  bitCount,
UInt32  data 
)

Write bits in multiple of 8. The write pointer and data size are updated

Parameters:
bitCount Number of bits to write, must be a multiple of 8
data The bits of data to write
Returns:
The new write pointer

UInt32 BufferManager::writeByte ( Byte  data  ) 

Write a byte of network byte to the buffer at the write pointer. The write pointer and data size are updated.

Parameters:
data The byte of data to write
Returns:
The new write pointer

UInt32 BufferManager::writeData ( Byte *  buffer,
UInt32  count 
)

Add directly bytes of data provided into storage. The bytes are assumed to be in network order

Parameters:
buffer Address of location from where data is to be added
count Number of bytes to be added

UInt32 BufferManager::writeUInt16 ( UInt16  data  ) 

Write a 16 bit unsigned short int. Endian convesion to network byte order is also done. The write pointer and data size are updated.

Parameters:
data The data to write
Returns:
The new write pointer

UInt32 BufferManager::writeUInt32 ( UInt32  data  ) 

Write a 32 bit unsigned int. Endian convesion to network byte order is also done. The write pointer and data size are updated.

Parameters:
data The data to write
Returns:
The new write pointer


The documentation for this class was generated from the following files:
Generated on Sun Aug 20 15:06:40 2006 for ISOCodec by  doxygen 1.4.7