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

Mixin providing input metadata accessor methods. More...

#include <commrat/module/metadata/input_metadata_accessors.hpp>

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

Classes

struct  InputMetadata
 Input metadata structure returned by accessor methods. More...
 

Public Member Functions

template<std::size_t Index>
auto get_input_metadata () const
 
template<std::size_t Index>
uint64_t get_input_timestamp () const
 Get input timestamp by index (convenience method)
 
template<std::size_t Index>
bool has_new_data () const
 Check if input has new data by index.
 
template<std::size_t Index>
bool is_input_valid () const
 Check if input is valid by index.
 
template<typename T >
requires (ModuleType::num_inputs > 1)
auto get_input_metadata () const
 
template<typename T >
requires (ModuleType::num_inputs > 1)
uint64_t get_input_timestamp () const
 Get input timestamp by type (convenience method)
 
template<typename T >
requires (ModuleType::num_inputs > 1)
bool has_new_data () const
 Check if input has new data by type.
 
template<typename T >
requires (ModuleType::num_inputs > 1)
bool is_input_valid () const
 Check if input is valid by type.
 

Protected Member Functions

ModuleType & module ()
 
const ModuleType & module () const
 

Detailed Description

template<typename ModuleType>
class commrat::InputMetadataAccessors< ModuleType >

Mixin providing input metadata accessor methods.

CRTP base class that provides metadata accessors for modules with inputs. Access patterns:

Template Parameters
ModuleTypeThe derived Module class (CRTP pattern)

Definition at line 29 of file input_metadata_accessors.hpp.

Member Function Documentation

◆ get_input_metadata() [1/2]

◆ get_input_metadata() [2/2]

template<typename ModuleType >
template<typename T >
requires (ModuleType::num_inputs > 1)
auto commrat::InputMetadataAccessors< ModuleType >::get_input_metadata ( ) const
inline

Definition at line 166 of file input_metadata_accessors.hpp.

References commrat::find_type_index().

◆ get_input_timestamp() [1/2]

template<typename ModuleType >
template<std::size_t Index>
uint64_t commrat::InputMetadataAccessors< ModuleType >::get_input_timestamp ( ) const
inline

Get input timestamp by index (convenience method)

Template Parameters
IndexThe input index
Returns
Timestamp from TimsHeader (nanoseconds since epoch)
Examples
/home/runner/work/CommRaT/CommRaT/include/commrat/module/metadata/input_metadata_accessors.hpp.

Definition at line 105 of file input_metadata_accessors.hpp.

References commrat::InputMetadataAccessors< ModuleType >::module().

◆ get_input_timestamp() [2/2]

template<typename ModuleType >
template<typename T >
requires (ModuleType::num_inputs > 1)
uint64_t commrat::InputMetadataAccessors< ModuleType >::get_input_timestamp ( ) const
inline

Get input timestamp by type (convenience method)

Definition at line 181 of file input_metadata_accessors.hpp.

References commrat::find_type_index().

◆ has_new_data() [1/2]

template<typename ModuleType >
template<std::size_t Index>
bool commrat::InputMetadataAccessors< ModuleType >::has_new_data ( ) const
inline

Check if input has new data by index.

For multi-input modules, returns true if the input was freshly received and not reused from history (timestamp matches primary). For single-input modules, always returns true.

Template Parameters
IndexThe input index
Returns
True if fresh data, false if stale
Examples
/home/runner/work/CommRaT/CommRaT/include/commrat/module/metadata/input_metadata_accessors.hpp.

Definition at line 122 of file input_metadata_accessors.hpp.

References commrat::InputMetadataAccessors< ModuleType >::module().

◆ has_new_data() [2/2]

template<typename ModuleType >
template<typename T >
requires (ModuleType::num_inputs > 1)
bool commrat::InputMetadataAccessors< ModuleType >::has_new_data ( ) const
inline

Check if input has new data by type.

Definition at line 196 of file input_metadata_accessors.hpp.

References commrat::find_type_index().

◆ is_input_valid() [1/2]

template<typename ModuleType >
template<std::size_t Index>
bool commrat::InputMetadataAccessors< ModuleType >::is_input_valid ( ) const
inline

Check if input is valid by index.

For multi-input modules, returns true if getData succeeded. For single-input modules, always returns true (receive succeeded).

Template Parameters
IndexThe input index
Returns
True if valid, false if getData failed
Examples
/home/runner/work/CommRaT/CommRaT/include/commrat/module/metadata/input_metadata_accessors.hpp.

Definition at line 138 of file input_metadata_accessors.hpp.

References commrat::InputMetadataAccessors< ModuleType >::module().

◆ is_input_valid() [2/2]

template<typename ModuleType >
template<typename T >
requires (ModuleType::num_inputs > 1)
bool commrat::InputMetadataAccessors< ModuleType >::is_input_valid ( ) const
inline

Check if input is valid by type.

Definition at line 210 of file input_metadata_accessors.hpp.

References commrat::find_type_index().

◆ module() [1/2]

◆ module() [2/2]

template<typename ModuleType >
const ModuleType & commrat::InputMetadataAccessors< ModuleType >::module ( ) const
inlineprotected

Definition at line 33 of file input_metadata_accessors.hpp.


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