![]() |
CommRaT 2.0.0
C++20 Real-Time Messaging Framework
|
Mailbox that takes a MessageRegistry and exposes payload-only interface. More...
#include <commrat/mailbox/registry_mailbox.hpp>
Public Member Functions | |
| RegistryMailbox (const MailboxConfig &config) | |
| ~RegistryMailbox ()=default | |
| RegistryMailbox (const RegistryMailbox &)=delete | |
| RegistryMailbox & | operator= (const RegistryMailbox &)=delete |
| RegistryMailbox (RegistryMailbox &&) noexcept=default | |
| RegistryMailbox & | operator= (RegistryMailbox &&) noexcept=default |
| auto | start () -> MailboxResult< void > |
| void | stop () |
| bool | is_running () const |
| uint32_t | mailbox_id () const |
| template<typename PayloadT > requires is_registered<PayloadT> | |
| auto | send (PayloadT &payload, uint32_t dest_mailbox) -> MailboxResult< void > |
| Send a message payload to a destination mailbox. | |
| template<typename PayloadT > requires is_registered<PayloadT> | |
| auto | send (PayloadT &payload, uint32_t dest_mailbox, uint64_t timestamp) -> MailboxResult< void > |
| Send a message payload with explicit timestamp (Phase 6.10) | |
| template<typename PayloadT > requires is_registered<PayloadT> | |
| auto | receive () -> MailboxResult< TimsMessage< PayloadT > > |
| Receive a message of specific payload type (blocking) | |
| template<typename PayloadT > requires is_registered<PayloadT> | |
| auto | try_receive () -> MailboxResult< TimsMessage< PayloadT > > |
| Try to receive a message (non-blocking) | |
| template<typename PayloadT > requires is_registered<PayloadT> | |
| auto | receive_for (std::chrono::milliseconds timeout) -> MailboxResult< TimsMessage< PayloadT > > |
| Receive with timeout. | |
| template<typename Visitor > | |
| auto | receive_any (Visitor &&visitor) -> MailboxResult< void > |
| Receive any registered message type using visitor pattern. | |
| template<typename Visitor > | |
| auto | try_receive_any (Visitor &&visitor) -> MailboxResult< void > |
| template<typename Visitor > | |
| auto | receive_any_for (std::chrono::milliseconds timeout, Visitor &&visitor) -> MailboxResult< void > |
| UnderlyingMailbox & | underlying () |
| const UnderlyingMailbox & | underlying () const |
Static Public Member Functions | |
| static constexpr size_t | num_message_types () |
Static Public Attributes | |
| template<typename PayloadT > | |
| static constexpr bool | is_registered = Registry::template is_registered<PayloadT> |
Mailbox that takes a MessageRegistry and exposes payload-only interface.
Users define their MessageRegistry once with all MessageDefinitions, then use this mailbox with payload types only. No need to repeat MessageDefinition in every send/receive call.
Example:
Definition at line 39 of file registry_mailbox.hpp.
|
inlineexplicit |
Definition at line 54 of file registry_mailbox.hpp.
|
default |
|
delete |
|
defaultnoexcept |
|
inline |
Definition at line 77 of file registry_mailbox.hpp.
|
inline |
Definition at line 81 of file registry_mailbox.hpp.
Referenced by commrat::HistoricalMailbox< UserRegistry, HistorySize >::get_mailbox_id(), and commrat::HistoricalMailbox< UserRegistry, HistorySize >::start().
|
inlinestaticconstexpr |
Definition at line 92 of file registry_mailbox.hpp.
|
delete |
|
defaultnoexcept |
|
inline |
Receive a message of specific payload type (blocking)
Definition at line 166 of file registry_mailbox.hpp.
|
inline |
Receive any registered message type using visitor pattern.
Visitor receives payload types only.
Definition at line 194 of file registry_mailbox.hpp.
|
inline |
Definition at line 204 of file registry_mailbox.hpp.
References commrat::MailboxResult< T >::error(), commrat::RegistryMailbox< Registry >::start(), and commrat::Timeout.
|
inline |
Receive with timeout.
Definition at line 184 of file registry_mailbox.hpp.
|
inline |
Send a message payload to a destination mailbox.
Message ID is automatically determined from the registry.
| PayloadT | Payload type (must be registered) |
| payload | Payload to send |
| dest_mailbox | Destination mailbox ID |
Definition at line 112 of file registry_mailbox.hpp.
References commrat::TimsMessage< PayloadT >::header, and commrat::TimsHeader::msg_type.
|
inline |
Send a message payload with explicit timestamp (Phase 6.10)
Use this for timestamp propagation in message chains.
| PayloadT | Payload type (must be registered) |
| payload | Payload to send |
| dest_mailbox | Destination mailbox ID |
| timestamp | Timestamp to set in header (nanoseconds since epoch) |
Definition at line 141 of file registry_mailbox.hpp.
References commrat::TimsMessage< PayloadT >::header, and commrat::TimsHeader::msg_type.
|
inline |
Definition at line 69 of file registry_mailbox.hpp.
Referenced by commrat::RegistryMailbox< Registry >::receive_any_for(), and commrat::HistoricalMailbox< UserRegistry, HistorySize >::start().
|
inline |
Definition at line 73 of file registry_mailbox.hpp.
Referenced by commrat::HistoricalMailbox< UserRegistry, HistorySize >::stop().
|
inline |
Try to receive a message (non-blocking)
Definition at line 175 of file registry_mailbox.hpp.
|
inline |
Definition at line 199 of file registry_mailbox.hpp.
|
inline |
Definition at line 236 of file registry_mailbox.hpp.
|
inline |
Definition at line 237 of file registry_mailbox.hpp.
|
staticconstexpr |
Definition at line 90 of file registry_mailbox.hpp.