DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
TimestampEstimatorBase is the base class for timestamp-based logic in test systems where the current timestamp must be estimated somehow (eg, because there is no hardware timing system). More...
#include <TimestampEstimatorBase.hpp>
Public Types | |
enum | WaitStatus { kFinished , kInterrupted } |
Public Member Functions | |
virtual | ~TimestampEstimatorBase ()=default |
virtual uint64_t | get_timestamp_estimate () const =0 |
virtual std::chrono::microseconds | get_wait_estimate (uint64_t ts) const =0 |
WaitStatus | wait_for_valid_timestamp (std::atomic< bool > &continue_flag) |
Waits for a valid timestamp to become available. Returns a status value that indicates whether a valid timestamp is available or not. | |
WaitStatus | wait_for_timestamp (uint64_t ts, std::atomic< bool > &continue_flag) |
TimestampEstimatorBase is the base class for timestamp-based logic in test systems where the current timestamp must be estimated somehow (eg, because there is no hardware timing system).
Definition at line 23 of file TimestampEstimatorBase.hpp.
Enumerator | |
---|---|
kFinished | |
kInterrupted |
Definition at line 30 of file TimestampEstimatorBase.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in dunedaq::utilities::TimestampEstimator, and dunedaq::utilities::TimestampEstimatorSystem.
|
pure virtual |
Implemented in dunedaq::utilities::TimestampEstimator, and dunedaq::utilities::TimestampEstimatorSystem.
TimestampEstimatorBase::WaitStatus dunedaq::utilities::TimestampEstimatorBase::wait_for_timestamp | ( | uint64_t | ts, |
std::atomic< bool > & | continue_flag ) |
Wait for the current timestamp estimate to reach ts, or for continue_flag to become false.
Returns kFinished if the timestamp became valid, or kInterrupted if continue_flag became false first
Definition at line 43 of file TimestampEstimatorBase.cpp.
TimestampEstimatorBase::WaitStatus dunedaq::utilities::TimestampEstimatorBase::wait_for_valid_timestamp | ( | std::atomic< bool > & | continue_flag | ) |
Waits for a valid timestamp to become available. Returns a status value that indicates whether a valid timestamp is available or not.
Wait for the current timestamp estimate to become valid, or for continue_flag to become false. The timestamp becomes valid once at least one TimeSync message has been received.
Returns kFinished if the timestamp became valid, or kInterrupted if continue_flag became false first
continue_flag | whether to continue waiting until a valid timestamp is available or return immediately |
The value of the continue_flag can be changed from true to false externally to this method, and that will cause the method to exit soon thereafter (on the order of 10 msec) and return the current status.
Definition at line 27 of file TimestampEstimatorBase.cpp.