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

#include "lib/time/timevalue.hpp"

Description

A time interval anchored at a specific point in time.

The start point of this timespan is also its nominal position, and the end point is normalised to happen never before the start point. A TimeSpan is enough to fully specify the temporal properties of an object within the model.

As an exception to the generally immutable Time entities, a non constant TimeSpan may receive mutation messages, both for the start point and the duration. This allows for changing position and length of objects in the timeline.

Todo:
define these mutations

Definition at line 573 of file timevalue.hpp.

Public Member Functions

 TimeSpan (TimeValue const &start, Duration const &length)
 
 TimeSpan (TimeValue const &start, FSecs(duration_in_secs))
 
 TimeSpan (TimeValue const &start, TimeValue const &end)
 
 TimeSpan (TimeValue const &start, Offset const &reference_distance)
 
void accept (Mutation const &)
 may change start / duration
 
TimeSpan conform () const
 < More...
 
bool contains (TimeValue const &tp) const
 
Durationduration ()
 
Duration duration () const
 
Time end () const
 
 operator std::string () const
 
Time start () const
 
- Public Member Functions inherited from Time
 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 TimeSpan ALL {Time::MIN, Duration::MAX}
 
- Static Public Attributes inherited from Time
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.
 

Friends

bool operator< (TimeSpan const &t1, TimeSpan const &t2)
 
bool operator== (TimeSpan const &t1, TimeSpan const &t2)
 Supporting extended total order, based on start and interval length.
 

Private Attributes

Duration dur_
 

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
 

Member Function Documentation

◆ conform()

TimeSpan conform ( ) const
inline

<

Returns
a copy conformed to time domain limits
Note
: implicitly capped to Duration::MAX

Definition at line 762 of file timevalue.hpp.

References TimeValue::_raw, and Time::MAX.

◆ operator std::string()

operator std::string ( ) const

diagnostics

+ Inheritance diagram for TimeSpan:
+ Collaboration diagram for TimeSpan:

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