![]() |
CommRaT 2.0.0
C++20 Real-Time Messaging Framework
|
Complete set of mailboxes for one output type. More...
#include <commrat/module/mailbox/mailbox_set.hpp>
Public Types | |
| using | CmdMailbox = std::conditional_t< sizeof...(CommandTypes)==0, TypedMailbox< UserRegistry, SendOnlyTypes< OutputType > >, TypedMailbox< UserRegistry, ReceiveTypes< CommandTypes... >, SendOnlyTypes< OutputType > > > |
| using | WorkMailbox = RegistryMailbox< SystemRegistry > |
| using | PublishMailbox = TypedMailbox< UserRegistry, OutputType > |
Public Member Functions | |
| template<std::size_t OutputIndex = 0> | |
| void | initialize (const ModuleConfig &config) |
| Initialize all mailboxes in this set. | |
Static Public Member Functions | |
| static constexpr uint32_t | calculate_base (uint8_t system_id, uint8_t instance_id) |
| Calculate base address for this output type. | |
Public Attributes | |
| std::optional< CmdMailbox > | cmd |
| std::optional< WorkMailbox > | work |
| std::optional< PublishMailbox > | publish |
| uint32_t | base_address {0} |
Complete set of mailboxes for one output type.
Each output type in a multi-output module gets its own MailboxSet. All mailboxes share the same base address: [output_type_id:16][system_id:8][instance_id:8]
Architecture:
NOTE: These offsets are defined in MailboxType enum (module_config.hpp) All code MUST use MailboxType::DATA, not literal offsets!
| UserRegistry | The message registry for user-defined types |
| OutputType | The specific output data type this set serves |
| CommandTypes | Variadic list of command types (for CMD mailbox) |
Definition at line 35 of file mailbox_set.hpp.
| using commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::CmdMailbox = std::conditional_t< sizeof...(CommandTypes) == 0, TypedMailbox<UserRegistry, SendOnlyTypes<OutputType> >, TypedMailbox<UserRegistry, ReceiveTypes<CommandTypes...>, SendOnlyTypes<OutputType> > > |
Definition at line 37 of file mailbox_set.hpp.
| using commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::PublishMailbox = TypedMailbox<UserRegistry, OutputType> |
Definition at line 46 of file mailbox_set.hpp.
| using commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::WorkMailbox = RegistryMailbox<SystemRegistry> |
Definition at line 45 of file mailbox_set.hpp.
|
inlinestaticconstexpr |
Calculate base address for this output type.
Definition at line 58 of file mailbox_set.hpp.
Referenced by commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::initialize().
|
inline |
Initialize all mailboxes in this set.
| OutputIndex | Index of this output in multi-output (default 0) |
Definition at line 70 of file mailbox_set.hpp.
References commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::base_address, commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::calculate_base(), commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::cmd, commrat::CMD, commrat::ModuleConfig::has_multi_output_config(), commrat::ModuleConfig::instance_id(), commrat::MailboxConfig::mailbox_id, commrat::MessageRegistry< MessageDefs >::max_message_size, commrat::ModuleConfig::message_slots, commrat::ModuleConfig::name, commrat::ModuleConfig::priority, commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::publish, commrat::PUBLISH, commrat::ModuleConfig::realtime, commrat::ModuleConfig::system_id(), commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::work, and commrat::WORK.
| uint32_t commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::base_address {0} |
Definition at line 53 of file mailbox_set.hpp.
Referenced by commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::initialize().
| std::optional<CmdMailbox> commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::cmd |
Definition at line 49 of file mailbox_set.hpp.
Referenced by commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::initialize().
| std::optional<PublishMailbox> commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::publish |
Definition at line 51 of file mailbox_set.hpp.
Referenced by commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::initialize().
| std::optional<WorkMailbox> commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::work |
Definition at line 50 of file mailbox_set.hpp.
Referenced by commrat::MailboxSet< UserRegistry, OutputType, CommandTypes >::initialize().