BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmt::ChronoUtil Struct Reference

#include <bslmt_chronoutil.h>

Static Public Member Functions

template<class REP_TYPE , class PERIOD_TYPE >
static bsls::TimeInterval durationToTimeInterval (const bsl::chrono::duration< REP_TYPE, PERIOD_TYPE > &duration)
 
template<class CLOCK >
static bool isMatchingClock (bsls::SystemClockType::Enum clockType)
 
template<class PRIMITIVE , class CLOCK , class DURATION >
static int timedWait (PRIMITIVE *primitive, const bsl::chrono::time_point< CLOCK, DURATION > &absTime)
 
template<class PRIMITIVE , class ARG_TYPE , class CLOCK , class DURATION >
static int timedWait (PRIMITIVE *primitive, ARG_TYPE *argument, const bsl::chrono::time_point< CLOCK, DURATION > &absTime)
 

Detailed Description

This struct provides a namespace for utility functions that operate on bsl::chrono facilities.

Member Function Documentation

◆ durationToTimeInterval()

template<class REP_TYPE , class PERIOD_TYPE >
bsls::TimeInterval bslmt::ChronoUtil::durationToTimeInterval ( const bsl::chrono::duration< REP_TYPE, PERIOD_TYPE > &  duration)
inlinestatic

Return a bsls::TimeInterval having the value represented by the specified duration. Unlike the implicit conversion defined from duration defined in bsls::TimeInterval, this conversion handles floating-point-based durations as well as integral ones.

◆ isMatchingClock()

template<class CLOCK >
bool bslmt::ChronoUtil::isMatchingClock ( bsls::SystemClockType::Enum  clockType)
inlinestatic

Return true if the specified (template parameter) type CLOCK matches the specified clockType, and false otherwise.

◆ timedWait() [1/2]

template<class PRIMITIVE , class ARG_TYPE , class CLOCK , class DURATION >
int bslmt::ChronoUtil::timedWait ( PRIMITIVE *  primitive,
ARG_TYPE *  argument,
const bsl::chrono::time_point< CLOCK, DURATION > &  absTime 
)
static

Block on the specified primitive object of the (template parameter) PRIMITIVE type by calling its timedWait method, passing the specified argument of the (template parameter) ARG_TYPE and a timeout calculated from the specified absTime. absTime is an absolute time represented by a time point with respect to some epoch, which is determined by the clock associated with the time point. Return 0 on success, PRIMITIVE::e_TIMED_OUT if the absTime timeout expired, and other return values on error. The timedWait method of primitive is called only once if the clock type specified by the (template parameter) type CLOCK corresponds to the clock used by primitive, and may be called more than once otherwise. Note that error codes returned from this method, necessarily distinct from 0 and PRIMITIVE::e_TIMED_OUT, are defined by PRIMITIVE.

◆ timedWait() [2/2]

template<class PRIMITIVE , class CLOCK , class DURATION >
int bslmt::ChronoUtil::timedWait ( PRIMITIVE *  primitive,
const bsl::chrono::time_point< CLOCK, DURATION > &  absTime 
)
static

Block on the specified primitive object of the (template parameter) PRIMITIVE type by calling its timedWait method, passing a timeout calculated from the specified absTime. absTime is an absolute time represented by a time point with respect to some epoch, which is determined by the clock associated with the time point. Return 0 on success, PRIMITIVE::e_TIMED_OUT if the absTime timeout expired, and other return values on error. The timedWait method of primitive is called only once if the clock type specified by the (template parameter) type CLOCK corresponds to the clock used by primitive, and may be called more than once otherwise. Note that error codes returned from this method, necessarily distinct from 0 and PRIMITIVE::e_TIMED_OUT, are defined by PRIMITIVE.


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