RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
rtctk::telSub Namespace Reference

Namespaces

namespace  CorrelationStatus
 

Classes

class  AgnosticDataSamples
 Container of DDS samples and associated sample information. More...
 
class  BlenderErrorCategory
 Error category for blender errors. More...
 
class  BusinessLogic
 Implements the Telemetry Subscriber business logic. More...
 
struct  CorrelationFailedError
 
class  Correlator
 Implements a correlator. More...
 
class  CorrelatorIf
 Interface for correlator implemementations that takes new data samples from DDS and performs correlation on them. More...
 
struct  CorrelatorParams
 Placeholder for correlator parameters. More...
 
struct  DataSamplesView
 A set of correlated agnostic non-owning data samples references. More...
 
struct  DataSampleView
 Agnostic data sample non-owning reference type. More...
 
struct  DdsParams
 Parameter set to be passed to classes deriving from DdsWaitSetIf. More...
 
class  DdsReaderListener
 Listener class for different DDS events. More...
 
struct  DdsTopicOptions
 Options for a single topic. More...
 
class  DdsWaitSet
 Implements DDS communication using FastDDS. More...
 
struct  DdsWaitSetError
 Error reporting struct, contains the return code and topic where the error occurred. More...
 
class  DdsWaitSetIf
 Base class abstracting DDS communication code. More...
 
class  FakeDdsSubscriber
 Fake DDS subscriber. More...
 
struct  MockCorrelatorIf
 
struct  MockDdsWaitSet
 
struct  MockShmPublisherIf
 
class  OperationalLogic
 Implements the behaviour for Operational state. More...
 
struct  OperationalLogicFactoryParams
 Set of all parameters needed when constructing the OperationalLogic object. More...
 
class  OperationalLogicIf
 Interface to the operational logic implementation. More...
 
struct  OperationalParams
 Configuration parameters needed for operational logic. More...
 
class  SeqLoanerIf
 Loaner interface. More...
 
struct  ShmParams
 Shared memory configuration parameters. More...
 
class  ShmPublisher
 
class  ShmPublisherIf
 Simple interface to class that owns the shared memory queue. More...
 

Typedefs

using DdsSample = rtctk::componentFramework::AgnosticTopic
 
using DdsSampleSeq = rtctk::componentFramework::AgnosticTopicSeq
 
using DdsInfoSeq = rtctk::componentFramework::SampleInfoSeq
 
using LifeCycle = rtctk::componentFramework::Runnable<rtctk::componentFramework::RtcComponent>
 
using CorrelationError = std::variant<CorrelationFailedError, DdsWaitSetError>
 

Enumerations

enum class  GenericBlenderError : std::uint8_t {
  Success = 0 , MissingTopic , SizeMismatch , InvalidFormat ,
  UnknownError
}
 Error codes for blender-related errors. More...
 
enum class  InternalError : uint8_t { LUT_ENTRY_NOT_FOUND }
 For internal errors. More...
 

Functions

const std::error_category & GetBlenderErrorCategory () noexcept
 Returns a reference to the global blender error category instance.
 
std::error_code MakeBlenderError (GenericBlenderError e) noexcept
 Creates an error_code for a blender error.
 
std::ostream & operator<< (std::ostream &stream, const std::vector< std::string > &data)
 A specialisation of the stream output operator to handle vectors of strings.
 
template<class UserTopicType, class DataBlender>
void Main (const rtctk::componentFramework::Args &args, DataBlender &&blender)
 Main entrypoint for running telemetry subscriber.
 
template<class UserTopicType, class DataBlender, class ShmWriter>
auto MakeShmPublisher (ShmWriter &&shm_writer, DataBlender &blender) -> std::unique_ptr< ShmPublisher< UserTopicType, DataBlender, ShmWriter > >
 Helper that can deduce DataBlender class template argument.
 

Typedef Documentation

◆ CorrelationError

◆ DdsInfoSeq

using rtctk::telSub::DdsInfoSeq = rtctk::componentFramework::SampleInfoSeq

◆ DdsSample

using rtctk::telSub::DdsSample = rtctk::componentFramework::AgnosticTopic

◆ DdsSampleSeq

using rtctk::telSub::DdsSampleSeq = rtctk::componentFramework::AgnosticTopicSeq

◆ LifeCycle

Enumeration Type Documentation

◆ GenericBlenderError

enum class rtctk::telSub::GenericBlenderError : std::uint8_t
strong

Error codes for blender-related errors.

These are generic error codes that cover the most common error scenarios in blender functions. Users can define their own more specific error codes by creating custom error categories.

Enumerator
Success 

No error, operation successful.

MissingTopic 

Required topic was not found in the input data.

SizeMismatch 

Data size does not match expected size.

InvalidFormat 

Data format is invalid or corrupted.

UnknownError 

Generic unknown error.

◆ InternalError

enum class rtctk::telSub::InternalError : uint8_t
strong

For internal errors.

Enumerator
LUT_ENTRY_NOT_FOUND 

Function Documentation

◆ GetBlenderErrorCategory()

const std::error_category & rtctk::telSub::GetBlenderErrorCategory ( )
noexcept

Returns a reference to the global blender error category instance.

This function provides access to the singleton error category used for blender errors.

Returns
A reference to the global BlenderErrorCategory instance.
Example:
// Direct usage
const std::error_category& cat = GetBlenderErrorCategory();
// Creating an error code
std::error_code ec(static_cast<int>(BlenderError::SizeMismatch), GetBlenderErrorCategory());
const std::error_category & GetBlenderErrorCategory() noexcept
Returns a reference to the global blender error category instance.
Definition blenderError.cpp:20

◆ Main()

template<class UserTopicType, class DataBlender>
void rtctk::telSub::Main ( const rtctk::componentFramework::Args & args,
DataBlender && blender )

Main entrypoint for running telemetry subscriber.

It is meant to be invoked by delegation from a RtcComponentMain implementation (see Telemetry Subscriber).

Template Parameters
UserTopicTypeUser defined topic used in shared memory queue.
DataBlenderType for the blender function. It must be callable with the following signature: std::error_code(const rtctk::telSub::DataSamplesView& dds_samples, UserTopicType& shm_sample). In addition it must be movable (or copyable).
Parameters
argsCommand line arguments as received in RtcComponentMain.
blenderThe callable used to convert DDS agnostic topic samples into the user defined topic in shared memory. This is invoked for each set of correlated data samples and should do absolutely minimal processing and avoid thread synchronisation.

◆ MakeBlenderError()

std::error_code rtctk::telSub::MakeBlenderError ( GenericBlenderError e)
noexcept

Creates an error_code for a blender error.

This is a convenient wrapper that uses the global error category.

This is a convenient helper function to create error codes for blender errors. It is the preferred way to create blender error codes.

Parameters
eThe BlenderError to convert.
Returns
An error_code representing the error.
Example:
// Use the helper function to create error codes
return MakeBlenderError(BlenderError::MissingTopic);
// In a blender function:
if (topic_ptr == samples.end()) {
return MakeBlenderError(BlenderError::MissingTopic);
}
std::error_code MakeBlenderError(GenericBlenderError e) noexcept
Creates an error_code for a blender error.
Definition blenderError.cpp:30

◆ MakeShmPublisher()

template<class UserTopicType, class DataBlender, class ShmWriter>
auto rtctk::telSub::MakeShmPublisher ( ShmWriter && shm_writer,
DataBlender & blender ) -> std::unique_ptr<ShmPublisher<UserTopicType, DataBlender, ShmWriter>>

Helper that can deduce DataBlender class template argument.

◆ operator<<()

std::ostream & rtctk::telSub::operator<< ( std::ostream & stream,
const std::vector< std::string > & data )

A specialisation of the stream output operator to handle vectors of strings.

This is used by methods such as BusinessLogic::GetParam.

Note
this needs to be in the same namespace as BusinessLogic, i.e. rtctk::telSub, otherwise the compiler is not able to match this function as the appropriate one to use.