Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
TimeVar Class Reference

#include "lib/time/timevalue.hpp"

Description

a mutable time value, behaving like a plain number, allowing copy and re-accessing

Note
supports scaling by a factor, which deliberately is chosen as int, not raw_time_64, because the multiplying of times is meaningless.

Definition at line 239 of file timevalue.hpp.

Public Member Functions

 TimeVar (TimeValue const &time=TimeValue(0))
 
 TimeVar (FSecs const &)
 Allow to pick up precise fractional seconds.
 
 TimeVar (TimeVar const &o)
 Allowing copy and assignment.
 
TimeVaroperator= (TimeVar const &)=default
 
TimeVaroperator= (TimeValue const &o)
 
 operator FSecs () const
 Support for micro-tick precise time arithmetics.
 
TimeVaroperator+= (TimeVar const &tx)
 Supporting additive.
 
TimeVaroperator-= (TimeVar const &tx)
 
TimeVaroperator*= (int64_t fact)
 Supporting multiplication with integral factor.
 
TimeVar operator- () const
 Supporting sign flip.
 
- Public Member Functions inherited from TimeValue
 TimeValue (raw_time_64 val)
 
 TimeValue (TimeValue const &o)
 copy initialisation allowed
 
 operator std::string () const
 
bool isRegular () const
 
std::strong_ordering operator<=> (TimeValue const &) const =default
 
bool operator== (TimeValue const &) const =default
 
std::strong_ordering operator<=> (raw_time_64 tt) const
 
bool operator== (raw_time_64 tt) const
 

Additional Inherited Members

- Static Public Attributes inherited from TimeValue
static const raw_time_64 SCALE = 1'000'000
 Number of micro ticks (µs) per second as basic time scale.
 
- Static Public Member Functions inherited from TimeValue
static TimeValue buildRaw_ (raw_time_64)
 
- Protected Member Functions inherited from TimeValue
TimeValueoperator= (TimeValue const &o)
 Assigning of time values is not allowed, but derived classed might allow that.
 
 TimeValue (TimeValue const &origin, TimeValue const &target)
 
- Static Protected Member Functions inherited from TimeValue
static raw_time_64 limitedTime (raw_time_64 raw)
 explicit limit of allowed time range
 
static raw_time_64 limitedDelta (raw_time_64 origin, raw_time_64 target)
 safe calculation of explicitly limited time offset
 
- Protected Attributes inherited from TimeValue
raw_time_64 t_
 the raw (internal) time value used to implement the time types
 

Constructor & Destructor Documentation

◆ TimeVar() [1/3]

TimeVar ( TimeValue const &  time = TimeValue(0))
inline

Definition at line 247 of file timevalue.hpp.

◆ TimeVar() [2/3]

TimeVar ( FSecs const &  fractionalSeconds)
inline

Allow to pick up precise fractional seconds.

Warning
truncating fractional µ-ticks

Definition at line 795 of file timevalue.hpp.

◆ TimeVar() [3/3]

TimeVar ( TimeVar const &  o)
inline

Allowing copy and assignment.

Definition at line 256 of file timevalue.hpp.

Member Function Documentation

◆ operator=() [1/2]

TimeVar & operator= ( TimeVar const &  )
default

◆ operator=() [2/2]

TimeVar & operator= ( TimeValue const &  o)
inline

Definition at line 261 of file timevalue.hpp.

◆ operator FSecs()

operator FSecs ( ) const
inline

Support for micro-tick precise time arithmetics.

Definition at line 268 of file timevalue.hpp.

References TimeValue::SCALE, and TimeValue::t_.

◆ operator+=()

TimeVar & operator+= ( TimeVar const &  tx)
inline

Supporting additive.

Definition at line 271 of file timevalue.hpp.

References TimeValue::t_.

◆ operator-=()

TimeVar & operator-= ( TimeVar const &  tx)
inline

Definition at line 272 of file timevalue.hpp.

References TimeValue::t_.

◆ operator*=()

TimeVar & operator*= ( int64_t  fact)
inline

Supporting multiplication with integral factor.

Definition at line 275 of file timevalue.hpp.

References TimeValue::t_.

◆ operator-()

TimeVar operator- ( ) const
inline

Supporting sign flip.

Definition at line 278 of file timevalue.hpp.

+ Inheritance diagram for TimeVar:
+ Collaboration diagram for TimeVar:

The documentation for this class was generated from the following file: