Public Types | Public Member Functions | Friends | List of all members
TimeDelta Class Reference

Represents an interval of time within a single slab. More...

#include <Time.hpp>

Public Types

using rational_t = Time::rational_t
 

Public Member Functions

 TimeDelta () noexcept
 Default constructor gives an invalid TimeDelta.
 
 TimeDelta (Slab slab, rational_t fraction) noexcept
 An interval covering a given fraction of the slab.
 
TimeDelta with_slab (const Slab &new_slab) const noexcept
 Move the interval to a different slab. The resulting interval will in general not be the same length, but will take up the same fraction of its slab.
 
Slab slab () const noexcept
 
rational_t fraction () const noexcept
 
double value () const noexcept
 Approximate numerical length of the interval.
 
bool is_positive () const noexcept
 Test if the interval is oriented towards larger time.
 
TimeDeltaoperator+= (const TimeDelta &other) noexcept
 
TimeDeltaoperator-= (const TimeDelta &other) noexcept
 
TimeDelta operator+ () const noexcept
 
TimeDelta operator- () const noexcept
 
TimeDeltaoperator*= (const rational_t &mult) noexcept
 
TimeDeltaoperator/= (const rational_t &div) noexcept
 
void pup (PUP::er &p) noexcept
 

Friends

class Time
 

Detailed Description

Represents an interval of time within a single slab.


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