Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
honey::TimePoint< Clock_, Dur > Class Template Reference

TimePoint represented by a duration since a clock's epoch time. More...

#include <TimePoint.h>

Public Types

typedef Clock_ Clock
 
typedef Dur Duration
 

Public Member Functions

constexpr TimePoint ()
 Initialized to zero time, the clock's epoch. More...
 
constexpr TimePoint (const Duration &d)
 Construct with a duration from clock's epoch. More...
 
template<class Dur2 >
constexpr TimePoint (const TimePoint< Clock, Dur2 > &t)
 Construct from a time point with the same clock but different duration. More...
 
template<class Clock2 , class Dur2 >
 TimePoint (const TimePoint< Clock2, Dur2 > &t)
 Construct from a different clock. More...
 
template<class Dur2 >
TimePointoperator= (const TimePoint< Clock, Dur2 > &rhs)
 
template<class Clock2 , class Dur2 >
TimePointoperator= (const TimePoint< Clock2, Dur2 > &rhs)
 
TimePointoperator+= (const Duration &rhs)
 
TimePointoperator-= (const Duration &rhs)
 
template<class Dur2 >
constexpr bool operator== (const TimePoint< Clock, Dur2 > &rhs) const
 
template<class Dur2 >
constexpr bool operator!= (const TimePoint< Clock, Dur2 > &rhs) const
 
template<class Dur2 >
constexpr bool operator< (const TimePoint< Clock, Dur2 > &rhs) const
 
template<class Dur2 >
constexpr bool operator> (const TimePoint< Clock, Dur2 > &rhs) const
 
template<class Dur2 >
constexpr bool operator<= (const TimePoint< Clock, Dur2 > &rhs) const
 
template<class Dur2 >
constexpr bool operator>= (const TimePoint< Clock, Dur2 > &rhs) const
 
constexpr Duration time () const
 Get duration since clock epoch time. More...
 

Static Public Member Functions

static constexpr TimePoint min ()
 Minimum time point (negative duration) More...
 
static constexpr TimePoint max ()
 Maximum time point (positive duration) More...
 

Friends

class TimePoint
 

Related Functions

(Note that these are not member functions.)

TimePoint operators
template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator+ (const TimePoint< Clock, Dur > &lhs, const Duration< Rep, Period > &rhs)
 operator+(TimePoint, Duration). Returns a time point of best-fit duration. More...
 
template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator+ (const Duration< Rep, Period > &lhs, const TimePoint< Clock, Dur > &rhs)
 operator+(Duration, TimePoint). Returns a time point of best-fit duration. More...
 
template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator- (const TimePoint< Clock, Dur > &lhs, const Duration< Rep, Period > &rhs)
 operator-(TimePoint, Duration). Returns a time point of best-fit duration. More...
 
template<class Clock , class Dur , class Dur2 , class DurCommon = typename std::common_type<Dur, Dur2>::type>
constexpr DurCommon operator- (const TimePoint< Clock, Dur > &lhs, const TimePoint< Clock, Dur2 > &rhs)
 operator-(TimePoint, TimePoint). Returns a best-fit duration. More...
 

Detailed Description

template<class Clock_, class Dur = typename Clock_::Duration>
class honey::TimePoint< Clock_, Dur >

TimePoint represented by a duration since a clock's epoch time.

Member Typedef Documentation

template<class Clock_, class Dur = typename Clock_::Duration>
typedef Clock_ honey::TimePoint< Clock_, Dur >::Clock
template<class Clock_, class Dur = typename Clock_::Duration>
typedef Dur honey::TimePoint< Clock_, Dur >::Duration

Constructor & Destructor Documentation

template<class Clock_, class Dur = typename Clock_::Duration>
constexpr honey::TimePoint< Clock_, Dur >::TimePoint ( )
inline

Initialized to zero time, the clock's epoch.

template<class Clock_, class Dur = typename Clock_::Duration>
constexpr honey::TimePoint< Clock_, Dur >::TimePoint ( const Duration d)
inlineexplicit

Construct with a duration from clock's epoch.

template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr honey::TimePoint< Clock_, Dur >::TimePoint ( const TimePoint< Clock, Dur2 > &  t)
inline

Construct from a time point with the same clock but different duration.

template<class Clock_, class Dur = typename Clock_::Duration>
template<class Clock2 , class Dur2 >
honey::TimePoint< Clock_, Dur >::TimePoint ( const TimePoint< Clock2, Dur2 > &  t)
inline

Construct from a different clock.

Member Function Documentation

template<class Clock_, class Dur = typename Clock_::Duration>
static constexpr TimePoint honey::TimePoint< Clock_, Dur >::max ( )
inlinestatic

Maximum time point (positive duration)

template<class Clock_, class Dur = typename Clock_::Duration>
static constexpr TimePoint honey::TimePoint< Clock_, Dur >::min ( )
inlinestatic

Minimum time point (negative duration)

template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator!= ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
TimePoint& honey::TimePoint< Clock_, Dur >::operator+= ( const Duration rhs)
inline
template<class Clock_, class Dur = typename Clock_::Duration>
TimePoint& honey::TimePoint< Clock_, Dur >::operator-= ( const Duration rhs)
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator< ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator<= ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
TimePoint& honey::TimePoint< Clock_, Dur >::operator= ( const TimePoint< Clock, Dur2 > &  rhs)
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Clock2 , class Dur2 >
TimePoint& honey::TimePoint< Clock_, Dur >::operator= ( const TimePoint< Clock2, Dur2 > &  rhs)
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator== ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator> ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
template<class Dur2 >
constexpr bool honey::TimePoint< Clock_, Dur >::operator>= ( const TimePoint< Clock, Dur2 > &  rhs) const
inline
template<class Clock_, class Dur = typename Clock_::Duration>
constexpr Duration honey::TimePoint< Clock_, Dur >::time ( ) const
inline

Get duration since clock epoch time.

Friends And Related Function Documentation

template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator+ ( const TimePoint< Clock, Dur > &  lhs,
const Duration< Rep, Period > &  rhs 
)
related

operator+(TimePoint, Duration). Returns a time point of best-fit duration.

template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator+ ( const Duration< Rep, Period > &  lhs,
const TimePoint< Clock, Dur > &  rhs 
)
related

operator+(Duration, TimePoint). Returns a time point of best-fit duration.

template<class Clock , class Dur , class Rep , class Period , class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
constexpr TimeCommon operator- ( const TimePoint< Clock, Dur > &  lhs,
const Duration< Rep, Period > &  rhs 
)
related

operator-(TimePoint, Duration). Returns a time point of best-fit duration.

template<class Clock , class Dur , class Dur2 , class DurCommon = typename std::common_type<Dur, Dur2>::type>
constexpr DurCommon operator- ( const TimePoint< Clock, Dur > &  lhs,
const TimePoint< Clock, Dur2 > &  rhs 
)
related

operator-(TimePoint, TimePoint). Returns a best-fit duration.

template<class Clock_, class Dur = typename Clock_::Duration>
friend class TimePoint
friend

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