libcaf  0.15.3
Public Member Functions | Public Attributes | Related Functions | List of all members
caf::duration Class Reference

Time duration consisting of a time_unit and a 64 bit unsigned integer. More...

#include <duration.hpp>

Public Member Functions

constexpr duration (time_unit u, uint32_t v)
 
constexpr duration (infinite_t)
 
template<class Rep , class Period , class E = typename std::enable_if< std::is_integral<Rep>::value && get_time_unit_from_period<Period>() != time_unit::invalid >::type>
 duration (const std::chrono::duration< Rep, Period > &d)
 Creates a new instance from an STL duration. More...
 
constexpr bool valid () const
 Returns unit != time_unit::invalid.
 
constexpr bool is_zero () const
 Returns count == 0.
 

Public Attributes

time_unit unit
 
uint64_t count
 

Related Functions

(Note that these are not member functions.)

enum  time_unit : uint32_t
 SI time units to specify timeouts.
 
template<class Period >
constexpr time_unit get_time_unit_from_period ()
 Converts an STL time period to a time_unit.
 
template<class Inspector >
Inspector::result_type inspect (Inspector &f, duration &x)
 
std::string to_string (const duration &x)
 
bool operator== (const duration &lhs, const duration &rhs)
 
bool operator!= (const duration &lhs, const duration &rhs)
 
template<class Clock , class Duration >
std::chrono::time_point< Clock, Duration > & operator+= (std::chrono::time_point< Clock, Duration > &lhs, const duration &rhs)
 

Detailed Description

Time duration consisting of a time_unit and a 64 bit unsigned integer.

Constructor & Destructor Documentation

template<class Rep , class Period , class E = typename std::enable_if< std::is_integral<Rep>::value && get_time_unit_from_period<Period>() != time_unit::invalid >::type>
caf::duration::duration ( const std::chrono::duration< Rep, Period > &  d)
explicit

Creates a new instance from an STL duration.

Exceptions
std::invalid_argumentThrown if `d.count() is negative.

Friends And Related Function Documentation

template<class Inspector >
Inspector::result_type inspect ( Inspector &  f,
duration x 
)
related
bool operator!= ( const duration lhs,
const duration rhs 
)
related
template<class Clock , class Duration >
std::chrono::time_point< Clock, Duration > & operator+= ( std::chrono::time_point< Clock, Duration > &  lhs,
const duration rhs 
)
related
bool operator== ( const duration lhs,
const duration rhs 
)
related
std::string to_string ( const duration x)
related

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