Lumiera  0.pre.03
»edit your freedom«
Time Class Reference

#include "lib/time/timevalue.hpp"

Description

Lumiera's internal time value datatype.

This is a TimeValue, but now more specifically denoting a point in time, measured in reference to an internal (opaque) time scale.

Lumiera Time provides some limited capabilities for direct manipulation; Time values can be created directly from (ms,sec,min,hour) specification and there is an string representation intended for internal use (reporting and debugging). Any real output, formatting and persistent storage should be based on the (quantised) timecode formats though, which can be generated from time values.

Similar to TimeValue, also Time objects are considered immutable values. As convenience shortcut, some operators are provided, creating a TimVar for further calculations.

Examples:
/Werk/devel/lumi/src/lib/test/test-helper.hpp.

Definition at line 308 of file timevalue.hpp.

Public Member Functions

 Time (TimeValue const &val=TimeValue(0))
 
 Time (TimeVar const &calcResult)
 
 Time (FSecs const &fractionalSeconds)
 convenience constructor to build an Time value from a fraction of seconds, given as rational number. More...
 
 Time (long millis, uint secs, uint mins=0, uint hours=0)
 convenience constructor to build an internal Lumiera Time value from the usual parts of an sexagesimal time specification. More...
 
 operator std::string () const
 
TimeVar operator+ (TimeValue const &tval) const
 convenience start for time calculations
 
TimeVar operator- (TimeValue const &tval) const
 
TimeVar operator- () const
 
- Public Member Functions inherited from TimeValue
 TimeValue (gavl_time_t val)
 
 TimeValue (TimeValue const &o)
 copy initialisation allowed
 
bool isRegular () const
 
 operator std::string () const
 

Static Public Attributes

static const Time ANYTIME
 border condition marker value. ANYTIME <= any time value
 
static const Time MAX
 
static const Time MIN
 
static const Time NEVER
 border condition marker value. NEVER >= any time value
 
static const Time ZERO
 
- Static Public Attributes inherited from TimeValue
static const gavl_time_t SCALE = GAVL_TIME_SCALE
 Number of micro ticks (µs) per second as basic time scale.
 

Private Member Functions

 Time (int)
 suppress possible direct conversions
 
Timeoperator= (Time const)
 direct assignment prohibited
 

Additional Inherited Members

- Static Public Member Functions inherited from TimeValue
static TimeValue buildRaw_ (gavl_time_t)
 
- Protected Member Functions inherited from TimeValue
 TimeValue (TimeValue const &origin, TimeValue const &target)
 
TimeValueoperator= (TimeValue const &o)
 Assigning of time values is not allowed, but derived classed might allow that.
 
- Static Protected Member Functions inherited from TimeValue
static gavl_time_t limitedDelta (gavl_time_t origin, gavl_time_t target)
 safe calculation of explicitly limited time offset
 
static gavl_time_t limitedTime (gavl_time_t raw)
 explicit limit of allowed time range More...
 
- Protected Attributes inherited from TimeValue
gavl_time_t t_
 the raw (internal) time value used to implement the time types
 

Constructor & Destructor Documentation

◆ Time() [1/2]

Time ( FSecs const &  fractionalSeconds)
explicit

convenience constructor to build an Time value from a fraction of seconds, given as rational number.

An example would be to the time unit of a framerate.

Definition at line 135 of file time.cpp.

References TimeValue::buildRaw_().

+ Here is the call graph for this function:

◆ Time() [2/2]

Time ( long  millis,
uint  secs,
uint  mins = 0,
uint  hours = 0 
)

convenience constructor to build an internal Lumiera Time value from the usual parts of an sexagesimal time specification.

Arbitrary integral values are acceptable and will be summed up accordingly. The minute and hour part can be omitted.

Warning
internal Lumiera time values refer to an implementation dependent time origin/scale. The given value will be used as-is, without any further adjustments.

Definition at line 122 of file time.cpp.

Member Function Documentation

◆ operator std::string()

operator std::string ( ) const

diagnostics

Member Data Documentation

◆ MAX

+ Inheritance diagram for Time:
+ Collaboration diagram for Time:

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