ExecutionTime Class Reference

#include <timestamp.h>

Detailed Description

An ExecutionTime holds an integer value to be used for time stamps. As such it is not related to any kind of real time, but just as a value which is incremented by one whenever an event of interest happens. What kind of event this is depends on the context in which the ExecutionTime is used. For example, it might be a modification counter of some data which is incremented whenever the data is changed.

ExecutionTime has only a single operation, namely ++ to increment the value. TimeStamp objects can then be used to save the value of an ExecutionTime at a certain instant, and to check if the ExecutionTime has changed in the meantime. I.e., in the use case of a data modification counter, you use a single ExecutionTime for the original data. For each dependent data which has to be re-computed when the original data changes, you use a TimeStamp value which stores the ExecutionTime when the dependent data has been updated the last time.

One could also use Int values directly for execution times and time stamps, but these wrapper classes make the purpose of the values clearer, and they only allow the meaningful operations which makes them safer.

See also

Public Types

using ValueType = UInt
using AtomicType = AtomicUInt

Public Member Functions

 ExecutionTime ()
ExecutionTimeoperator++ ()
void operator++ (int)
 operator ValueType () const

Private Attributes

ValueType _value


class TimeStamp

Member Typedef Documentation

◆ ValueType

using ValueType = UInt

◆ AtomicType

Constructor & Destructor Documentation

◆ ExecutionTime()

Construct a new ExecutionTime. The internal value will be set to 1.

Member Function Documentation

◆ operator++() [1/2]

ExecutionTime& operator++ ( )

Increments the ExecutionTime by one. Don't mix with BeginNewGlobalTime.

◆ operator++() [2/2]

void operator++ ( int  )

Increments the ExecutionTime by one. Don't mix with BeginNewGlobalTime.

◆ operator ValueType()

operator ValueType ( ) const

Returns the internal integer value.

Internal integer value of this ExecutionTime.

Friends And Related Function Documentation

◆ TimeStamp

friend class TimeStamp

Member Data Documentation

◆ _value

ValueType _value