Helper class that wraps the flatbuffers::FlatBufferBuilder.
#include <SynFlatBuffersManager.h>
◆ SynFlatBuffersManager()
chrono::synchrono::SynFlatBuffersManager::SynFlatBuffersManager |
( |
int |
msg_length = 1024 | ) |
|
Construct a flatbuffers manager with a builder starting length.
- Parameters
-
msg_length | Initialize size hint for the underlying buffer |
◆ ~SynFlatBuffersManager()
chrono::synchrono::SynFlatBuffersManager::~SynFlatBuffersManager |
( |
| ) |
|
|
inline |
◆ AddMessage()
void chrono::synchrono::SynFlatBuffersManager::AddMessage |
( |
std::shared_ptr< SynMessage > |
message | ) |
|
Adds a SynMessage to the flatbuffer message buffer.
Will call MessageFromState automatically
- Parameters
-
◆ Finish()
void chrono::synchrono::SynFlatBuffersManager::Finish |
( |
bool |
size_prefixed = true | ) |
|
Completes the flatbuffer message.
Creates a buffer message, of which stores every message If size_prefixed, Completes the flatbuffer message with a 4 bytes in the front of the buffer, which has the size of the byte array
- Parameters
-
size_prefixed | whether the buffer should be finished size prefixed |
◆ GetBufferPointer()
uint8_t* chrono::synchrono::SynFlatBuffersManager::GetBufferPointer |
( |
| ) |
|
|
inline |
Get the buffer pointer from the builder.
- Returns
- uint8_t* the buffer pointer
◆ GetBuilder()
flatbuffers::FlatBufferBuilder& chrono::synchrono::SynFlatBuffersManager::GetBuilder |
( |
| ) |
|
|
inline |
Gets the FlatBufferBuilder associated with this manager.
- Returns
- flatbuffers::FlatBufferBuilder& the underlying builder
◆ GetFlatBufferMessageList()
SynFlatBufferMessageList& chrono::synchrono::SynFlatBuffersManager::GetFlatBufferMessageList |
( |
| ) |
|
|
inline |
Get the FlatBufferMessageList that is used to store outgoing messages.
- Returns
- SynFlatBufferMessageList& the flatbuffer message list
◆ GetMessages()
SynMessageList& chrono::synchrono::SynFlatBuffersManager::GetMessages |
( |
| ) |
|
|
inline |
Get the SynMessageList that is used to store received messages.
- Returns
- SynMessageList the message list
◆ GetSize()
int32_t chrono::synchrono::SynFlatBuffersManager::GetSize |
( |
| ) |
|
|
inline |
Get the size of the underlying finished buffer.
Convenience Functions
- Returns
- int32_t the size of the buffer
◆ ProcessBuffer()
void chrono::synchrono::SynFlatBuffersManager::ProcessBuffer |
( |
std::vector< uint8_t > & |
data, |
|
|
SynMessageList & |
messages |
|
) |
| |
Process a data buffer with the assumption it is a SynFlatBuffers::Buffer message.
- Parameters
-
data | the data to process |
messages | reference to message list to store the parsed messages |
◆ Reset()
void chrono::synchrono::SynFlatBuffersManager::Reset |
( |
void |
| ) |
|
Reset the flatbuffer.
Must be called, otherwise messages will just continue to be added to the vector
◆ ToMessageBuffer()
std::vector< uint8_t > chrono::synchrono::SynFlatBuffersManager::ToMessageBuffer |
( |
| ) |
|
Creates a vector from the flatbuffer data.
- Returns
- std::vector<uint8_t> the message buffer
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_synchrono/flatbuffer/SynFlatBuffersManager.h
- /builds/uwsbel/chrono/src/chrono_synchrono/flatbuffer/SynFlatBuffersManager.cpp