DUECA/DUSIME
|
DataTimeSpec is a special bare-bones version of TimeSpec. More...
#include <DataTimeSpec.hxx>
Public Types | |
typedef DataTimeSpec | __ThisDCOType__ |
typedef for internal reference | |
Public Member Functions | |
DataTimeSpec () | |
default constructor. | |
DataTimeSpec (const TimeTickType &validity_start, const TimeTickType &validity_end) | |
Constructor with arguments. | |
DataTimeSpec (const DataTimeSpec &o) | |
copy constructor. | |
DataTimeSpec (::dueca::AmorphReStore &r) | |
constructor to restore an DataTimeSpec from amorphous storage. | |
~DataTimeSpec () | |
destructor. | |
void | packData (::dueca::AmorphStore &s) const |
packs the DataTimeSpec into amorphous storage. | |
void | packDataDiff (::dueca::AmorphStore &s, const DataTimeSpec &ref) const |
packs the DataTimeSpec into amorphous storage. | |
void | unPackData (::dueca::AmorphReStore &s) |
unpacks the DataTimeSpec from an amorphous storage. | |
void | unPackDataDiff (::dueca::AmorphReStore &s) |
unpacks the differences for DataTimeSpec from an amorphous storage. | |
bool | operator== (const DataTimeSpec &o) const |
Test for equality. | |
bool | operator!= (const DataTimeSpec &o) const |
Test for inequality. | |
DataTimeSpec & | operator= (const DataTimeSpec &o) |
Assignment operator. | |
std::ostream & | print (std::ostream &s) const |
prints the DataTimeSpec to a stream. | |
DataTimeSpec (const TimeSpec &time_spec) | |
Copy constructor, DataTimeSpec objects are often created from a PeriodicTimeSpec or TimeSpec object. | |
DataTimeSpec (TimeTickType validity_start) | |
Constructor for a TimeSpec that starts and ends at the same time. | |
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. | |
DataTimeSpec & | operator= (const TimeSpec &other) |
Set the DataTimeSpec to the value of a normal 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. | |
bool | extendsOrIsAfter (const TimeTickType ts) const |
Test whether this time spec is "after" the given time. | |
DataTimeSpec | modifyToAfter (const TimeTickType ts) const |
Modify a time spec to not start earlier than ts. | |
DataTimeSpec | operator+ (const int delta) const |
Add a certain value to the time. | |
DataTimeSpec | operator+ (const unsigned int delta) const |
Add a certain value to the time. | |
DataTimeSpec | operator+ (const double delta) const |
Move an interval up with a time in seconds. | |
DataTimeSpec | operator+ (const float delta) const |
Move an interval up with a time in seconds. | |
DataTimeSpec | operator- (const int delta) const |
Subtract a certain value from the time. | |
DataTimeSpec | operator- (const unsigned int delta) const |
Subtract a certain value from the time. | |
DataTimeSpec | operator- (const double delta) const |
Move an interval up with a time in seconds. | |
DataTimeSpec | operator- (const float delta) const |
Move an interval up with a time in seconds. | |
DataTimeSpec & | operator+= (const unsigned delta) |
Add a certain tick value to the time. | |
DataTimeSpec & | operator-= (const unsigned delta) |
Subtract a certain tick value from the time. | |
DataTimeSpec & | operator+= (const int delta) |
Add a certain value to the time. | |
void | setSpanToZero () |
set the data span to zero | |
DataTimeSpec & | operator-= (const int delta) |
Subtract a certain value from the time. | |
Static Public Member Functions | |
static void * | operator new (size_t size) |
new operator "new", which places objects not on a heap, but in one of the memory arenas. | |
static void * | operator new (size_t size, void *mem) |
accompanying placement operator "new" | |
static void | operator delete (void *p) |
new operator "delete", to go with the new version of operator new. | |
static void * | operator new (size_t size, DataTimeSpec *&o) |
placement "new", needed for stl. | |
static DataTimeSpec | now () |
Static function returning a DataTimeSpec with the current time. | |
Public Attributes | |
TimeTickType | validity_start |
The time interval starts here. | |
TimeTickType | validity_end |
The time interval ends before this. | |
Friends | |
class | TimeSpec |
Allow my colleagues TimeSpec and PeriodicTimeSpec some leeway? | |
class | PeriodicTimeSpec |
DataTimeSpec is a special bare-bones version of TimeSpec.
It is used for storage of the time specification with the data in channels. The advantage is that DataTimeSpec has no virtual functions and thus no virtual table pointer. This does not only make it smaller, but it also make the DataTimeSpec usable across a reflective/shared memory device where a virtual table pointer would be erroneous in all but one process.
dueca::DataTimeSpec::DataTimeSpec | ( | TimeTickType | validity_start | ) |
Constructor for a TimeSpec that starts and ends at the same time.
For example events are like this.
|
static |
new operator "new", which places objects not on a heap, but in one of the memory arenas.
This to speed up memory management.
void dueca::DataTimeSpec::packDataDiff | ( | ::dueca::AmorphStore & | s, |
const DataTimeSpec & | ref ) const |
packs the DataTimeSpec into amorphous storage.
only differences with a previous object are packed.