This class represents a stream of bytes that contains (or will contain) serialized data. More...
#include <FastBuffer.h>
Public Types | |
typedef _FastBuffer_iterator | iterator |
Public Member Functions | |
FastBuffer () | |
This constructor creates an internal stream and assigns it to the eprosima::fastcdr::FastBuffers object. More... | |
FastBuffer (char *const buffer, const size_t bufferSize) | |
This constructor assigns the user's stream of bytes to the eprosima::fastcdr::FastBuffers object. More... | |
FastBuffer (FastBuffer &&fbuffer) | |
Move constructor. More... | |
FastBuffer & | operator= (FastBuffer &&fbuffer) |
Move assignment. More... | |
virtual | ~FastBuffer () |
Default destructor. More... | |
char * | getBuffer () const |
This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data. More... | |
size_t | getBufferSize () const |
This function returns the size of the allocated memory of the stream that the eprosima::fastcdr::FastBuffers uses to serialize data. More... | |
iterator | begin () |
This function returns a iterator that points to the begining of the stream. More... | |
iterator | end () |
This function returns a iterator that points to the end of the stream. More... | |
bool | reserve (size_t size) |
This function reserves memory for the internal raw buffer. More... | |
bool | resize (size_t minSizeInc) |
This function resizes the raw buffer. More... | |
This class represents a stream of bytes that contains (or will contain) serialized data.
This class is used by the serializers to serialize or deserialize using their representation.
typedef _FastBuffer_iterator iterator |
FastBuffer | ( | ) |
This constructor creates an internal stream and assigns it to the eprosima::fastcdr::FastBuffers object.
The user can obtain this internal stream using the function eprosima::fastcdr::FastBuffers::getBuffer(). Be careful because this internal stream is deleted in the destruction of the eprosima::fastcdr::FastBuffers object.
FastBuffer | ( | char *const | buffer, |
const size_t | bufferSize | ||
) |
This constructor assigns the user's stream of bytes to the eprosima::fastcdr::FastBuffers object.
The user's stream will be used to serialize.
buffer | The user's buffer that will be used. This buffer is not deallocated in the object's destruction. Cannot be NULL. |
bufferSize | The length of user's buffer. |
|
inline |
Move constructor.
|
virtual |
Default destructor.
|
inline |
This function returns a iterator that points to the begining of the stream.
|
inline |
This function returns a iterator that points to the end of the stream.
|
inline |
This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
|
inline |
This function returns the size of the allocated memory of the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
|
inline |
Move assignment.
bool reserve | ( | size_t | size | ) |
This function reserves memory for the internal raw buffer.
It will only do so if the buffer is not yet allocated and is not externally set.
size | The size of the memory to be allocated. |
bool resize | ( | size_t | minSizeInc | ) |
This function resizes the raw buffer.
It will call the user's defined function for this purpose.
minSizeInc | The minimun growth expected of the current raw buffer. |