Class that serves as the base for the NativeByteBuffer and NetworkByteBuffer classes. More...
#include <SPL/Runtime/Serialization/ByteBuffer.h>
template<class BufferType>
class SPL::ByteBuffer< BufferType >
Class that serves as the base for the NativeByteBuffer and NetworkByteBuffer classes.
This is a class template that uses the curiously recurring template pattern to implement compile-time polymorphism.
template<class BufferType>
Add/serialize a character to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a character from the serialization buffer
- Returns
- a character
template<class BufferType>
Add/serialize a boolean to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a boolean from the serialization buffer
- Returns
- a boolean
template<class BufferType>
Add/serialize an uint8_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a uint8_t from the serialization buffer
- Returns
- an uint8_t
template<class BufferType>
Add/serialize an int8_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize an int8_t from the serialization buffer
- Returns
- an int8_t
template<class BufferType>
Add/serialize an uint16_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a uint16_t from the serialization buffer
- Returns
- a uint16_t
template<class BufferType>
Add/serialize an int16_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize an int16_t from the serialization buffer
- Returns
- an int16_t
template<class BufferType>
Add/serialize a uint32_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a uint32_t from the serialization buffer
- Returns
- a uint32_t
template<class BufferType>
Add/serialize an int32_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize an int32_t from the serialization buffer
- Returns
- an int32_t
template<class BufferType>
Add/serialize a uint64_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a uint64_t from the serialization buffer
- Returns
- a uint64_t
template<class BufferType>
Add/serialize an int64_t to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize an int64_t from the serialization buffer
- Returns
- an int64_t
template<class BufferType>
Add/serialize a float to the serialization buffer
- Parameters
-
f |
a float (floating point number) |
template<class BufferType>
Extract/de-serialize a float from the serialization buffer
- Returns
- a float
template<class BufferType>
Add/serialize a double to the serialization buffer
- Parameters
-
d |
a double floating point number) |
template<class BufferType>
Extract/de-serialize a double from the serialization buffer
- Returns
- a double
template<class BufferType>
Add/serialize a long double to the serialization buffer
- Parameters
-
d |
a long double floating point number) |
template<class BufferType>
Extract/de-serialize a long double from the serialization buffer
- Returns
- a double
template<class BufferType>
Add/serialize a NULL-terminated string to the serialization buffer
- Parameters
-
str |
a NULL terminated string |
template<class BufferType>
Extract/de-serialize a NULL-terminated string from the serialization buffer
- Returns
- a pointer to a NULL-terminated string
template<class BufferType>
void SPL::ByteBuffer< BufferType >::addSTLString |
( |
std::string const & |
str |
) |
|
|
inline |
Add/serialize an STL string to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize an STL string from the serialization buffer
- Returns
- an STL string
template<class BufferType>
Extract/de-serialize an STL string from the serialization buffer
- Parameters
-
str |
string to be assigned |
template<class BufferType>
Add/serialize an SPL string to the serialization buffer
- Parameters
-
Add/serialize an SPL string to the serialization buffer
- Parameters
-
template<class BufferType >
Extract/de-serialize an SPL string from the serialization buffer
- Returns
- an STL string
template<class BufferType>
Extract/de-serialize an SPL string from the serialization buffer
- Parameters
-
str |
string to be assigned |
template<class BufferType>
Add/serialize a ustring to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a ustring from the serialization buffer
- Returns
- a ustring
template<class BufferType>
void SPL::ByteBuffer< BufferType >::addBlob |
( |
void const * |
blob, |
|
|
uint32_t |
blobsize |
|
) |
|
|
|
inline |
Add/serialize an opaque blob to the serialization buffer
- Parameters
-
blob |
a pointer to an opaque blob |
blobsize |
the opaque blob size |
template<class BufferType>
Extract/de-serialize an opaque blob from the serialization buffer
- Parameters
-
size |
the size of the returned opaque blob |
- Returns
- a pointer to an opaque blob
template<class BufferType>
void SPL::ByteBuffer< BufferType >::addCharSequence |
( |
char const * |
chbuf, |
|
|
uint32_t |
chbufsize |
|
) |
|
|
|
inline |
Add/serialize a sequence of characters to the serialization buffer NOTE: the size of the sequence is not serialized (for that use addBlob)
- Parameters
-
chbuf |
a pointer to a sequence of characters |
chbufsize |
the size for the sequence of characters |
template<class BufferType>
char* SPL::ByteBuffer< BufferType >::getCharSequence |
( |
uint32_t & |
sizeTillEOB |
) |
|
|
inline |
Extract/de-serialize a sequence of charaters from the serialization buffer – the sequence begins at the output cursor position and ends at the end of the serialization buffer
- Parameters
-
sizeTillEOB |
this is an out-parameter that will store the size of the returned char sequence |
- Returns
- a pointer to sequence of characters
template<class BufferType>
char* SPL::ByteBuffer< BufferType >::getFixedCharSequence |
( |
uint32_t |
mysize |
) |
|
|
inline |
Extract/de-serialize a fixed-size sequence of characters from the serialization buffer – the sequence begins at the output cursor position
- Parameters
-
mysize |
the size of the sequence serialization buffer |
- Returns
- a pointer to sequence of characters
template<class BufferType>
Add/serialize a pointer to the serialization buffer
- Parameters
-
template<class BufferType>
Extract/de-serialize a pointer from the serialization buffer
- Returns
- a void* pointer
template<class BufferType>
Obtain the size of the content current in the buffer
- Returns
- the size of the content current in the buffer
template<class BufferType>
Obtain the pointer for the internal buffer
- Returns
- a unsigned char* pointer to the internal buffer
template<class BufferType>
Obtain the (const) pointer for the internal buffer
- Returns
- a unsigned char* pointer to the internal buffer
template<class BufferType>
Obtain number of serialized bytes remaining from the location pointed by the output cursor till the end of the buffer
template<class BufferType>
Get the internal buffer output cursor
- Returns
- current output cursor buffer cursor
The documentation for this class was generated from the following files: