RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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) RTCTK_NOEXCEPT override
 The strategy is to correlate on existing data, if possible before taking more samples.
 
std::optional< std::uint32_t > GetLastSampleId () const RTCTK_NOEXCEPT override
 
void Reset () RTCTK_NOEXCEPT override
 Resets internal state.
 
void CheckDdsConnections () override
 
- Public Member Functions inherited from rtctk::telSub::CorrelatorIf
virtual ~CorrelatorIf ()
 

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
inlineoverridevirtual
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 )
overridevirtual

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 ( )
overridevirtual

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: