|
| std::vector< uint8_t > const & | data () const noexcept |
| | Access the payload buffer.
|
| std::vector< uint8_t > | takeData () noexcept |
| | Move the payload buffer out of the message.
|
| Kind | kind () const override |
| | This message belongs to the data-plane connectivity domain.
|
| MessagePtr | clone () const override |
| | Clone this message (deep copy).
|
| | DISABLE_COPY_AND_MOVE (Message) |
| | Messages are non-copyable and non-movable.
|
| virtual | ~Message () |
| | Virtual destructor.
|
template<typename Clock = std::chrono::steady_clock>
requires std::chrono::is_clock_v<Clock> |
| std::chrono::time_point< Clock, std::chrono::microseconds > | timestampToTimePoint () const noexcept |
| | Convert timestamp() into a time_point of the given clock type.
|
| void | addToPathTaken (std::string path) |
| | Append one hop to the message path trace.
|
| template<DerivedFromMessage T> |
| bool | is () const noexcept |
| | Check whether this message is of a given derived type.
|
| template<DerivedFromMessage T> |
| T & | as () noexcept |
| | Cast this message to a derived type (unchecked).
|
| template<DerivedFromMessage T> |
| T const & | as () const noexcept |
| | Cast this message to a derived type (unchecked).
|
| Utils::UUID const & | uuid () const noexcept |
| | Unique identifier of this message instance.
|
| Utils::UUID const & | parentUuid () const noexcept |
| | UUID of the parent message if created from one, otherwise default UUID value.
|
| std::vector< std::string > const & | pathTaken () const noexcept |
| | Sequence of "node.port" hops this message has traversed.
|
| std::chrono::microseconds | timestamp () const noexcept |
| | Construction timestamp in microseconds since timestampClock epoch. This is not "wall clock time" unless timestampClock is CLOCK_REALTIME.
|
| bool | hasMimeType () const noexcept |
| | Whether the message carries an explicit MIME type.
|
| MimeType | mimeType () const noexcept |
| | Get the message MIME type. If no explicit MIME type is set, returns dfx::Core::MimeType::OctetStream.
|
| void | setMimeType (MimeType mimeType) |
| | Set the message MIME type.
|
| void | resetMimeType () |
| | Clear the explicit MIME type (message then defaults to octet-stream).
|
|
| void | cloneFromBase (Message const &base) override |
| | Copy base and derived state from base into this instance.
|
| | DataMessage (std::vector< uint8_t > data, MessagePtr const &parent=nullptr) |
| | Construct a data message with a payload, optionally inheriting from a parent.
|
| | DataMessage (std::vector< uint8_t > data, MimeType mimeType, MessagePtr const &parent=nullptr) |
| | Construct a data message with payload and explicit MIME type.
|
| | Message (MessagePtr const &parent=nullptr) |
| | Construct a message, optionally inheriting state from a parent message.
|
| | Message (MimeType mimeType, MessagePtr const &parent=nullptr) |
| | Construct a message with an explicit MIME type, optionally inheriting from a parent.
|
| | Message (MessagePtr const &parent=nullptr) |
| | Construct a message, optionally inheriting state from a parent message.
|
| | Message (MimeType mimeType, MessagePtr const &parent=nullptr) |
| | Construct a message with an explicit MIME type, optionally inheriting from a parent.
|
Data-plane message containing an owned byte buffer.
- Payload ownership
- The message owns its payload buffer:
- data() returns a const view of the internal std::vector<uint8_t>.
- takeData() moves the buffer out, leaving the message with an empty payload.
- MIME type
- MIME type is handled by the base Message :
- The constructor overload that takes a MimeType sets an explicit MIME type (Message(mimeType, parent)).
- The other overload inherits base state from
parent (UUID parent link, and optional MIME type) but does not force a MIME type.
- Note
- The base class forbids MimeType::Any on messages (asserted in Message).
- Cloning
- clone() produces a new DataMessage and copies:
- all base fields via Message::cloneFromBase(...)
- the payload buffer (_data)
- Note
- In dfx, fan-out delivery relies on cloning so each channel gets an independent message instance.