CommRaT 2.0.0
C++20 Real-Time Messaging Framework
Loading...
Searching...
No Matches
commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry > Class Template Reference

Phase 8: Mailbox Infrastructure Builder. More...

#include <commrat/module/mailbox/mailbox_infrastructure_builder.hpp>

Inheritance diagram for commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >:
commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >

Static Protected Member Functions

static auto create_mailbox_infrastructure (const ModuleConfig &config)
 Create mailbox infrastructure.
 
template<std::size_t... Is>
static auto create_mailbox_sets_impl (const ModuleConfig &config, std::index_sequence< Is... >)
 Helper to create MailboxSet tuple for multi-output modules.
 
template<std::size_t I>
static auto create_mailbox_set (const ModuleConfig &config)
 Create a single MailboxSet for output type at index I.
 

Detailed Description

template<typename ModuleType, typename UserRegistry>
class commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >

Phase 8: Mailbox Infrastructure Builder.

Static factory methods for creating mailbox infrastructure:

  • Single-output: Creates individual CMD, WORK, PUBLISH mailboxes
  • Multi-output: Creates tuple of MailboxSets (one per output type)

This is pure compile-time dispatch - no instance state.

Template Parameters
ModuleTypeThe derived Module class (for type access only)
UserRegistryThe message registry type

Definition at line 26 of file mailbox_infrastructure_builder.hpp.

Member Function Documentation

◆ create_mailbox_infrastructure()

template<typename ModuleType , typename UserRegistry >
static auto commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >::create_mailbox_infrastructure ( const ModuleConfig config)
inlinestaticprotected

Create mailbox infrastructure.

Always returns tuple of MailboxSets (one per output type). Single-output modules get a tuple with 1 MailboxSet.

Parameters
configModule configuration with system_id, instance_id, etc.
Returns
Tuple of MailboxSets

Definition at line 37 of file mailbox_infrastructure_builder.hpp.

References commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >::create_mailbox_sets_impl().

◆ create_mailbox_set()

template<typename ModuleType , typename UserRegistry >
template<std::size_t I>
static auto commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >::create_mailbox_set ( const ModuleConfig config)
inlinestaticprotected

Create a single MailboxSet for output type at index I.

Each output type gets its own MailboxSet with CMD, WORK, PUBLISH mailboxes at the appropriate base address for that output type.

Template Parameters
IOutput type index
Parameters
configModule configuration
Returns
Initialized MailboxSet for output type I

Definition at line 69 of file mailbox_infrastructure_builder.hpp.

◆ create_mailbox_sets_impl()

template<typename ModuleType , typename UserRegistry >
template<std::size_t... Is>
static auto commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >::create_mailbox_sets_impl ( const ModuleConfig config,
std::index_sequence< Is... >   
)
inlinestaticprotected

Helper to create MailboxSet tuple for multi-output modules.

Uses fold expression to construct tuple with initialized MailboxSets, one for each output type.

Template Parameters
IsIndex sequence (0, 1, 2, ..., num_output_types-1)
Parameters
configModule configuration
Returns
Tuple of MailboxSets

Definition at line 53 of file mailbox_infrastructure_builder.hpp.

Referenced by commrat::MailboxInfrastructureBuilder< ModuleType, UserRegistry >::create_mailbox_infrastructure().


The documentation for this class was generated from the following file: