Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bslmt::ChronoUtil Struct Reference

#include <bslmt_chronoutil.h>

List of all members.

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.

See Component bslmt_chronoutil


Member Function Documentation

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

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.

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

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

template<class PRIMITIVE , class CLOCK , class DURATION >
static 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.

template<class PRIMITIVE , class ARG_TYPE , class CLOCK , class DURATION >
static 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.


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