AnyMessageView Class Reference
|
Space-ng SDK
|
#include <sol3/core/any_message_view.h>
Public Member Functions | |
| AnyMessageView ()=default | |
| Default-constructed, empty view. More... | |
| void | update (SeqRingSlotView const &slot_view, MessageSchema schema, std::chrono::steady_clock::duration time_out) |
| bool | valid () const |
| bool | hasValue () const |
True if valid() and both header and payload buffers are present. More... | |
| operator bool () const | |
| bool | cached () const |
| void | setCached (bool cached) |
| void | checkHasValue () const |
Throws if hasValue() is false. More... | |
| void | checkValid () const |
Throws if valid() is false. More... | |
| msg::MessageHeader const & | header () const |
| template<typename TTableType > | |
| TTableType const & | payload () const |
| uint64_t | seq () const |
| flatbuffers::span< uint8_t const > | headerSpan () const |
| Size-prefixed header buffer. More... | |
| flatbuffers::span< uint8_t const > | payloadSpan () const |
| Non-size-prefixed payload buffer. More... | |
| flatbuffers::span< uint8_t const > | messageSpan () const |
| header and payload span More... | |
| void | reset () |
| MessageSchema const & | schema () const |
| void | payloadToJson (JsonFormat format, std::string &out_json) const |
| std::string | payloadToJson (JsonFormat format) const |
Detailed Description
A validated, read-only view over a single message instance from the ring.
Provides access to the parsed header and payload, along with spans to the underlying buffers. Instances become invalid if the owning reader advances beyond the cached sequence.
Constructor & Destructor Documentation
◆ AnyMessageView()
|
default |
Default-constructed, empty view.
Member Function Documentation
◆ cached()
| bool sol3::core::AnyMessageView::cached | ( | ) | const |
◆ checkHasValue()
| void sol3::core::AnyMessageView::checkHasValue | ( | ) | const |
Throws if hasValue() is false.
◆ checkValid()
| void sol3::core::AnyMessageView::checkValid | ( | ) | const |
Throws if valid() is false.
◆ hasValue()
| bool sol3::core::AnyMessageView::hasValue | ( | ) | const |
True if valid() and both header and payload buffers are present.
◆ header()
| msg::MessageHeader const& sol3::core::AnyMessageView::header | ( | ) | const |
◆ headerSpan()
| flatbuffers::span<uint8_t const> sol3::core::AnyMessageView::headerSpan | ( | ) | const |
Size-prefixed header buffer.
◆ messageSpan()
| flatbuffers::span<uint8_t const> sol3::core::AnyMessageView::messageSpan | ( | ) | const |
header and payload span
◆ operator bool()
| sol3::core::AnyMessageView::operator bool | ( | ) | const |
◆ payload()
|
inline |
◆ payloadSpan()
| flatbuffers::span<uint8_t const> sol3::core::AnyMessageView::payloadSpan | ( | ) | const |
Non-size-prefixed payload buffer.
◆ payloadToJson() [1/2]
| std::string sol3::core::AnyMessageView::payloadToJson | ( | JsonFormat | format | ) | const |
◆ payloadToJson() [2/2]
| void sol3::core::AnyMessageView::payloadToJson | ( | JsonFormat | format, |
| std::string & | out_json | ||
| ) | const |
◆ reset()
| void sol3::core::AnyMessageView::reset | ( | ) |
◆ schema()
| MessageSchema const& sol3::core::AnyMessageView::schema | ( | ) | const |
◆ seq()
| uint64_t sol3::core::AnyMessageView::seq | ( | ) | const |
◆ setCached()
| void sol3::core::AnyMessageView::setCached | ( | bool | cached | ) |
◆ update()
| void sol3::core::AnyMessageView::update | ( | SeqRingSlotView const & | slot_view, |
| MessageSchema | schema, | ||
| std::chrono::steady_clock::duration | time_out | ||
| ) |
Populate this view by copying data from the given slot view. Validates header and payload schema identifiers and sets internal state.
◆ valid()
| bool sol3::core::AnyMessageView::valid | ( | ) | const |
True if this view still refers to the same sequence as the owning reader and contains parsed header/payload.
The documentation for this class was generated from the following file:
- /workspaces/astro/sol3-sdk/cpp/sol3/core/any_message_view.h
Generated by