DUECA/DUSIME
|
A PeriodicTimeSpec is derived from the normal TimeSpec. More...
#include <TimeSpec.hxx>
Public Member Functions | |
PeriodicTimeSpec (const PeriodicTimeSpec &) | |
Copy constructor. | |
PeriodicTimeSpec (const TimeSpec &) | |
Constructor that creates a PeriodicTimeSpec from a TimeSpec. | |
PeriodicTimeSpec (TimeTickType validity_start=0, TimeTickType period=1) | |
Constructor. | |
bool | complete () |
Complete method, called after constructor and supply of parameters, has to check the validity of the parameters. | |
const char * | getTypeName () |
Type name information. | |
~PeriodicTimeSpec () | |
Destructor. | |
TimeSpec * | clone () const |
Clone method, re-implemented from TimeSpec. | |
bool | advance (const TimeSpec &a) |
Advances the interval in the PeriodicTimeSpec with a value equal to the period specified in its creation, but only if the end time specified in the TimeSpec parameter is beyond the PeriodicTimeSpec's end time. | |
bool | advance (const DataTimeSpec &a) |
Advance with a DataTimeSpec. | |
bool | advance (const TimeTickType &validity_end=MAX_TIMETICK) |
Advance with an end time tick. | |
bool | greedyAdvance (const DataTimeSpec &a) |
"Greedy" variant of the advance method. | |
bool | forceAdvance (const TimeTickType &validity_point) |
Spool ahead fast (so forget all the intermediate intervals), to the time specified in the argument. | |
bool | forceAdvance (const DataTimeSpec &t) |
Spool ahead fast. | |
void | slideAdvance (const TimeTickType &t) |
Slide forward, can also change offset. | |
TimeTickType | getPeriod () const |
Read back the period. | |
void | setPeriod (TimeTickType p) |
Change the period. | |
ostream & | print (ostream &os) const |
Write to stream, mainly for debugging purposes. | |
Public Member Functions inherited from dueca::TimeSpec | |
TimeSpec (const TimeSpec &) | |
Copy constructor. | |
TimeSpec (TimeTickType validity_start, TimeTickType validity_end) | |
Complete constructor, with the start and end time. | |
TimeSpec (int validity_start, int validity_end) | |
Complete constructor, with the start and end time. | |
TimeSpec (TimeTickType validity_start) | |
Constructor for a TimeSpec that starts and ends at the same time. | |
TimeSpec (double validity_start, double validity_end) | |
Constructor with double arguments. | |
TimeSpec (float validity_start, float validity_end) | |
Variation with float. | |
TimeSpec (const DataTimeSpec &) | |
Constructor with a DataTimeSpec as input. | |
TimeSpec () | |
Default constructor. | |
virtual | ~TimeSpec () |
Destructor. | |
TimeTickType | getValidityStart () const |
Returns the time at which the interval starts. | |
TimeTickType | getValidityEnd () const |
Returns the time at which the interval has ended. | |
TimeTickType | getValiditySpan () const |
Returns the size of the interval. | |
bool | operator== (const TimeSpec &other) const |
Compare one interval to another. | |
bool | operator!= (const TimeSpec &other) const |
Compare one interval to another, and return true when not equal. | |
TimeSpec | operator+ (const int delta) const |
Move an interval up with a time delta. | |
TimeSpec | operator+ (const unsigned int delta) const |
Move an interval up with a time delta. | |
TimeSpec | operator+ (const double delta) const |
Move an interval up with a time in seconds. | |
TimeSpec | operator+ (const float delta) const |
Move an interval up with a time in seconds. | |
TimeSpec | operator- (const double delta) const |
Move an interval up with a time in seconds. | |
TimeSpec | operator- (const float delta) const |
Move an interval up with a time in seconds. | |
TimeSpec | operator- (const int delta) const |
Move an interval back with a time delta. | |
TimeSpec | operator- (const unsigned int delta) const |
Move an interval back with a time delta. | |
int | operator- (const TimeSpec &to) const |
Get the difference between two timespec's. | |
TimeSpec & | operator= (const DataTimeSpec &o) |
Copy from a data timespec. | |
double | getDtInSeconds () const |
Get the value of the interval in seconds. | |
int | getUsecsElapsed () const |
Find out how many microseconds elapsed since the formal start of this time. | |
ostream & | print (ostream &os) const |
Write to stream, mainly for debugging purposes. | |
Static Public Member Functions | |
static const ParameterTable * | getParameterTable () |
Obtain a pointer to the parameter table. | |
Static Public Member Functions inherited from dueca::TimeSpec | |
static const TimeSpec & | endOfTime () |
The time spec at the end of time. | |
static const TimeSpec & | startOfTime () |
The time spec at the beginning of time. | |
Static Public Attributes | |
static const char * | classname |
Class name, for error messages. | |
Static Public Attributes inherited from dueca::TimeSpec | |
static const TimeSpec | end_of_time |
A special time spec at the end of time. | |
static const TimeSpec | start_of_time |
Timespec at the start of time. | |
Additional Inherited Members | |
Protected Attributes inherited from dueca::TimeSpec | |
TimeTickType | validity_start |
The time interval starts here. | |
TimeTickType | validity_end |
The time interval ends before this. | |
A PeriodicTimeSpec is derived from the normal TimeSpec.
It behaves differently, in that it tries to enforce the period specified at its creation in the "advance" updates.
Constructor that creates a PeriodicTimeSpec from a TimeSpec.
The interval between the end and start times is taken as the period.
dueca::PeriodicTimeSpec::PeriodicTimeSpec | ( | TimeTickType | validity_start = 0, |
TimeTickType | period = 1 ) |
|
virtual |
Clone method, re-implemented from TimeSpec.
Reimplemented from dueca::TimeSpec.
Advances the interval in the PeriodicTimeSpec with a value equal to the period specified in its creation, but only if the end time specified in the TimeSpec parameter is beyond the PeriodicTimeSpec's end time.
if the method returns false, no advance was made, if the method returns true, and advance was made. This is central to the frequency step-up and step-down method used in DUECA.
Reimplemented from dueca::TimeSpec.
|
virtual |
Advance with a DataTimeSpec.
Reimplemented from dueca::TimeSpec.
Advance with an end time tick.
Reimplemented from dueca::TimeSpec.
bool dueca::PeriodicTimeSpec::greedyAdvance | ( | const DataTimeSpec & | a | ) |
"Greedy" variant of the advance method.
Advances until the a.validity_end is no longer past the current time spec start
a | Time span to cover. |
Spool ahead fast (so forget all the intermediate intervals), to the time specified in the argument.
The PeriodicTimeSpec will not forget its offset+period when doing this, so the actual time to which it spools may be rounded off downwards.
Reimplemented from dueca::TimeSpec.
|
virtual |
Spool ahead fast.
Reimplemented from dueca::TimeSpec.
Class name, for error messages.
A white lie, actually PeriodicTimeSpec, but this timespec doubles for all in the script creation