Class that represents a binary serialization buffer, using native byte ordering. More...

#include <SPL/Runtime/Serialization/NativeByteBuffer.h>

Inheritance diagram for SPL::NativeByteBuffer:
Inheritance graph
SPL::ByteBuffer\< NativeByte\lBuffer \>
[legend]

List of all members.


Detailed Description

Class that represents a binary serialization buffer, using native byte ordering.

Objects can be serialiazed into the buffer or de-serialized from the buffer in binary form. In a typical case, the underlying memory is managed (allocated/resized/deallocated) by the NativeByteBuffer class. Such a behavior can be changed by handing a buffer to the constructor that takes an externally allocated buffer. In such case the underlying memory will have to be deallocated externally, unless setAutoDealloc is invoked to re-assign the memory management tasks to the class.

Important note: This class is highly optimized for speed, and thus does not perform any bounds checking for its operations.


Constructor & Destructor Documentation

Default Constructor

Constructor

Parameters:

Constructor – used for handing externally allocated buffers to NativeByteBuffer (the default behavior is for the memory management capabilities to reside with the external entity, i.e., by default memory will have to be deallocated externally). The input cursor for serialization is initialized to point to the end of the buffer, and the output cursor for deserialization is initialized to point to the beginning of the buffer.

Parameters:

Copy constructor

Parameters:

Destructive copy Constructor

Parameters:

Destructor


Member Function Documentation

Assign a serialization buffer object to another

Parameters:

Copy the serialized contents of another buffer object Do not change any properties of the buffer, just the data gets copied

Parameters:

Add/serialize a character to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a character from the serialization buffer

Returns:
a character

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a boolean to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a boolean from the serialization buffer

Returns:
a boolean

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an uint8_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an uint8_t from the serialization buffer

Returns:
a uint8_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an int8_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an int8_t from the serialization buffer

Returns:
an int8_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an uint16_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a uint16_t from the serialization buffer

Returns:
a uint16_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an int16_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an int16_t from the serialization buffer

Returns:
an int16_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an uint32_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a uint32_t from the serialization buffer

Returns:
a uint32_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an int32_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an int32_t from the serialization buffer

Returns:
an int32_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a uint64_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a uint64_t from the serialization buffer

Returns:
a uint64_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an int64_t to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an int64_t from the serialization buffer

Returns:
an int64_t

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a float to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a float from the serialization buffer

Returns:
a single-precision floating point number

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a double to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a double from the serialization buffer

Returns:
a double-precision floating point number

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a long double to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a long double from the serialization buffer

Returns:
a long double floating point number

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a NULL-terminated string to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a NULL-terminated string from the serialization buffer

Returns:
a pointer to a NULL-terminated string

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an STL string to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an STL string from the serialization buffer

Returns:
an STL string

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an STL string from the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an SPL string to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an SPL string from the serialization buffer

Returns:
an SPL string

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an SPL string from the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a ustring to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a ustring from the serialization buffer

Returns:
a ustring

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize an opaque blob to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize an opaque blob from the serialization buffer

Parameters:
Returns:
a pointer to an opaque blob

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a sequence of characters to the serialization buffer NOTE: the size of the sequence is not serialized (for that use addBlob)

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a sequence of characters from the serialization buffer – the sequence begins at the output cursor position and ends at the end of the serialization buffer

Parameters:
Returns:
a pointer to sequence of characters

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a fixed-size sequence of characters from the serialization buffer – the sequence begins at the output cursor position

Parameters:
Returns:
a pointer to sequence of characters

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Add/serialize a pointer to the serialization buffer

Parameters:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Extract/de-serialize a pointer from the serialization buffer

Returns:
an void* pointer
Exceptions:

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Set the cursor for the next serialization operation

Parameters:

Get the internal buffer input cursor

Returns:
current input cursor buffer cursor

Obtain the size of the content currently in the buffer

Returns:
the size of the content currently in the buffer

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Obtain the size of the buffer

Returns:
the size of the buffer

Set the cursor for the next de-serialization operation

Parameters:

Get the internal buffer output cursor

Returns:
current output cursor buffer cursor

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Obtain number of serialized bytes remaining from the location pointed by the output cursor till the end of the buffer

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Obtain the pointer for the internal buffer

Returns:
an unsigned char* pointer to the internal buffer

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Obtain the (const) pointer for the internal buffer

Returns:
a unsigned char* pointer to the internal buffer

Reimplemented from SPL::ByteBuffer< NativeByteBuffer >.

Obtain the actual size of the serialized data (as opposed to the size of the serialization buffer)

Returns:
the size of the serialized data

Set/reset the auto deallocation flag (true means that the buffer is self-managed and false means that the buffer is externally managed/owned)

Parameters:

Equality Operator, checks if the buffer size and binary contents are the same

Parameters:
Returns:
true if they are equivalent, false otherwise

Inequality operator, checks if the buffer size and binary contents are the same

Parameters:
Returns:
true if they are not equivalent, false otherwise

The documentation for this class was generated from the following file: