RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk::telSub::Correlator Class Referencefinal

Implements a correlator. More...

#include <rtctk/telSub/correlator.hpp>

Inheritance diagram for rtctk::telSub::Correlator:
rtctk::telSub::CorrelatorIf

Public Types

using Alloc = std::pmr::polymorphic_allocator<std::byte>
 

Public Member Functions

 Correlator (const CorrelatorParams &params, std::unique_ptr< DdsWaitSetIf > dds_subscriber, componentFramework::ComponentMetricsIf &metrics, const Alloc &alloc={})
 
std::optional< CorrelationErrorPoll (std::chrono::milliseconds timeout, const DataSamplesView *&samples) noexcept override
 The strategy is to correlate on existing data, if possible before taking more samples.
 
std::optional< std::uint32_t > GetLastSampleId () const noexcept override
 
void Reset () noexcept override
 Resets internal state.
 
void CheckDdsConnections () override
 
- Public Member Functions inherited from rtctk::telSub::CorrelatorIf
virtual ~CorrelatorIf ()=default
 

Detailed Description

Implements a correlator.

The process is driven by invoking Poll() which will take available DDS samples from provided DdsWaitSetIf and attempt to correlate them.

Member Typedef Documentation

◆ Alloc

using rtctk::telSub::Correlator::Alloc = std::pmr::polymorphic_allocator<std::byte>

Constructor & Destructor Documentation

◆ Correlator()

rtctk::telSub::Correlator::Correlator ( const CorrelatorParams & params,
std::unique_ptr< DdsWaitSetIf > dds_subscriber,
componentFramework::ComponentMetricsIf & metrics,
const Alloc & alloc = {} )
explicit
Precondition
dds_subscriber must be valid.

Member Function Documentation

◆ CheckDdsConnections()

void rtctk::telSub::Correlator::CheckDdsConnections ( )
overridevirtual

◆ GetLastSampleId()

std::optional< std::uint32_t > rtctk::telSub::Correlator::GetLastSampleId ( ) const
inlineoverridevirtualnoexcept
Returns
sample id of last successful correlation or nullopt if no correlation has been done since last Reset().

Implements rtctk::telSub::CorrelatorIf.

◆ Poll()

std::optional< CorrelationError > rtctk::telSub::Correlator::Poll ( std::chrono::milliseconds timeout,
const DataSamplesView *& samples )
overridevirtualnoexcept

The strategy is to correlate on existing data, if possible before taking more samples.

Wait for, then process incoming data and if possible populate with references to correlated set of data samples.

This should allow better batch processing.

Parameters
timeoutTime to wait for new data if there is none.
[out]samples

Implements rtctk::telSub::CorrelatorIf.

◆ Reset()

void rtctk::telSub::Correlator::Reset ( )
overridevirtualnoexcept

Resets internal state.

This is used to recover from correlation errors encountered in Poll().

It does not remove any samples taken with previous calls to Poll(). This means that if Reset() is invoked after a successful call to Poll() the same correlation will be performed again.

Postcondition
GetLastSampleId() == std::nullopt.

Implements rtctk::telSub::CorrelatorIf.


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