Class DynamicTimeInterval
template <typename Rep, typename Period>
ClassList > DynamicTimeInterval
A flexible time interval class that wraps std::chrono::duration. More...
#include <utilities.h>
Public Types
| Type | Name |
|---|---|
| typedef std::chrono::duration< Rep, Period > | DurationType |
| typedef DurationType::period | period |
| typedef DurationType::rep | rep |
Public Functions
| Type | Name |
|---|---|
| DynamicTimeInterval (const DynamicTimeInterval & other) = default |
|
| constexpr | DynamicTimeInterval (DurationType d) Constructs a DynamicTimeInterval from a std::chrono::duration. |
| constexpr | DynamicTimeInterval (Rep count) Constructs a DynamicTimeInterval from a raw count of ticks. |
| constexpr | DynamicTimeInterval (std::chrono::duration< Orep, Operiod > d) |
| constexpr DynamicTimeInterval< TargetRep, TargetPeriod > | as () const Converts the interval to another representation and period. |
| constexpr Rep | count () const Gets the count of ticks for this interval. |
| constexpr DurationType | get_duration () const Gets the underlying std::chrono::duration object. |
| constexpr uint64_t | microseconds () const Gets the duration in microseconds. |
| constexpr DynamicTimeInterval | operator+ (const DynamicTimeInterval< T, P > & other) |
| constexpr bool | operator> (const DynamicTimeInterval< T, P > & other) |
Detailed Description
This class provides a more dynamic way to handle time intervals, allowing for easier conversions and manipulations.
Template parameters:
RepThe representation type for the duration (e.g., int, double).PeriodThe period of the duration (e.g., std::milli, std::ratio<1>).
Public Types Documentation
typedef DurationType
using DynamicTimeInterval< Rep, Period >::DurationType = std::chrono::duration<Rep, Period>;
typedef period
using DynamicTimeInterval< Rep, Period >::period = DurationType::period;
typedef rep
using DynamicTimeInterval< Rep, Period >::rep = DurationType::rep;
Public Functions Documentation
function DynamicTimeInterval [2/5]
DynamicTimeInterval::DynamicTimeInterval (
const DynamicTimeInterval & other
) = default
function DynamicTimeInterval [3/5]
Constructs a DynamicTimeInterval from a std::chrono::duration.
inline constexpr DynamicTimeInterval::DynamicTimeInterval (
DurationType d
)
function DynamicTimeInterval [4/5]
Constructs a DynamicTimeInterval from a raw count of ticks.
inline constexpr DynamicTimeInterval::DynamicTimeInterval (
Rep count
)
function DynamicTimeInterval [5/5]
template<typename Orep, typename Operiod>
inline constexpr DynamicTimeInterval::DynamicTimeInterval (
std::chrono::duration< Orep, Operiod > d
)
function as
Converts the interval to another representation and period.
template<typename TargetRep, typename TargetPeriod>
inline constexpr DynamicTimeInterval < TargetRep, TargetPeriod > DynamicTimeInterval::as () const
function count
Gets the count of ticks for this interval.
inline constexpr Rep DynamicTimeInterval::count () const
function get_duration
Gets the underlying std::chrono::duration object.
inline constexpr DurationType DynamicTimeInterval::get_duration () const
function microseconds
Gets the duration in microseconds.
inline constexpr uint64_t DynamicTimeInterval::microseconds () const
function operator+
template<typename T, typename P>
inline constexpr DynamicTimeInterval DynamicTimeInterval::operator+ (
const DynamicTimeInterval < T, P > & other
)
function operator>
template<typename T, typename P>
inline constexpr bool DynamicTimeInterval::operator> (
const DynamicTimeInterval < T, P > & other
)
Friends Documentation
friend DynamicTimeInterval [1/5]
template<typename ORep, typename OPeriod>
class DynamicTimeInterval::DynamicTimeInterval (
DynamicTimeInterval
)
The documentation for this class was generated from the following file utilities.h