![]() |
CommRaT 2.0.0
C++20 Real-Time Messaging Framework
|
CommRaT - Modern C++ Real-Time Communication Framework. More...
Namespaces | |
| namespace | literals |
| Timestamp comparison and arithmetic operators. | |
| namespace | Message |
| namespace | module_traits |
Classes | |
| struct | AckPayload |
| struct | AutoAssignIDs |
| Helper to assign auto-incremented IDs to messages marked with needs_auto_id. More... | |
| struct | AutoAssignIDs<> |
| struct | AutoAssignIDsProcess |
| struct | AutoAssignIDsProcess< std::tuple< ProcessedDefs... > > |
| struct | AutoAssignIDsProcess< std::tuple< ProcessedDefs... >, First, Rest... > |
| struct | CheckCollisions |
| class | CommandDispatcher |
| Command dispatcher mixin. More... | |
| struct | CommandPayload |
| class | CommRaT |
| CommRaT Application Template - Main User-Facing Interface. More... | |
| class | ConditionVariable |
| Condition variable wrapper. More... | |
| class | ContinuousProcessorBase |
| class | ContinuousProcessorBase< InputData_, void > |
| class | ContinuousProcessorBase< void, OutputData_ > |
| class | ContinuousProcessorBase< void, void > |
| struct | DefaultMessageDef |
| Default values for message definition. More... | |
| struct | EmptyBase2 |
| struct | EmptyBase3 |
| struct | EmptyPayload |
| Empty payload for messages that only need their ID. More... | |
| struct | ErrorPayload |
| struct | ExtractInputPayload |
| struct | ExtractInputPayload< Input< T > > |
| struct | ExtractInputTypes |
| struct | ExtractInputTypes< Input< T > > |
| struct | ExtractInputTypes< Inputs< Ts... > > |
| struct | ExtractOutputPayload |
| struct | ExtractOutputPayload< Output< T > > |
| struct | ExtractOutputPayload< Outputs< Ts... > > |
| class | HistoricalMailbox |
| Mailbox with timestamped history for getData synchronization. More... | |
| struct | Input |
| Single continuous input specification. More... | |
| struct | InputCount |
| Get the number of inputs in an InputSpec. More... | |
| struct | InputCount< Input< T > > |
| struct | InputCount< Inputs< Ts... > > |
| struct | InputMetadata |
| Input metadata structure returned by accessor methods. More... | |
| class | InputMetadataAccessors |
| Mixin providing input metadata accessor methods. More... | |
| class | InputMetadataManager |
| Phase 9: Input Metadata Manager CRTP Mixin. More... | |
| struct | InputMetadataStorage |
| Storage for input message metadata. More... | |
| struct | InputPayloadTypes |
| Extract payload types from Inputs<Ts...> as a tuple. More... | |
| struct | InputPayloadTypes< Input< T > > |
| struct | InputPayloadTypes< Inputs< Ts... > > |
| struct | Inputs |
| Multiple continuous inputs specification. More... | |
| struct | IntrospectionHelper |
| Registry-wide introspection and schema export. More... | |
| struct | is_commrat_message |
| struct | is_commrat_message< TimsMessage< P > > |
| struct | is_loop_input |
| struct | is_loop_input< LoopInput > |
| struct | is_multi_input |
| struct | is_multi_input< Inputs< Ts... > > |
| struct | is_multi_output |
| struct | is_multi_output< Outputs< Ts... > > |
| struct | is_no_output |
| struct | is_no_output< NoOutput > |
| struct | is_periodic_input |
| struct | is_periodic_input< PeriodicInput > |
| struct | is_primary_input |
| struct | is_primary_input< PrimaryInput< T > > |
| struct | is_single_input |
| struct | is_single_input< Input< T > > |
| struct | is_single_output |
| struct | is_single_output< Output< T > > |
| struct | is_tuple |
| struct | is_tuple< std::tuple< Ts... > > |
| class | LifecycleManager |
| Phase 6: Lifecycle Management CRTP Mixin. More... | |
| class | LoopExecutor |
| Loop execution logic for Module data threads. More... | |
| struct | LoopInput |
| Free-running loop - module runs as fast as possible, no input data. More... | |
| class | Mailbox |
| Strongly-typed mailbox for message-based communication. More... | |
| struct | MailboxConfig |
| class | MailboxInfrastructureBuilder |
| Phase 8: Mailbox Infrastructure Builder. More... | |
| class | MailboxResult |
| class | MailboxResult< void > |
| struct | MailboxSet |
| Complete set of mailboxes for one output type. More... | |
| struct | message_payload |
| struct | message_payload< TimsMessage< P > > |
| struct | message_type_for |
| struct | MessageDefinition |
| Message definition with compile-time ID assignment. More... | |
| class | MessageRegistry |
| Compile-time message type registry using MessageDefinition templates. More... | |
| struct | MessageSchema |
| Complete schema for a CommRaT message type. More... | |
| class | Module |
| Timestamp Management Architecture. More... | |
| struct | ModuleConfig |
| struct | MultiInputConfig |
| Multi-input - Multiple synchronized sources. More... | |
| class | MultiInputInfrastructure |
| Multi-input infrastructure mixin. More... | |
| class | MultiInputProcessor |
| Multi-input processing mixin. More... | |
| class | MultiInputProcessorBase |
| class | MultiInputProcessorBase< InputTypesTuple_, OutputData_, 0 > |
| class | MultiInputProcessorBase< InputTypesTuple_, OutputData_, 1 > |
| class | MultiInputProcessorBase< std::tuple< InputTs... >, std::tuple< OutputTs... >, sizeof...(InputTs)> |
| class | MultiInputProcessorBase< std::tuple< Ts... >, OutputData_, sizeof...(Ts)> |
| struct | MultiOutputConfig |
| Multi-output - Each output gets its own addressing Use when multiple outputs have same type (would collide with SimpleOutput) More... | |
| class | MultiOutputManager |
| CRTP mixin for multi-output mailbox and subscriber management. More... | |
| class | MultiOutputProcessorBase |
| class | MultiOutputProcessorBase< std::tuple< T >, InputData_ > |
| class | MultiOutputProcessorBase< std::tuple< T >, void > |
| class | MultiOutputProcessorBase< std::tuple< Ts... >, InputData_ > |
| class | MultiOutputProcessorBase< std::tuple< Ts... >, void > |
| class | Mutex |
| Mutex wrapper (future: realtime mutex support) More... | |
| struct | NoInputConfig |
| No input - Periodic or LoopInput modules only. More... | |
| struct | NoOutput |
| No output specification (sink module) More... | |
| struct | NoOutputConfig |
| No output - Module only consumes inputs (logger, monitor, controller) Still needs addressing for CMD/WORK mailboxes. More... | |
| struct | NormalizeInput |
| Pass-through for input specifications (no normalization needed) More... | |
| struct | NormalizeOutput |
| Maps raw output types to Output<T> format. More... | |
| struct | Output |
| Single output specification. More... | |
| struct | OutputCount |
| Get the number of outputs in an OutputSpec. More... | |
| struct | OutputCount< NoOutput > |
| struct | OutputCount< Output< T > > |
| struct | OutputCount< Outputs< Ts... > > |
| struct | OutputPayloadTypes |
| Extract payload types from Outputs<Ts...> as a tuple. More... | |
| struct | OutputPayloadTypes< Output< T > > |
| struct | OutputPayloadTypes< Outputs< Ts... > > |
| struct | Outputs |
| Multiple outputs specification. More... | |
| struct | OutputTypesTuple |
| struct | OutputTypesTuple< Output< T > > |
| struct | OutputTypesTuple< Outputs< Ts... > > |
| struct | PeriodicInput |
| Periodic execution - module runs on a timer, no input data. More... | |
| struct | PrimaryInput |
| Primary input designation for multi-input synchronization (Phase 6) More... | |
| struct | PrimaryInputIndex |
| Extract the index of the primary input type within Inputs<Ts...> More... | |
| struct | PrimaryInputIndex< PrimaryT, std::tuple< First, Rest... > > |
| struct | PrimaryInputIndex< PrimaryT, std::tuple< PrimaryT, Rest... > > |
| struct | PrimaryInputIndex< PrimaryT, std::tuple<> > |
| class | Publisher |
| Publishing logic for producer modules. More... | |
| struct | RawReceivedMessage |
| Raw received message with type info. More... | |
| struct | ReceiveTypes |
| Tag type to mark send-only types in template parameter. More... | |
| class | Registry |
| Build a complete registry with automatic Module and Mailbox aliases. More... | |
| class | RegistryMailbox |
| Mailbox that takes a MessageRegistry and exposes payload-only interface. More... | |
| struct | Reply |
| Define a reply message paired with a request. More... | |
| struct | Request |
| Mark a message as a request that expects a reply. More... | |
| struct | ResolveMultiInputBase |
| struct | ResolveMultiInputBase< InputSpec_, Outputs< OutputTypes... > > |
| struct | RobotStatePayload |
| struct | SendOnlyTypes |
| struct | SensorPayload |
| class | SharedMutex |
| Shared mutex wrapper (reader-writer lock) More... | |
| struct | SimpleOutputConfig |
| Simple output - All outputs share same system_id/instance_id Use when output types are distinct (no collisions) More... | |
| struct | SingleInputConfig |
| Single input - One source module. More... | |
| struct | SingleInputType |
| Get the single payload type from Input<T> More... | |
| struct | SingleInputType< Input< T > > |
| class | SingleOutputProcessorBase |
| class | SingleOutputProcessorBase< InputData_, void > |
| class | SingleOutputProcessorBase< void, OutputData_ > |
| class | SingleOutputProcessorBase< void, void > |
| struct | SingleOutputType |
| Get the single payload type from Output<T> or legacy OutputDataT. More... | |
| struct | SingleOutputType< Output< T > > |
| struct | StatusPayload |
| struct | SubscribeReplyPayload |
| Reply to subscription request. More... | |
| struct | SubscribeRequestPayload |
| Request to subscribe to continuous data from a producer module. More... | |
| struct | SubscriberInfo |
| Subscriber routing information. More... | |
| class | SubscriptionProtocol |
| Subscription protocol handler. More... | |
| struct | SubscriptionState |
| Subscription state tracker for multi-input modules. More... | |
| class | Thread |
| Thread wrapper with realtime support. More... | |
| struct | ThreadConfig |
| Thread configuration. More... | |
| class | Time |
| Time utility class - abstraction over clock sources. More... | |
| struct | TimestampAccessor |
| Trait to access timestamp from different message types. More... | |
| struct | TimestampAccessor< TimsMessage< PayloadT > > |
| class | TimestampedRingBuffer |
| Thread-safe timestamped ring buffer with getData lookup. More... | |
| struct | TimsConfig |
| struct | TimsHeader |
| struct | TimsMessage |
| class | TimsWrapper |
| class | TypedMailbox |
| Type-restricted mailbox with optimized buffer sizing. More... | |
| class | TypedMailbox< Registry, ReceiveTypes< ReceiveTypesInner... >, SendOnlyTypes< SendOnlyTypesInner... > > |
| TypedMailbox with separate send-only types. More... | |
| class | TypedMailbox< Registry, SendOnlyTypes< SendOnlyTypesInner... > > |
| TypedMailbox with only send types (no receive) More... | |
| struct | UnsubscribeReplyPayload |
| Acknowledgment of unsubscribe request. More... | |
| struct | UnsubscribeRequestPayload |
| Request to unsubscribe from continuous data. More... | |
| struct | ValidatePrimaryInput |
| Validate that PrimaryInput<T> is compatible with Inputs<Ts...> More... | |
| class | WorkLoopHandler |
| Phase 7: Work Loop Handler CRTP Mixin. More... | |
Concepts | |
| concept | ValidOutputSpec |
| concept | ValidInputSpec |
| concept | PeriodicOrLoop |
| concept | HasContinuousInput |
Typedefs | |
| using | StandardMailbox = Mailbox< CommandMessage, StatusMessage, ErrorMessage, AckMessage, SensorMessage, RobotStateMessage > |
| Standard mailbox with common message types. | |
| template<typename... CustomTypes> | |
| using | CustomMailbox = Mailbox< CommandMessage, StatusMessage, ErrorMessage, AckMessage, CustomTypes... > |
| Create a custom mailbox with standard types plus user types. | |
| template<typename Registry , typename PayloadT > | |
| using | SingleTypeMailbox = TypedMailbox< Registry, PayloadT > |
| Create a typed mailbox for a single payload type. | |
| template<typename Registry , typename... CommandTypes> | |
| using | CommandMailbox = TypedMailbox< Registry, CommandTypes... > |
| Create a typed mailbox for command types. | |
| template<typename Registry , typename... DataTypes> | |
| using | DataMailbox = TypedMailbox< Registry, DataTypes... > |
| Create a typed mailbox for data types. | |
| using | MessageType = uint32_t |
| using | CommandMessage = TimsMessage< CommandPayload > |
| using | StatusMessage = TimsMessage< StatusPayload > |
| using | ErrorMessage = TimsMessage< ErrorPayload > |
| using | AckMessage = TimsMessage< AckPayload > |
| using | SensorMessage = TimsMessage< SensorPayload > |
| using | RobotStateMessage = TimsMessage< RobotStatePayload > |
| template<typename T > | |
| using | DataMessage = TimsMessage< T > |
| template<typename T > | |
| using | message_payload_t = typename message_payload< T >::type |
| template<typename... MessageDefs> | |
| using | make_registry = MessageRegistry< MessageDefs... > |
| Create a message registry from a list of MessageDefinition types. | |
| template<typename... MessageDefs> | |
| using | CustomRegistry = MessageRegistry< MessageDefs... > |
| Type alias for creating custom registries. | |
| using | SubscribeRequest = MessageDefinition< SubscribeRequestPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0001 > |
| using | SubscribeReply = MessageDefinition< SubscribeReplyPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0002 > |
| using | UnsubscribeRequest = MessageDefinition< UnsubscribeRequestPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0003 > |
| using | UnsubscribeReply = MessageDefinition< UnsubscribeReplyPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0004 > |
| using | SubscribeRequestType = typename SubscribeRequest::Payload |
| using | SubscribeReplyType = typename SubscribeReply::Payload |
| using | UnsubscribeRequestType = typename UnsubscribeRequest::Payload |
| using | UnsubscribeReplyType = typename UnsubscribeReply::Payload |
| using | SystemRegistry = MessageRegistry< SubscribeRequest, SubscribeReply, UnsubscribeRequest, UnsubscribeReply > |
| Framework system messages that are always included. | |
| template<typename... UserMessageDefs> | |
| using | CombinedRegistry = MessageRegistry< SubscribeRequest, SubscribeReply, UnsubscribeRequest, UnsubscribeReply, UserMessageDefs... > |
| Combine system messages with user messages into one registry. | |
| template<typename T > | |
| using | NormalizeInput_t = typename NormalizeInput< T >::Type |
| template<typename T > | |
| using | NormalizeOutput_t = typename NormalizeOutput< T >::Type |
| template<typename InputSpec > | |
| using | InputPayloadTypes_t = typename InputPayloadTypes< InputSpec >::Type |
| template<typename OutputSpec > | |
| using | OutputPayloadTypes_t = typename OutputPayloadTypes< OutputSpec >::Type |
| template<typename OutputSpec > | |
| using | SingleOutputType_t = typename SingleOutputType< OutputSpec >::Type |
| template<typename InputSpec > | |
| using | SingleInputType_t = typename SingleInputType< InputSpec >::Type |
| using | OutputConfig = rfl::TaggedUnion<"output_type", NoOutputConfig, SimpleOutputConfig, MultiOutputConfig > |
| using | InputConfig = rfl::TaggedUnion<"input_type", NoInputConfig, SingleInputConfig, MultiInputConfig > |
| using | Lock = std::lock_guard< Mutex > |
| Scoped lock guard (RAII) | |
| using | UniqueLock = std::unique_lock< Mutex > |
| using | SharedLock = std::shared_lock< SharedMutex > |
| Scoped shared lock (RAII) - for readers. | |
| using | UniqueLockShared = std::unique_lock< SharedMutex > |
| Scoped unique lock (RAII) - for writers. | |
| using | Timestamp = uint64_t |
| Timestamp type - uint64_t nanoseconds since epoch. | |
| using | Nanoseconds = std::chrono::nanoseconds |
| Duration type aliases (compatible with std::chrono but using uint64_t) | |
| using | Microseconds = std::chrono::microseconds |
| using | Milliseconds = std::chrono::milliseconds |
| using | Seconds = std::chrono::seconds |
| using | Minutes = std::chrono::minutes |
| using | Hours = std::chrono::hours |
Enumerations | |
| enum class | MailboxError { NotInitialized , InvalidMessage , Timeout , QueueFull , QueueEmpty , SerializationError , NetworkError , InvalidDestination , AlreadyRunning , NotRunning } |
| enum class | InterpolationMode { NEAREST , BEFORE , AFTER , INTERPOLATE } |
| Interpolation mode for timestamp-based lookup. More... | |
| enum class | MessagePrefix : uint8_t { System = 0x00 , UserDefined = 0x01 } |
| Message ID prefixes. More... | |
| enum class | SystemSubPrefix : uint8_t { Subscription = 0x00 , Control = 0x01 , Reserved = 0xFF } |
| System message sub-categories (when Prefix == System) More... | |
| enum class | UserSubPrefix : uint8_t { Data = 0x00 , Commands = 0x01 , Events = 0x02 , Custom = 0x03 } |
| User-defined message sub-categories (when Prefix == UserDefined) More... | |
| enum class | MailboxType : uint8_t { CMD = 0 , WORK = 16 , PUBLISH = 32 , DATA = 48 } |
| enum class | ThreadPriority { IDLE = 0 , LOW = 10 , NORMAL = 50 , HIGH = 75 , REALTIME = 99 } |
| Thread priority levels. More... | |
| enum class | SchedulingPolicy { NORMAL , FIFO , ROUND_ROBIN , DEADLINE } |
| Thread scheduling policy. More... | |
| enum class | TimsResult { SUCCESS = 0 , ERROR_INIT = -1 , ERROR_SEND = -2 , ERROR_RECEIVE = -3 , ERROR_TIMEOUT = -4 , ERROR_INVALID_MESSAGE = -5 , ERROR_NOT_INITIALIZED = -6 } |
Functions | |
| constexpr const char * | to_string (MailboxError error) |
| template<typename Registry > | |
| auto | make_mailbox (const MailboxConfig &config) |
| template<typename T > | |
| constexpr MessageType | type_hash () |
| template<typename T > | |
| auto | serialize (T &message) -> typename sertial::Message< T >::Result |
| template<typename T > | |
| auto | deserialize (std::span< const std::byte > data) -> sertial::DeserializeResult< T > |
| template<typename T > | |
| auto | deserialize (const uint8_t *data, size_t size) -> sertial::DeserializeResult< T > |
| template<typename T > | |
| auto | serialize_message (T &message) -> typename sertial::Message< T >::Result |
| template<typename T > | |
| auto | deserialize_message (std::span< const std::byte > data) -> sertial::DeserializeResult< T > |
| template<typename T > | |
| auto | deserialize_message (const uint8_t *data, size_t size) -> sertial::DeserializeResult< T > |
| constexpr uint32_t | make_message_id (uint8_t prefix, uint8_t subprefix, uint16_t id) |
| Compile-time message ID construction. | |
| constexpr uint32_t | system_message_id (SystemSubPrefix subprefix, uint16_t id) |
| System message ID helper. | |
| constexpr uint32_t | user_message_id (UserSubPrefix subprefix, uint16_t id) |
| User message ID helper. | |
| constexpr uint32_t | encode_address (uint8_t type_id, uint8_t system_id, uint8_t instance_id, uint8_t mailbox_index) |
| Encode full mailbox address Format: [type_id:8][system_id:8][instance_id:8][mailbox_index:8] Example: 0xTTSSIIMM (easy hex debugging) | |
| constexpr uint32_t | get_base_address (uint8_t type_id, uint8_t system_id, uint8_t instance_id) |
| Get base address (type/system/instance only, mailbox_index=0) | |
| constexpr uint8_t | extract_mailbox_index (uint32_t addr) |
| Extract mailbox index from full address. | |
| constexpr uint8_t | extract_type_id (uint32_t addr) |
| Extract type ID from address. | |
| constexpr uint8_t | extract_system_id (uint32_t addr) |
| Extract system ID from address. | |
| constexpr uint8_t | extract_instance_id (uint32_t addr) |
| Extract instance ID from address. | |
| constexpr uint8_t | get_data_mbx_base (uint8_t num_outputs) |
| Get DATA mailbox base index (after all CMD mailboxes) | |
| constexpr uint8_t | extract_message_type_from_address (uint32_t base_addr) |
| Extract message type ID from subscriber base address (for backward compatibility) Now just extracts type_id field from new encoding. | |
| template<typename OutputData , typename OutputTypesTuple , typename UserRegistry > | |
| static constexpr uint32_t | calculate_base_address (uint8_t system_id, uint8_t instance_id) |
| Calculate base mailbox address from output type, system_id, and instance_id New format: [type_id:8][system_id:8][instance_id:8][mailbox_index:8] Returns base address with mailbox_index=0. | |
| template<typename OutputData , typename OutputTypesTuple , typename UserRegistry > | |
| static constexpr uint32_t | get_mailbox_address (uint8_t system_id, uint8_t instance_id, uint8_t mailbox_index) |
| Get specific mailbox address with index. | |
| template<typename... CommandTypes> | |
| static constexpr size_t | calculate_cmd_mailbox_size () |
| Calculate CMD mailbox size at compile time Size = max(SystemRegistry messages, Module's Commands<...>) | |
| template<typename InputType > | |
| static constexpr size_t | get_data_mailbox_size () |
| Calculate DATA mailbox size for specific input type. | |
| static MailboxConfig | createWorkMailboxConfig (const ModuleConfig &config) |
| Create work mailbox config (for SystemRegistry messages) | |
| template<typename T > | |
| TimsMessage< T > | create_tims_message (T &&payload, uint64_t timestamp_ns) |
| Create TimsMessage with header.timestamp set. | |
| template<typename T , typename... Types> | |
| static constexpr std::size_t | find_type_index () |
| Find index of type T in input tuple. | |
| void | signal_handler (int signal) |
| Signal handler for graceful shutdown. | |
| template<typename ModuleType , typename Registry > | |
| int | module_main (const ModuleConfig &config) |
| Main entry point for standalone module binaries. | |
| template<typename ModuleType , typename Registry > | |
| int | module_main (int argc, char **argv) |
| Main entry point with argc/argv handling. | |
Variables | |
| template<typename T > | |
| constexpr bool | is_commrat_message_v = is_commrat_message<T>::value |
| template<typename T > | |
| constexpr size_t | max_message_buffer_size_v = sertial::Message<T>::max_buffer_size |
| template<typename T > | |
| constexpr size_t | packed_message_size_v = sertial::Message<T>::packed_size |
| template<typename T > | |
| constexpr bool | message_has_padding_v = sertial::Message<T>::has_padding |
| constexpr uint16_t | AUTO_ID = 0xFFFF |
| constexpr uint8_t | TYPE_ID_SHIFT = 24 |
| constexpr uint8_t | SYSTEM_ID_SHIFT = 16 |
| constexpr uint8_t | INSTANCE_ID_SHIFT = 8 |
| constexpr uint8_t | MAILBOX_INDEX_SHIFT = 0 |
| constexpr uint32_t | TYPE_ID_MASK = 0xFF000000 |
| constexpr uint32_t | SYSTEM_ID_MASK = 0x00FF0000 |
| constexpr uint32_t | INSTANCE_ID_MASK = 0x0000FF00 |
| constexpr uint32_t | MAILBOX_INDEX_MASK = 0x000000FF |
| constexpr uint8_t | CMD_MBX_BASE = 0 |
| template<typename T > | |
| constexpr bool | is_single_output_v = is_single_output<T>::value |
| template<typename T > | |
| constexpr bool | is_multi_output_v = is_multi_output<T>::value |
| template<typename T > | |
| constexpr bool | is_no_output_v = is_no_output<T>::value |
| template<typename T > | |
| constexpr bool | is_periodic_input_v = is_periodic_input<T>::value |
| template<typename T > | |
| constexpr bool | is_loop_input_v = is_loop_input<T>::value |
| template<typename T > | |
| constexpr bool | is_single_input_v = is_single_input<T>::value |
| template<typename T > | |
| constexpr bool | is_multi_input_v = is_multi_input<T>::value |
| template<typename T > | |
| constexpr bool | is_primary_input_v = is_primary_input<T>::value |
| template<typename T > | |
| constexpr size_t | OutputCount_v = OutputCount<T>::value |
| template<typename T > | |
| constexpr size_t | InputCount_v = InputCount<T>::value |
| template<typename PrimaryT , typename InputsTuple > | |
| constexpr size_t | PrimaryInputIndex_v = PrimaryInputIndex<PrimaryT, InputsTuple>::value |
| template<typename PrimaryInputSpec , typename InputSpec > | |
| constexpr bool | ValidatePrimaryInput_v |
| constexpr uint32_t | DEFAULT_CMD_SLOTS = 10 |
| constexpr uint32_t | DEFAULT_DATA_SLOTS = 50 |
| std::atomic< bool > | g_shutdown_requested {false} |
| template<typename T > | |
| constexpr bool | is_tuple_v = is_tuple<T>::value |
CommRaT - Modern C++ Real-Time Communication Framework.
CommRaT introspection provides complete schema export.
Integrates RACK's TiMS IPC with SeRTial's reflective serialization to provide compile-time safe, zero-syscall, RT-capable messaging.
Key Features:
Exports both:
Supports any rfl format: JSON, YAML, TOML, XML, etc.
| using commrat::AckMessage = typedef TimsMessage<AckPayload> |
Definition at line 132 of file messages.hpp.
| using commrat::CombinedRegistry = typedef MessageRegistry< SubscribeRequest, SubscribeReply, UnsubscribeRequest, UnsubscribeReply, UserMessageDefs... > |
Combine system messages with user messages into one registry.
Definition at line 86 of file system_registry.hpp.
| using commrat::CommandMailbox = typedef TypedMailbox<Registry, CommandTypes...> |
Create a typed mailbox for command types.
Useful naming convention for CMD mailboxes in modules.
Example:
Definition at line 661 of file typed_mailbox.hpp.
| using commrat::CommandMessage = typedef TimsMessage<CommandPayload> |
Definition at line 129 of file messages.hpp.
| using commrat::CustomMailbox = typedef Mailbox< CommandMessage, StatusMessage, ErrorMessage, AckMessage, CustomTypes... > |
Create a custom mailbox with standard types plus user types.
Definition at line 629 of file mailbox.hpp.
| using commrat::CustomRegistry = typedef MessageRegistry<MessageDefs...> |
Type alias for creating custom registries.
Definition at line 591 of file message_registry.hpp.
| using commrat::DataMailbox = typedef TypedMailbox<Registry, DataTypes...> |
Create a typed mailbox for data types.
Useful naming convention for DATA mailboxes in modules.
Example:
Definition at line 674 of file typed_mailbox.hpp.
| using commrat::DataMessage = typedef TimsMessage<T> |
Definition at line 138 of file messages.hpp.
| using commrat::ErrorMessage = typedef TimsMessage<ErrorPayload> |
Definition at line 131 of file messages.hpp.
| using commrat::Hours = typedef std::chrono::hours |
Definition at line 42 of file timestamp.hpp.
| using commrat::InputConfig = typedef rfl::TaggedUnion<"input_type", NoInputConfig, SingleInputConfig, MultiInputConfig> |
Definition at line 101 of file module_config.hpp.
| using commrat::InputPayloadTypes_t = typedef typename InputPayloadTypes<InputSpec>::Type |
Definition at line 450 of file io_spec.hpp.
| using commrat::Lock = typedef std::lock_guard<Mutex> |
Scoped lock guard (RAII)
Usage: Mutex mtx; { Lock lock(mtx); // Acquires lock // ... critical section ... } // Releases lock automatically
Definition at line 302 of file threading.hpp.
| using commrat::make_registry = typedef MessageRegistry<MessageDefs...> |
Create a message registry from a list of MessageDefinition types.
Usage: using MyRegistry = make_registry< MessageDefinition<StatusData, MessagePrefix::UserDefined, UserSubPrefix::Data>, MessageDefinition<SubscribeRequest, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0001> >;
Definition at line 585 of file message_registry.hpp.
| using commrat::message_payload_t = typedef typename message_payload<T>::type |
Definition at line 163 of file messages.hpp.
| using commrat::MessageType = typedef uint32_t |
Definition at line 25 of file messages.hpp.
| using commrat::Microseconds = typedef std::chrono::microseconds |
Definition at line 38 of file timestamp.hpp.
| using commrat::Milliseconds = typedef std::chrono::milliseconds |
Definition at line 39 of file timestamp.hpp.
| using commrat::Minutes = typedef std::chrono::minutes |
Definition at line 41 of file timestamp.hpp.
| using commrat::Nanoseconds = typedef std::chrono::nanoseconds |
Duration type aliases (compatible with std::chrono but using uint64_t)
These provide drop-in replacements for std::chrono::duration types while maintaining compatibility with future realtime clock sources.
Definition at line 37 of file timestamp.hpp.
| using commrat::NormalizeInput_t = typedef typename NormalizeInput<T>::Type |
Definition at line 406 of file io_spec.hpp.
| using commrat::NormalizeOutput_t = typedef typename NormalizeOutput<T>::Type |
Definition at line 425 of file io_spec.hpp.
| using commrat::OutputConfig = typedef rfl::TaggedUnion<"output_type", NoOutputConfig, SimpleOutputConfig, MultiOutputConfig> |
Definition at line 73 of file module_config.hpp.
| using commrat::OutputPayloadTypes_t = typedef typename OutputPayloadTypes<OutputSpec>::Type |
Definition at line 471 of file io_spec.hpp.
| using commrat::RobotStateMessage = typedef TimsMessage<RobotStatePayload> |
Definition at line 134 of file messages.hpp.
| using commrat::Seconds = typedef std::chrono::seconds |
Definition at line 40 of file timestamp.hpp.
| using commrat::SensorMessage = typedef TimsMessage<SensorPayload> |
Definition at line 133 of file messages.hpp.
| using commrat::SharedLock = typedef std::shared_lock<SharedMutex> |
Scoped shared lock (RAII) - for readers.
Definition at line 308 of file threading.hpp.
| using commrat::SingleInputType_t = typedef typename SingleInputType<InputSpec>::Type |
Definition at line 503 of file io_spec.hpp.
| using commrat::SingleOutputType_t = typedef typename SingleOutputType<OutputSpec>::Type |
Definition at line 487 of file io_spec.hpp.
| using commrat::SingleTypeMailbox = typedef TypedMailbox<Registry, PayloadT> |
Create a typed mailbox for a single payload type.
Example:
Definition at line 648 of file typed_mailbox.hpp.
| using commrat::StandardMailbox = typedef Mailbox< CommandMessage, StatusMessage, ErrorMessage, AckMessage, SensorMessage, RobotStateMessage > |
Standard mailbox with common message types.
Definition at line 616 of file mailbox.hpp.
| using commrat::StatusMessage = typedef TimsMessage<StatusPayload> |
Definition at line 130 of file messages.hpp.
| using commrat::SubscribeReply = typedef MessageDefinition< SubscribeReplyPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0002 > |
Definition at line 62 of file subscription_messages.hpp.
| using commrat::SubscribeReplyType = typedef typename SubscribeReply::Payload |
Definition at line 86 of file subscription_messages.hpp.
| using commrat::SubscribeRequest = typedef MessageDefinition< SubscribeRequestPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0001 > |
Definition at line 55 of file subscription_messages.hpp.
| using commrat::SubscribeRequestType = typedef typename SubscribeRequest::Payload |
Definition at line 85 of file subscription_messages.hpp.
| using commrat::SystemRegistry = typedef MessageRegistry< SubscribeRequest, SubscribeReply, UnsubscribeRequest, UnsubscribeReply > |
Framework system messages that are always included.
These messages are used by the framework for subscription protocol and other internal communication. Users don't need to manually include these.
Definition at line 28 of file system_registry.hpp.
| using commrat::Timestamp = typedef uint64_t |
Timestamp type - uint64_t nanoseconds since epoch.
Compatible with TiMS timestamp format. Range: ~584 years from epoch (sufficient for all practical purposes)
Definition at line 29 of file timestamp.hpp.
| using commrat::UniqueLock = typedef std::unique_lock<Mutex> |
Definition at line 303 of file threading.hpp.
| using commrat::UniqueLockShared = typedef std::unique_lock<SharedMutex> |
Scoped unique lock (RAII) - for writers.
Definition at line 313 of file threading.hpp.
| using commrat::UnsubscribeReply = typedef MessageDefinition< UnsubscribeReplyPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0004 > |
Definition at line 77 of file subscription_messages.hpp.
| using commrat::UnsubscribeReplyType = typedef typename UnsubscribeReply::Payload |
Definition at line 88 of file subscription_messages.hpp.
| using commrat::UnsubscribeRequest = typedef MessageDefinition< UnsubscribeRequestPayload, MessagePrefix::System, SystemSubPrefix::Subscription, 0x0003 > |
Definition at line 70 of file subscription_messages.hpp.
| using commrat::UnsubscribeRequestType = typedef typename UnsubscribeRequest::Payload |
Definition at line 87 of file subscription_messages.hpp.
|
strong |
Interpolation mode for timestamp-based lookup.
Definition at line 52 of file timestamped_ring_buffer.hpp.
|
strong |
| Enumerator | |
|---|---|
| NotInitialized | |
| InvalidMessage | |
| Timeout | |
| QueueFull | |
| QueueEmpty | |
| SerializationError | |
| NetworkError | |
| InvalidDestination | |
| AlreadyRunning | |
| NotRunning | |
Definition at line 22 of file mailbox.hpp.
|
strong |
| Enumerator | |
|---|---|
| CMD | |
| WORK | |
| PUBLISH | |
| DATA | |
Definition at line 38 of file module_config.hpp.
|
strong |
Message ID prefixes.
| Enumerator | |
|---|---|
| System | Framework control messages (subscription, etc.) |
| UserDefined | User application messages (start from 0x01) |
Definition at line 16 of file message_id.hpp.
|
strong |
Thread scheduling policy.
| Enumerator | |
|---|---|
| NORMAL | Default OS scheduling (SCHED_OTHER) |
| FIFO | First-in-first-out realtime (SCHED_FIFO) |
| ROUND_ROBIN | Round-robin realtime (SCHED_RR) |
| DEADLINE | Deadline scheduling (SCHED_DEADLINE) - future. |
Definition at line 45 of file threading.hpp.
|
strong |
System message sub-categories (when Prefix == System)
| Enumerator | |
|---|---|
| Subscription | Subscription protocol messages. |
| Control | Module control (on/off/reset/etc.) |
| Reserved | Reserved for future use. |
Definition at line 22 of file message_id.hpp.
|
strong |
Thread priority levels.
| Enumerator | |
|---|---|
| IDLE | Idle priority (background tasks) |
| LOW | Low priority. |
| NORMAL | Normal priority (default) |
| HIGH | High priority (I/O, event handling) |
| REALTIME | Realtime priority (critical paths) |
Definition at line 34 of file threading.hpp.
|
strong |
| Enumerator | |
|---|---|
| SUCCESS | |
| ERROR_INIT | |
| ERROR_SEND | |
| ERROR_RECEIVE | |
| ERROR_TIMEOUT | |
| ERROR_INVALID_MESSAGE | |
| ERROR_NOT_INITIALIZED | |
Definition at line 36 of file tims_wrapper.hpp.
|
strong |
User-defined message sub-categories (when Prefix == UserDefined)
| Enumerator | |
|---|---|
| Data | Data messages (sensor data, state, etc.) |
| Commands | Command messages. |
| Events | Event notifications. |
| Custom | User can start custom categories from here. |
Definition at line 29 of file message_id.hpp.
|
staticconstexpr |
Calculate base mailbox address from output type, system_id, and instance_id New format: [type_id:8][system_id:8][instance_id:8][mailbox_index:8] Returns base address with mailbox_index=0.
Definition at line 107 of file address_helpers.hpp.
References get_base_address().
|
staticconstexpr |
Calculate CMD mailbox size at compile time Size = max(SystemRegistry messages, Module's Commands<...>)
Definition at line 139 of file address_helpers.hpp.
| TimsMessage< T > commrat::create_tims_message | ( | T && | payload, |
| uint64_t | timestamp_ns | ||
| ) |
Create TimsMessage with header.timestamp set.
Phase 6.10: Timestamps stored ONLY in TimsHeader, not in payload. This helper wraps a payload in TimsMessage with the given timestamp.
Definition at line 21 of file tims_helpers.hpp.
References commrat::TimsMessage< PayloadT >::header, and commrat::TimsHeader::msg_type.
|
inlinestatic |
Create work mailbox config (for SystemRegistry messages)
Definition at line 165 of file address_helpers.hpp.
References commrat::MailboxConfig::mailbox_id, commrat::MessageRegistry< MessageDefs >::max_message_size, commrat::ModuleConfig::message_slots, commrat::ModuleConfig::name, commrat::ModuleConfig::priority, and commrat::ModuleConfig::realtime.
| auto commrat::deserialize | ( | const uint8_t * | data, |
| size_t | size | ||
| ) | -> sertial::DeserializeResult<T> |
Definition at line 201 of file messages.hpp.
| auto commrat::deserialize | ( | std::span< const std::byte > | data | ) | -> sertial::DeserializeResult<T> |
Definition at line 192 of file messages.hpp.
Referenced by commrat::Mailbox< MessageDefs >::receive(), and commrat::Mailbox< MessageDefs >::receive_for().
| auto commrat::deserialize_message | ( | const uint8_t * | data, |
| size_t | size | ||
| ) | -> sertial::DeserializeResult<T> |
Definition at line 219 of file messages.hpp.
| auto commrat::deserialize_message | ( | std::span< const std::byte > | data | ) | -> sertial::DeserializeResult<T> |
Definition at line 214 of file messages.hpp.
|
constexpr |
Encode full mailbox address Format: [type_id:8][system_id:8][instance_id:8][mailbox_index:8] Example: 0xTTSSIIMM (easy hex debugging)
Definition at line 39 of file address_helpers.hpp.
References INSTANCE_ID_SHIFT, MAILBOX_INDEX_SHIFT, SYSTEM_ID_SHIFT, and TYPE_ID_SHIFT.
Referenced by get_base_address().
|
constexpr |
Extract instance ID from address.
Definition at line 78 of file address_helpers.hpp.
References INSTANCE_ID_MASK, and INSTANCE_ID_SHIFT.
|
constexpr |
Extract mailbox index from full address.
Definition at line 57 of file address_helpers.hpp.
References MAILBOX_INDEX_MASK, and MAILBOX_INDEX_SHIFT.
|
inlineconstexpr |
Extract message type ID from subscriber base address (for backward compatibility) Now just extracts type_id field from new encoding.
Definition at line 93 of file address_helpers.hpp.
References extract_type_id().
|
constexpr |
Extract system ID from address.
Definition at line 71 of file address_helpers.hpp.
References SYSTEM_ID_MASK, and SYSTEM_ID_SHIFT.
|
constexpr |
Extract type ID from address.
Definition at line 64 of file address_helpers.hpp.
References TYPE_ID_MASK, and TYPE_ID_SHIFT.
Referenced by extract_message_type_from_address().
|
staticconstexpr |
Find index of type T in input tuple.
Compile-time helper to locate type in parameter pack. Static asserts if type not found or appears multiple times.
Definition at line 54 of file input_metadata.hpp.
Referenced by commrat::InputMetadataAccessors< ModuleType >::get_input_metadata(), commrat::InputMetadataAccessors< ModuleType >::get_input_timestamp(), commrat::InputMetadataAccessors< ModuleType >::has_new_data(), and commrat::InputMetadataAccessors< ModuleType >::is_input_valid().
|
constexpr |
Get base address (type/system/instance only, mailbox_index=0)
Definition at line 50 of file address_helpers.hpp.
References encode_address().
Referenced by calculate_base_address().
|
staticconstexpr |
Calculate DATA mailbox size for specific input type.
Definition at line 153 of file address_helpers.hpp.
|
constexpr |
Get DATA mailbox base index (after all CMD mailboxes)
Definition at line 85 of file address_helpers.hpp.
References CMD_MBX_BASE.
|
staticconstexpr |
Get specific mailbox address with index.
Definition at line 125 of file address_helpers.hpp.
| auto commrat::make_mailbox | ( | const MailboxConfig & | config | ) |
Definition at line 245 of file registry_mailbox.hpp.
|
constexpr |
Compile-time message ID construction.
Definition at line 37 of file message_id.hpp.
Referenced by commrat::MessageRegistry< MessageDefs >::get_all_ids_impl(), system_message_id(), and user_message_id().
| int commrat::module_main | ( | const ModuleConfig & | config | ) |
Main entry point for standalone module binaries.
Provides complete lifecycle management:
Real-time safe after module start. Uses blocking sleep (0% CPU idle).
| ModuleType | Module class (must inherit from Module<...>) |
| Registry | Message registry (CommRaT<...>) |
| config | Module configuration |
Example:
Definition at line 61 of file module_main.hpp.
References g_shutdown_requested, commrat::ModuleConfig::instance_id(), commrat::ModuleConfig::name, signal_handler(), commrat::Time::sleep(), and commrat::ModuleConfig::system_id().
| int commrat::module_main | ( | int | argc, |
| char ** | argv | ||
| ) |
Main entry point with argc/argv handling.
Overload that handles configuration from command line:
| ModuleType | Module class (must inherit from Module<...>) |
| Registry | Message registry (CommRaT<...>) |
| argc | Argument count |
| argv | Argument vector |
Definition at line 114 of file module_main.hpp.
| auto commrat::serialize | ( | T & | message | ) | -> typename sertial::Message<T>::Result |
Definition at line 171 of file messages.hpp.
Referenced by serialize_message().
| auto commrat::serialize_message | ( | T & | message | ) | -> typename sertial::Message<T>::Result |
Definition at line 209 of file messages.hpp.
References serialize().
Referenced by commrat::TimsWrapper::send(), and commrat::MessageRegistry< MessageDefs >::serialize().
|
inline |
Signal handler for graceful shutdown.
Handles SIGINT and SIGTERM by setting shutdown flag.
Definition at line 24 of file module_main.hpp.
References g_shutdown_requested.
Referenced by module_main().
|
constexpr |
System message ID helper.
Definition at line 44 of file message_id.hpp.
References make_message_id(), and System.
|
constexpr |
Definition at line 36 of file mailbox.hpp.
References AlreadyRunning, InvalidDestination, InvalidMessage, NetworkError, NotInitialized, NotRunning, QueueEmpty, QueueFull, SerializationError, and Timeout.
|
constexpr |
Definition at line 29 of file messages.hpp.
|
constexpr |
User message ID helper.
Definition at line 53 of file message_id.hpp.
References make_message_id(), and UserDefined.
|
constexpr |
Definition at line 9 of file message_helpers.hpp.
|
constexpr |
Definition at line 28 of file address_helpers.hpp.
Referenced by get_data_mbx_base().
|
constexpr |
Definition at line 33 of file module_config.hpp.
|
constexpr |
Definition at line 34 of file module_config.hpp.
|
inline |
Definition at line 17 of file module_main.hpp.
Referenced by module_main(), and signal_handler().
|
inlineconstexpr |
Definition at line 391 of file io_spec.hpp.
|
constexpr |
Definition at line 24 of file address_helpers.hpp.
Referenced by extract_instance_id().
|
constexpr |
Definition at line 18 of file address_helpers.hpp.
Referenced by encode_address(), and extract_instance_id().
|
inlineconstexpr |
Definition at line 151 of file messages.hpp.
|
inlineconstexpr |
Definition at line 300 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 318 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 266 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 275 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 291 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 327 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 309 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 257 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 40 of file registry_module.hpp.
|
constexpr |
Definition at line 25 of file address_helpers.hpp.
Referenced by extract_mailbox_index().
|
constexpr |
Definition at line 19 of file address_helpers.hpp.
Referenced by encode_address(), and extract_mailbox_index().
|
inlineconstexpr |
Definition at line 228 of file messages.hpp.
|
inlineconstexpr |
Definition at line 236 of file messages.hpp.
|
inlineconstexpr |
Definition at line 370 of file io_spec.hpp.
|
inlineconstexpr |
Definition at line 232 of file messages.hpp.
|
inlineconstexpr |
Definition at line 553 of file io_spec.hpp.
|
constexpr |
Definition at line 23 of file address_helpers.hpp.
Referenced by extract_system_id().
|
constexpr |
Definition at line 17 of file address_helpers.hpp.
Referenced by encode_address(), and extract_system_id().
|
constexpr |
Definition at line 22 of file address_helpers.hpp.
Referenced by extract_type_id().
|
constexpr |
Definition at line 16 of file address_helpers.hpp.
Referenced by encode_address(), and extract_type_id().
|
inlineconstexpr |
Definition at line 583 of file io_spec.hpp.