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

Timestamp Management Architecture. More...

#include <commrat/registry_module.hpp>

Inheritance diagram for commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >:
commrat::InputMetadataManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > > commrat::MailboxInfrastructureBuilder< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry > commrat::WorkLoopHandler< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > > commrat::LifecycleManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > > commrat::CommandDispatcher< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, CommandTypes... > commrat::InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > > commrat::LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > > commrat::MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, OutputTypesTuple< NormalizeOutput< OutputSpec_ >::Type >::type > commrat::MultiInputProcessorBase< InputTypesTuple_, OutputData_, InputCount_ > commrat::SingleOutputProcessorBase< ExtractInputPayload< NormalizeInput< InputSpec_ >::Type >::type, ExtractOutputPayload< NormalizeOutput< OutputSpec_ >::Type >::type > commrat::MultiOutputProcessorBase< OutputTypesTuple< NormalizeOutput< OutputSpec_ >::Type >::type, ExtractInputPayload< NormalizeInput< InputSpec_ >::Type >::type > commrat::ContinuousProcessorBase< ExtractInputPayload< NormalizeInput< InputSpec_ >::Type >::type, ExtractOutputPayload< NormalizeOutput< OutputSpec_ >::Type >::type >

Public Types

using OutputData = typename ModuleTypes::OutputData
 
using InputData = typename ModuleTypes::InputData
 

Public Member Functions

 Module (const ModuleConfig &config)
 
virtual ~Module ()
 
 Module (const Module &)=delete
 
Moduleoperator= (const Module &)=delete
 
 Module (Module &&)=delete
 
Moduleoperator= (Module &&)=delete
 
virtual void on_init ()
 
virtual void on_start ()
 
virtual void on_stop ()
 
virtual void on_cleanup ()
 
template<std::size_t Index>
auto & get_publish_mailbox_public ()
 Get publish mailbox by index (public for Publisher access)
 
template<std::size_t Index>
auto & get_cmd_mailbox_public ()
 Get cmd mailbox by index (public for Publisher access) Phase 7: CMD mailbox used for publishing.
 
void handle_subscribe_request (const SubscribeRequestPayload &req, std::size_t output_idx=0)
 
void handle_subscribe_reply (const SubscribeReplyPayload &reply)
 
void handle_unsubscribe_request (const UnsubscribeRequestPayload &req)
 
void add_subscriber_to_output (uint32_t subscriber_base_addr, uint8_t mailbox_index, std::size_t output_idx=0)
 Add subscriber to correct output-specific list.
 
void remove_subscriber (uint32_t subscriber_base_addr)
 Remove subscriber (for unsubscribe)
 
- Public Member Functions inherited from commrat::MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, OutputTypesTuple< NormalizeOutput< OutputSpec_ >::Type >::type >
std::vector< SubscriberInfoget_output_subscribers (std::size_t output_idx) const
 Get subscribers for specific output index.
 
void remove_subscriber (uint32_t subscriber_base_addr)
 Remove subscriber from all output lists.
 
auto & get_publish_mailbox_public ()
 Get PUBLISH mailbox for specific output index (public accessor)
 
- Public Member Functions inherited from commrat::LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
void periodic_loop ()
 Periodic loop - time-driven data generation.
 
void free_loop ()
 Free loop - maximum throughput data generation.
 
void continuous_loop ()
 Continuous loop - event-driven single input processing.
 
void multi_input_loop ()
 Multi-input loop - synchronized multi-input processing.
 
- Public Member Functions inherited from commrat::InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
auto get_input_metadata () const
 
auto get_input_metadata () const
 
uint64_t get_input_timestamp () const
 Get input timestamp by index (convenience method)
 
uint64_t get_input_timestamp () const
 Get input timestamp by type (convenience method)
 
bool has_new_data () const
 Check if input has new data by index.
 
bool has_new_data () const
 Check if input has new data by type.
 
bool is_input_valid () const
 Check if input is valid by index.
 
bool is_input_valid () const
 Check if input is valid by type.
 
- Public Member Functions inherited from commrat::LifecycleManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
void start ()
 Start the module.
 
void stop ()
 Stop the module.
 
bool is_running () const
 Check if module is currently running.
 

Static Public Attributes

static constexpr bool has_continuous_input = ModuleTypes::has_continuous_input
 
static constexpr bool has_periodic_input = ModuleTypes::has_periodic_input
 
static constexpr bool has_loop_input = ModuleTypes::has_loop_input
 
static constexpr bool has_multi_output = ModuleTypes::has_multi_output
 

Protected Types

using SubscriptionProtocolType = commrat::SubscriptionProtocol< UserRegistry, has_continuous_input, has_multi_input, InputData, InputTypesTuple, InputCount, OutputData, OutputTypesTuple >
 
using PublisherType = commrat::Publisher< UserRegistry, OutputData, PublishMailbox, Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 

Protected Member Functions

CmdMailbox & cmd_mailbox ()
 
WorkMailbox & work_mailbox ()
 
PublishMailbox & publish_mailbox ()
 
template<std::size_t Index>
auto & get_mailbox_set ()
 
template<std::size_t Index>
auto & get_publish_mailbox ()
 
template<std::size_t Index>
auto & get_work_mailbox ()
 
template<std::size_t Index>
auto & get_cmd_mailbox ()
 
template<std::size_t... Is>
void initialize_mailbox_infrastructure_impl (const ModuleConfig &config, std::index_sequence< Is... >)
 
template<typename T = InputData, typename O = OutputData, typename = std::enable_if_t<!std::is_void_v<O> && !is_tuple_v<O>>>
void process_dispatch (const T &input, O &output)
 
void subscribe_to_all_sources ()
 
void subscribe_to_source (uint8_t source_system_id, uint8_t source_instance_id)
 
void unsubscribe_from_source (uint8_t source_system_id, uint8_t source_instance_id)
 
void unsubscribe_from_multi_input_source (const MultiInputConfig::InputSource &source)
 
template<typename T = OutputData>
requires (!std::is_void_v<T>)
void publish_to_subscribers (T &data)
 
template<typename T >
void publish_tims_message (TimsMessage< T > &tims_msg)
 
template<typename... Ts>
void publish_multi_outputs (std::tuple< Ts... > &outputs)
 
template<typename... Ts>
void publish_multi_outputs_with_timestamp (std::tuple< Ts... > &outputs, uint64_t timestamp_ns)
 
- Protected Member Functions inherited from commrat::ContinuousProcessorBase< ExtractInputPayload< NormalizeInput< InputSpec_ >::Type >::type, ExtractOutputPayload< NormalizeOutput< OutputSpec_ >::Type >::type >
virtual void process (const ExtractInputPayload< NormalizeInput< InputSpec_ >::Type >::type &input, ExtractOutputPayload< NormalizeOutput< OutputSpec_ >::Type >::type &output)
 
- Protected Member Functions inherited from commrat::MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, OutputTypesTuple< NormalizeOutput< OutputSpec_ >::Type >::type >
Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & derived ()
 
const Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & derived () const
 
void initialize_output_subscribers ()
 Initialize per-output subscriber lists.
 
void add_subscriber_to_output (uint32_t subscriber_base_addr, uint8_t input_index=0, std::size_t output_idx=0)
 Add subscriber to correct output-specific list.
 
std::size_t find_output_index_by_type_id (uint16_t type_id_low) const
 Public wrapper for find_output_index_by_type_id_impl.
 
void spawn_all_output_work_threads (std::index_sequence< Is... >)
 Spawn all output work threads.
 
void spawn_output_work_thread ()
 Spawn work thread for a specific output index.
 
void join_output_work_threads ()
 Join all output work threads.
 
void output_work_loop ()
 Work loop for a specific output index.
 
void start_all_mailbox_sets (std::index_sequence< Is... >)
 Start all MailboxSets (CMD/WORK/PUBLISH mailboxes)
 
void start_mailbox_set ()
 Start a single MailboxSet (CMD/WORK/PUBLISH)
 
void stop_all_mailbox_sets (std::index_sequence< Is... >)
 Stop all MailboxSets.
 
void stop_mailbox_set ()
 Stop a single MailboxSet (CMD/WORK/PUBLISH)
 
auto & get_mailbox_set ()
 Get specific MailboxSet by index.
 
auto & get_cmd_mailbox ()
 Get CMD mailbox for specific output index.
 
auto & get_work_mailbox ()
 Get WORK mailbox for specific output index.
 
auto & get_publish_mailbox ()
 Get PUBLISH mailbox for specific output index (internal)
 
- Protected Member Functions inherited from commrat::LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & module ()
 
const Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & module () const
 
- Protected Member Functions inherited from commrat::InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & module ()
 
const Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > & module () const
 
- Protected Member Functions inherited from commrat::CommandDispatcher< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, CommandTypes... >
void command_loop ()
 Command loop - receives and dispatches user commands.
 
void handle_user_command (const CmdT &cmd)
 Dispatch user command to on_command handler.
 
void on_command (const CmdT &cmd)
 Handle a specific command type (override in derived class)
 
- Protected Member Functions inherited from commrat::WorkLoopHandler< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
void work_loop ()
 Main work loop - handles subscription protocol messages.
 
- Protected Member Functions inherited from commrat::InputMetadataManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
void update_input_metadata (std::size_t index, const TimsMessage< T > &received, bool is_new)
 Update metadata for a specific input index.
 
void mark_input_invalid (std::size_t index)
 Mark input metadata as invalid (getData failed)
 

Static Protected Member Functions

template<typename T >
static TimsMessage< T > create_tims_message (T &&payload, uint64_t timestamp_ns)
 
- Static Protected Member Functions inherited from commrat::MailboxInfrastructureBuilder< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry >
static auto create_mailbox_infrastructure (const ModuleConfig &config)
 Create mailbox infrastructure.
 
static auto create_mailbox_sets_impl (const ModuleConfig &config, std::index_sequence< Is... >)
 Helper to create MailboxSet tuple for multi-output modules.
 
static auto create_mailbox_set (const ModuleConfig &config)
 Create a single MailboxSet for output type at index I.
 

Protected Attributes

ModuleConfig config_
 
MailboxSetTuple mailbox_infrastructure_
 
std::optional< DataMailbox > data_mailbox_
 
SubscriptionProtocolType subscription_protocol_
 
PublisherType publisher_
 
std::atomic< bool > running_
 
std::optional< std::thread > data_thread_
 
std::optional< std::thread > command_thread_
 
std::array< InputMetadataStorage,(num_inputs > 0 ? num_inputs :1)> input_metadata_
 
- Protected Attributes inherited from commrat::MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, OutputTypesTuple< NormalizeOutput< OutputSpec_ >::Type >::type >
std::vector< std::vector< SubscriberInfo > > output_subscribers_
 Per-output subscriber lists: output_subscribers_[output_index][subscriber_id].
 
Mutex output_subscribers_mutex_
 
std::vector< std::thread > output_work_threads_
 Per-output work threads: one thread per MailboxSet.
 

Static Protected Attributes

static constexpr std::size_t num_inputs = InputCount_v<InputSpec>
 Storage for input message metadata.
 

Friends

class LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 
class MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename OutputTypesTuple< typename NormalizeOutput< OutputSpec_ >::Type >::type >
 
class InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 
class CommandDispatcher< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, CommandTypes... >
 
class MultiInputInfrastructure< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >
 
class MultiInputProcessor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputData, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >
 
class LifecycleManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 
class WorkLoopHandler< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 
class MailboxInfrastructureBuilder< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry >
 
class InputMetadataManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
 

Detailed Description

template<typename UserRegistry, typename OutputSpec_, typename InputSpec_, typename... CommandTypes>
class commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >

Timestamp Management Architecture.

Timestamps are stored ONLY in TimsHeader.timestamp, never in payload. Module automatically wraps payloads in TimsMessage and sets header.timestamp:

  • PeriodicInput/LoopInput: timestamp = Time::now() (data generation time)
  • Multi-input: timestamp = primary_input.header.timestamp (sync point)
  • Input<T>: timestamp = input.header.timestamp (propagation)

Users never deal with timestamps - messages are clean data structures.

Modern C++20 module base using MessageRegistry

Users define their complete application message registry once, then Module automatically includes subscription protocol messages and uses the registry.

Template Parameters
UserRegistryThe application's complete MessageRegistry
OutputSpec_Output specification: Output<T>, Outputs<Ts...>, or raw type T (normalized to Output<T>)
InputSpec_Input specification: Input<T>, Inputs<T,U,V>, PeriodicInput, LoopInput
CommandTypesOptional variadic command types this module handles

Example:

class SensorModule : public Module<Registry, Output<TempData>, PeriodicInput> {
protected:
TempData process() override {
return TempData{.temperature_celsius = read_sensor()}
}
};
Timestamp Management Architecture.

Definition at line 91 of file registry_module.hpp.

Member Typedef Documentation

◆ InputData

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
using commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::InputData = typename ModuleTypes::InputData

Definition at line 204 of file registry_module.hpp.

◆ OutputData

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
using commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::OutputData = typename ModuleTypes::OutputData

Definition at line 203 of file registry_module.hpp.

◆ PublisherType

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
using commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::PublisherType = commrat::Publisher< UserRegistry, OutputData, PublishMailbox, Module<UserRegistry, OutputSpec_, InputSpec_, CommandTypes...> >
protected

Definition at line 280 of file registry_module.hpp.

◆ SubscriptionProtocolType

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
using commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::SubscriptionProtocolType = commrat::SubscriptionProtocol< UserRegistry, has_continuous_input, has_multi_input, InputData, InputTypesTuple, InputCount, OutputData, OutputTypesTuple >
protected

Definition at line 267 of file registry_module.hpp.

Constructor & Destructor Documentation

◆ Module() [1/3]

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::Module ( const ModuleConfig config)
inlineexplicit

◆ ~Module()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
virtual commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::~Module ( )
inlinevirtual

◆ Module() [2/3]

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::Module ( const Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes > &  )
delete

◆ Module() [3/3]

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::Module ( Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes > &&  )
delete

Member Function Documentation

◆ add_subscriber_to_output()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::add_subscriber_to_output ( uint32_t  subscriber_base_addr,
uint8_t  mailbox_index,
std::size_t  output_idx = 0 
)
inline

◆ cmd_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
CmdMailbox & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::cmd_mailbox ( )
inlineprotected

◆ create_tims_message()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename T >
static TimsMessage< T > commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::create_tims_message ( T &&  payload,
uint64_t  timestamp_ns 
)
inlinestaticprotected

◆ get_cmd_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_cmd_mailbox ( )
inlineprotected

◆ get_cmd_mailbox_public()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_cmd_mailbox_public ( )
inline

Get cmd mailbox by index (public for Publisher access) Phase 7: CMD mailbox used for publishing.

Definition at line 433 of file registry_module.hpp.

References commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::mailbox_infrastructure_.

◆ get_mailbox_set()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_mailbox_set ( )
inlineprotected

◆ get_publish_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_publish_mailbox ( )
inlineprotected

◆ get_publish_mailbox_public()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_publish_mailbox_public ( )
inline

Get publish mailbox by index (public for Publisher access)

Definition at line 424 of file registry_module.hpp.

References commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::mailbox_infrastructure_.

◆ get_work_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t Index>
auto & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::get_work_mailbox ( )
inlineprotected

◆ handle_subscribe_reply()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::handle_subscribe_reply ( const SubscribeReplyPayload reply)
inline

◆ handle_subscribe_request()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::handle_subscribe_request ( const SubscribeRequestPayload req,
std::size_t  output_idx = 0 
)
inline

◆ handle_unsubscribe_request()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::handle_unsubscribe_request ( const UnsubscribeRequestPayload req)
inline

◆ initialize_mailbox_infrastructure_impl()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<std::size_t... Is>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::initialize_mailbox_infrastructure_impl ( const ModuleConfig config,
std::index_sequence< Is... >   
)
inlineprotected

◆ on_cleanup()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
virtual void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::on_cleanup ( )
inlinevirtual

Definition at line 393 of file registry_module.hpp.

◆ on_init()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
virtual void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::on_init ( )
inlinevirtual

Definition at line 390 of file registry_module.hpp.

◆ on_start()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
virtual void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::on_start ( )
inlinevirtual

Definition at line 391 of file registry_module.hpp.

◆ on_stop()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
virtual void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::on_stop ( )
inlinevirtual

Definition at line 392 of file registry_module.hpp.

◆ operator=() [1/2]

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
Module & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::operator= ( const Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes > &  )
delete

◆ operator=() [2/2]

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
Module & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::operator= ( Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes > &&  )
delete

◆ process_dispatch()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename T = InputData, typename O = OutputData, typename = std::enable_if_t<!std::is_void_v<O> && !is_tuple_v<O>>>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::process_dispatch ( const T &  input,
O &  output 
)
inlineprotected

◆ publish_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
PublishMailbox & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::publish_mailbox ( )
inlineprotected

◆ publish_multi_outputs()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename... Ts>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::publish_multi_outputs ( std::tuple< Ts... > &  outputs)
inlineprotected

◆ publish_multi_outputs_with_timestamp()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename... Ts>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::publish_multi_outputs_with_timestamp ( std::tuple< Ts... > &  outputs,
uint64_t  timestamp_ns 
)
inlineprotected

◆ publish_tims_message()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename T >
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::publish_tims_message ( TimsMessage< T > &  tims_msg)
inlineprotected

◆ publish_to_subscribers()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
template<typename T = OutputData>
requires (!std::is_void_v<T>)
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::publish_to_subscribers ( T &  data)
inlineprotected

◆ remove_subscriber()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::remove_subscriber ( uint32_t  subscriber_base_addr)
inline

◆ subscribe_to_all_sources()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::subscribe_to_all_sources ( )
inlineprotected

◆ subscribe_to_source()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::subscribe_to_source ( uint8_t  source_system_id,
uint8_t  source_instance_id 
)
inlineprotected

◆ unsubscribe_from_multi_input_source()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::unsubscribe_from_multi_input_source ( const MultiInputConfig::InputSource source)
inlineprotected

◆ unsubscribe_from_source()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
void commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::unsubscribe_from_source ( uint8_t  source_system_id,
uint8_t  source_instance_id 
)
inlineprotected

◆ work_mailbox()

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
WorkMailbox & commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::work_mailbox ( )
inlineprotected

Friends And Related Symbol Documentation

◆ CommandDispatcher< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, CommandTypes... >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class CommandDispatcher< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, CommandTypes... >
friend

Definition at line 40 of file registry_module.hpp.

◆ InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class InputMetadataAccessors< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
friend

Definition at line 40 of file registry_module.hpp.

◆ InputMetadataManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class InputMetadataManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
friend

Definition at line 40 of file registry_module.hpp.

◆ LifecycleManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class LifecycleManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
friend

Definition at line 40 of file registry_module.hpp.

◆ LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class LoopExecutor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
friend

Definition at line 40 of file registry_module.hpp.

◆ MailboxInfrastructureBuilder< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class MailboxInfrastructureBuilder< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry >
friend

Definition at line 40 of file registry_module.hpp.

◆ MultiInputInfrastructure< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class MultiInputInfrastructure< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >
friend

Definition at line 40 of file registry_module.hpp.

◆ MultiInputProcessor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputData, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class MultiInputProcessor< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputTypesTuple, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputData, typename module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::OutputTypesTuple, module_traits::ModuleTypes< UserRegistry, OutputSpec_, InputSpec_ >::InputCount >
friend

Definition at line 40 of file registry_module.hpp.

◆ MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename OutputTypesTuple< typename NormalizeOutput< OutputSpec_ >::Type >::type >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class MultiOutputManager< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >, UserRegistry, typename OutputTypesTuple< typename NormalizeOutput< OutputSpec_ >::Type >::type >
friend

Definition at line 40 of file registry_module.hpp.

◆ WorkLoopHandler< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
friend class WorkLoopHandler< Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... > >
friend

Definition at line 40 of file registry_module.hpp.

Member Data Documentation

◆ command_thread_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
std::optional<std::thread> commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::command_thread_
protected

Definition at line 292 of file registry_module.hpp.

◆ config_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
ModuleConfig commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::config_
protected

◆ data_mailbox_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
std::optional<DataMailbox> commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::data_mailbox_
protected

Definition at line 260 of file registry_module.hpp.

◆ data_thread_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
std::optional<std::thread> commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::data_thread_
protected

Definition at line 291 of file registry_module.hpp.

◆ has_continuous_input

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
constexpr bool commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::has_continuous_input = ModuleTypes::has_continuous_input
staticconstexpr

Definition at line 207 of file registry_module.hpp.

◆ has_loop_input

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
constexpr bool commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::has_loop_input = ModuleTypes::has_loop_input
staticconstexpr

Definition at line 209 of file registry_module.hpp.

◆ has_multi_output

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
constexpr bool commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::has_multi_output = ModuleTypes::has_multi_output
staticconstexpr

Definition at line 210 of file registry_module.hpp.

◆ has_periodic_input

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
constexpr bool commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::has_periodic_input = ModuleTypes::has_periodic_input
staticconstexpr

Definition at line 208 of file registry_module.hpp.

◆ input_metadata_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
std::array<InputMetadataStorage, (num_inputs > 0 ? num_inputs : 1)> commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::input_metadata_
protected

Definition at line 318 of file registry_module.hpp.

◆ mailbox_infrastructure_

◆ num_inputs

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
constexpr std::size_t commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::num_inputs = InputCount_v<InputSpec>
staticconstexprprotected

Storage for input message metadata.

Stores metadata about received input messages, populated before process() calls. Available to derived classes via get_input_metadata<Index>() accessors.

Note: InputMetadataStorage defined in commrat/module/metadata/input_metadata.hpp

Definition at line 315 of file registry_module.hpp.

◆ publisher_

◆ running_

template<typename UserRegistry , typename OutputSpec_ , typename InputSpec_ , typename... CommandTypes>
std::atomic<bool> commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes >::running_
protected

Definition at line 288 of file registry_module.hpp.

◆ subscription_protocol_


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