MessageSerializer Class Reference
|
Space-ng SDK
|
#include <sol3/core/message_serializer.h>
Public Member Functions | |
| MessageSerializer (MessagePort port) | |
| Initialize with the destination message port. More... | |
| MessagePort const & | port () const |
| Destination message port. More... | |
| msg::MessageHeaderT const & | header () const |
| A constant view of the message header. More... | |
| void | addStamp (msg::Stamp const &stamp) |
| Append a timestamp to the header. More... | |
| flatbuffers::span< uint8_t const > | headerSpan () const |
| Size-prefixed header span for the most recently finished message. More... | |
| size_t | finishHeaderFromPayloadBuffer (flatbuffers::span< uint8_t const > payload_span, msg::Stamp stamp) |
| flatbuffers::span< uint8_t const > | payloadSpan () const |
| Non-size-prefixed payload span for the most recently finished message. More... | |
| template<typename TTableType , typename TBuilderFunction > | |
| size_t | finishPayload (TBuilderFunction &&builder_function, msg::Stamp stamp) |
| template<typename TNativeTableType > | |
| size_t | finishPayload (TNativeTableType const &payload, msg::Stamp stamp) |
Detailed Description
Provides FlatBuffers builders and common utilities to finish a payload, retrieve header/payload spans, and add stamps.
Constructor & Destructor Documentation
◆ MessageSerializer()
|
explicit |
Initialize with the destination message port.
Member Function Documentation
◆ addStamp()
|
inline |
Append a timestamp to the header.
◆ finishHeaderFromPayloadBuffer()
|
inline |
Builds a size-prefixed header for a provided payload span without copying the payload into the serializer.
◆ finishPayload() [1/2]
|
inline |
◆ finishPayload() [2/2]
|
inline |
This function serializes the payload, and header. After this call the latest header and payload are available in serialized form via calls to headerSpan and payloadSpan Note that this will add the given stamp to the header, and then clear the stamps field of the header after serialization. This function also increments the header's count field. returns the size of the header + payload span
◆ header()
|
inline |
A constant view of the message header.
◆ headerSpan()
|
inline |
Size-prefixed header span for the most recently finished message.
◆ payloadSpan()
| flatbuffers::span<uint8_t const> sol3::core::MessageSerializer::payloadSpan | ( | ) | const |
Non-size-prefixed payload span for the most recently finished message.
◆ port()
|
inline |
Destination message port.
The documentation for this class was generated from the following file:
- /workspaces/astro/sol3-sdk/cpp/sol3/core/message_serializer.h
Generated by