|
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) |
| WaitStatus | wait_for_valid_timestamp (std::atomic< bool > &continue_flag, uint64_t &last_seen_ts) |
| 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_requested_timestamp (uint64_t ts, std::atomic< bool > &continue_flag) |
| WaitStatus | wait_for_requested_timestamp (uint64_t ts, std::atomic< bool > &continue_flag, uint64_t &last_seen_ts) |
Static Public Attributes | |
| static constexpr uint64_t | s_invalid_ts = std::numeric_limits<uint64_t>::max() |
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 25 of file TimestampEstimatorBase.hpp.
| Enumerator | |
|---|---|
| kFinished | |
| kInterrupted | |
Definition at line 34 of file TimestampEstimatorBase.hpp.
|
virtualdefault |
|
pure virtual |
|
pure virtual |
|
inline |
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 61 of file TimestampEstimatorBase.hpp.
| TimestampEstimatorBase::WaitStatus dunedaq::utilities::TimestampEstimatorBase::wait_for_requested_timestamp | ( | uint64_t | ts, |
| std::atomic< bool > & | continue_flag, | ||
| uint64_t & | last_seen_ts ) |
Definition at line 45 of file TimestampEstimatorBase.cpp.
|
inline |
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
Definition at line 47 of file TimestampEstimatorBase.hpp.
| TimestampEstimatorBase::WaitStatus dunedaq::utilities::TimestampEstimatorBase::wait_for_valid_timestamp | ( | std::atomic< bool > & | continue_flag, |
| uint64_t & | last_seen_ts ) |
Waits for a valid timestamp to become available. Returns a status value that indicates whether a valid timestamp is available or not.
| continue_flag | whether to continue waiting until a valid timestamp is available or return immediately |
| last_seen_ts | (Output parameter) the last timestamp seen by the method |
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.
|
staticconstexpr |
Definition at line 28 of file TimestampEstimatorBase.hpp.