Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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 582 of file timevalue.hpp.

Static Public Attributes

static const TimeSpan ALL {Time::MIN, Duration::MAX}
 
- Static Public Attributes inherited from Time
static const Time MAX
 
static const Time MIN
 
static const Time ZERO
 
static const Time ANYTIME
 border condition marker value. ANYTIME <= any time value
 
static const Time NEVER
 border condition marker value. NEVER >= any time value
 
- 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.
 

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)
 
 TimeSpan ()
 
TimeSpan conform () const
 <
 
Durationduration ()
 
Duration duration () const
 
Time start () const
 
Time end () const
 
bool contains (TimeValue const &tp) const
 
void accept (Mutation const &)
 may change start / duration
 
 operator std::string () const
 
std::strong_ordering operator<=> (TimeSpan const &ts) const
 Supporting extended strong total ordering, based on start and interval length.
 
bool operator== (TimeSpan const &ts) const =default
 
- Public Member Functions inherited from Time
 Time (TimeValue const &val=TimeValue(0))
 
 Time (FSecs const &fractionalSeconds)
 convenience constructor to build an Time value from a fraction of seconds, given as rational number.
 
 Time (Time const &)=default
 
 Time (TimeVar const &calcResult)
 
 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.
 
 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 (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
 

Private Attributes

Duration dur_
 

Additional Inherited Members

- 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

◆ TimeSpan() [1/5]

TimeSpan ( TimeValue const &  start,
Duration const &  length 
)
inline

Definition at line 588 of file timevalue.hpp.

◆ TimeSpan() [2/5]

TimeSpan ( TimeValue const &  start,
FSecs(duration_in_secs)   
)
inline

Definition at line 593 of file timevalue.hpp.

◆ TimeSpan() [3/5]

TimeSpan ( TimeValue const &  start,
TimeValue const &  end 
)
inline

Definition at line 598 of file timevalue.hpp.

◆ TimeSpan() [4/5]

TimeSpan ( TimeValue const &  start,
Offset const &  reference_distance 
)
inline

Definition at line 603 of file timevalue.hpp.

◆ TimeSpan() [5/5]

TimeSpan ( )
inline

Definition at line 607 of file timevalue.hpp.

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 778 of file timevalue.hpp.

References TimeValue::_raw, TimeSpan::dur_, Time::MAX, and TimeSpan::start().

+ Here is the call graph for this function:

◆ duration() [1/2]

◆ duration() [2/2]

Duration duration ( ) const
inline

Definition at line 622 of file timevalue.hpp.

References TimeSpan::dur_.

◆ start()

◆ end()

Time end ( ) const
inline

Definition at line 634 of file timevalue.hpp.

References TimeSpan::dur_.

Referenced by Segment::after(), TimeValue_test::buildTimeSpan(), TimeValue_test::compareTimeSpan(), TimeSpan::contains(), ZoomWindow::expandVisibleRange(), ZoomWindow::mutateCanvas(), ZoomWindow::mutateRanges(), ZoomWindow::mutateWindow(), GenNode_test::objectShortcut(), and TimeValue_test::relateTimeIntervals().

+ Here is the caller graph for this function:

◆ contains()

bool contains ( TimeValue const &  tp) const
inline

Definition at line 640 of file timevalue.hpp.

References TimeSpan::end().

Referenced by TimeValue_test::relateTimeIntervals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accept()

void accept ( Mutation const &  muta)
inline

may change start / duration

Definition at line 123 of file mutation.hpp.

References Mutation::change().

Referenced by TimeMutation_test::mutate_by_Increment(), TimeMutation_test::mutate_by_Offset(), TimeMutation_test::mutate_by_Value(), TimeMutation_test::mutate_quantised(), and TimeControl_test::verifyBasics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator std::string()

operator std::string ( ) const
explicit

diagnostics

◆ operator<=>()

std::strong_ordering operator<=> ( TimeSpan const &  ts) const
inline

Supporting extended strong total ordering, based on start and interval length.

Definition at line 653 of file timevalue.hpp.

References TimeSpan::dur_, and TimeValue::t_.

◆ operator==()

bool operator== ( TimeSpan const &  ts) const
default

Member Data Documentation

◆ dur_

◆ ALL

const TimeSpan ALL {Time::MIN, Duration::MAX}
static

Definition at line 613 of file timevalue.hpp.

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

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