RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rtctk::telSub::CorrelatorIf Class Referenceabstract

Interface for correlator implemementations that takes new data samples from DDS and performs correlation on them. More...

#include <rtctk/telSub/correlatorIf.hpp>

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

Public Member Functions

virtual ~CorrelatorIf ()
 
virtual std::optional< std::uint32_t > GetLastSampleId () const RTCTK_NOEXCEPT=0
 
virtual std::optional< CorrelationErrorPoll (std::chrono::milliseconds timeout, const DataSamplesView *&view) RTCTK_NOEXCEPT=0
 Perform correlation on existing or newly taken data samples.
 
virtual void Reset () RTCTK_NOEXCEPT=0
 Resets internal state.
 
virtual void CheckDdsConnections ()=0
 

Detailed Description

Interface for correlator implemementations that takes new data samples from DDS and performs correlation on them.

Thread Safety
thread-compatible

Constructor & Destructor Documentation

◆ ~CorrelatorIf()

virtual rtctk::telSub::CorrelatorIf::~CorrelatorIf ( )
inlinevirtual

Member Function Documentation

◆ CheckDdsConnections()

virtual void rtctk::telSub::CorrelatorIf::CheckDdsConnections ( )
pure virtual

Implemented in rtctk::telSub::Correlator.

◆ GetLastSampleId()

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

Implemented in rtctk::telSub::Correlator.

◆ Poll()

virtual std::optional< CorrelationError > rtctk::telSub::CorrelatorIf::Poll ( std::chrono::milliseconds timeout,
const DataSamplesView *& view )
pure virtual

Perform correlation on existing or newly taken data samples.

Each time this method is invoked successfully the view is pointing to the next correlated set of samples.

If correlation fails due to the received samples is wrong (unexpected sample id) a side effect of this is that samples will be returned and Poll() will continue failing until Reset() is invoked to restart correlation.

Parameters
[in]timeoutAmount of time to for new data if there is none.
[out]viewReference to pointer that will be set. This pointer remains valid until next call to Poll() or Reset().
Returns
std::errc::protocol_error if correlation fails because received samples are out of sequence.
std::errc::timed_out if no new samples were received within the specified timeout.
error_code from DDS.

Implemented in rtctk::telSub::Correlator.

◆ Reset()

virtual void rtctk::telSub::CorrelatorIf::Reset ( )
pure virtual

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.

Implemented in rtctk::telSub::Correlator.


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