TimeStamp Class Reference

#include <timestamp.h>

Detailed Description

A TimeStamp represents the value of an ExecutionTime at a certain instant. You can compare a TimeStamp with an ExecutionTime to see if the ExecutionTime has changed since the last update of the TimeStamp (in this case the ExecutionTime will be greater than the TimeStamp).

See also
ExecutionTime

Public Types

enum  MAX_ENUM { VALUE }
 

Public Member Functions

constexpr TimeStamp ()
 
 TimeStamp (ExecutionTime time)
 
constexpr TimeStamp (ExecutionTime::ValueType time)
 
enum maxon::TimeStamp::MAX_ENUM MAXON_ENUM_LIST_CLASS (MAX_ENUM)
 
MAXON_IMPLICIT TimeStamp (MAX_ENUM)
 
void UpdateUnchecked (TimeStamp src)
 
void UpdateUnordered (ExecutionTime time)
 
Bool UpdateAtomic (ExecutionTime time)
 
Bool Update (ExecutionTime time)
 
 operator ExecutionTime::ValueType () const
 
 MAXON_OPERATOR_EQUALITY_HASHCODE (TimeStamp, _value)
 
String ToString (const FormatStatement *fs=nullptr) const
 

Static Public Member Functions

static const TimeStampNullValue ()
 

Static Public Attributes

static const MAX_ENUM MAX
 

Private Attributes

ExecutionTime::ValueType _value
 

Member Enumeration Documentation

◆ MAX_ENUM

enum MAX_ENUM
strong
Enumerator
VALUE 

Constructor & Destructor Documentation

◆ TimeStamp() [1/4]

constexpr TimeStamp ( )
constexpr

Construct a new TimeStamp. The internal value will be set to 0. Because ExecutionTime starts with 1, this means that an initial TimeStamp will be in the past of any valid ExecutionTime.

◆ TimeStamp() [2/4]

TimeStamp ( ExecutionTime  time)
explicit

◆ TimeStamp() [3/4]

constexpr TimeStamp ( ExecutionTime::ValueType  time)
explicitconstexpr

◆ TimeStamp() [4/4]

Construct a new TimeStamp with a maximum value. I.e., the constructed TimeStamp will be in the future of every valid ExecutionTime.

Member Function Documentation

◆ MAXON_ENUM_LIST_CLASS()

enum maxon::TimeStamp::MAX_ENUM MAXON_ENUM_LIST_CLASS ( MAX_ENUM  )

◆ UpdateUnchecked()

void UpdateUnchecked ( TimeStamp  src)

◆ UpdateUnordered()

void UpdateUnordered ( ExecutionTime  time)

Updates this TimeStamp to the current value of time. This TimeStamp must not be in the future of time.

Parameters
[in]timeTime to which this TimeStamp is set.

◆ UpdateAtomic()

Bool UpdateAtomic ( ExecutionTime  time)

Atomically updates this TimeStamp to the current value of time. The update is done only if this TimeStamp is currently in the past of time.

Parameters
[in]timeTime to which this TimeStamp is set.
Returns
True if this TimeStamp has been changed, false otherwise.

◆ Update()

Bool Update ( ExecutionTime  time)

◆ operator ExecutionTime::ValueType()

operator ExecutionTime::ValueType ( ) const

Returns the internal integer value of this TimeStamp. This can be compared with the value of an ExecutionTime to see if the ExecutionTime has changed since the last update of the TimeStamp.

Returns
Internal integer value of this TimeStamp.

◆ NullValue()

static const TimeStamp& NullValue ( )
static

◆ MAXON_OPERATOR_EQUALITY_HASHCODE()

MAXON_OPERATOR_EQUALITY_HASHCODE ( TimeStamp  ,
_value   
)

◆ ToString()

String ToString ( const FormatStatement fs = nullptr) const

Member Data Documentation

◆ MAX

const MAX_ENUM MAX
static

◆ _value

ExecutionTime::ValueType _value
private