pjmsg_mcap_wrapper
|
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.
Definition at line 243 of file FastBuffer.h.
#include <FastBuffer.h>
Public Types | |
typedef _FastBuffer_iterator | iterator |
Public Member Functions | |
FastBuffer ()=default | |
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. | |
FastBuffer (FastBuffer &&fbuffer) | |
Move constructor. | |
FastBuffer & | operator= (FastBuffer &&fbuffer) |
Move assignment. | |
virtual | ~FastBuffer () |
Default destructor. | |
char * | getBuffer () const |
This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data. | |
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. | |
iterator | begin () |
This function returns a iterator that points to the begining of the stream. | |
iterator | end () |
This function returns a iterator that points to the end of the stream. | |
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. | |
bool | resize (size_t min_size_inc) |
This function resizes the raw buffer. It will call the user's defined function for this purpose. | |
Private Member Functions | |
FastBuffer (const FastBuffer &)=delete | |
FastBuffer & | operator= (const FastBuffer &)=delete |
Private Attributes | |
char * | buffer_ { nullptr } |
Pointer to the stream of bytes that contains the serialized data. | |
size_t | size_ { 0 } |
The total size of the user's buffer. | |
bool | m_internalBuffer { true } |
This variable indicates if the managed buffer is internal or is from the user. | |
Definition at line 247 of file FastBuffer.h.
|
default |
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::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. |
Definition at line 27 of file FastBuffer.cpp.
|
inline |
Move constructor.
Definition at line 268 of file FastBuffer.h.
|
virtual |
Default destructor.
Definition at line 36 of file FastBuffer.cpp.
|
privatedelete |
|
inline |
This function returns a iterator that points to the begining of the stream.
Definition at line 317 of file FastBuffer.h.
|
inline |
This function returns a iterator that points to the end of the stream.
Definition at line 327 of file FastBuffer.h.
|
inline |
This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
Definition at line 298 of file FastBuffer.h.
|
inline |
This function returns the size of the allocated memory of the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
Definition at line 307 of file FastBuffer.h.
|
privatedelete |
|
inline |
Move assignment.
Definition at line 280 of file FastBuffer.h.
bool FastBuffer::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. |
Definition at line 44 of file FastBuffer.cpp.
bool FastBuffer::resize | ( | size_t | min_size_inc | ) |
This function resizes the raw buffer. It will call the user's defined function for this purpose.
min_size_inc | The minimun growth expected of the current raw buffer. |
Definition at line 59 of file FastBuffer.cpp.
|
private |
Pointer to the stream of bytes that contains the serialized data.
Definition at line 357 of file FastBuffer.h.
|
private |
This variable indicates if the managed buffer is internal or is from the user.
Definition at line 363 of file FastBuffer.h.
|
private |
The total size of the user's buffer.
Definition at line 360 of file FastBuffer.h.