rili::service::Time Class Referencefinal
Inheritance diagram for rili::service::Time:
[legend]
Collaboration diagram for rili::service::Time:
[legend]

Public Member Functions

CancelablePromise< void > promiseUntil (Clock::time_point const &timePoint) noexceptoverride
 
- Public Member Functions inherited from rili::service::TimeBase
template<class Rep , class Period >
CancelablePromise< void > promiseFor (std::chrono::duration< Rep, Period > const &duration) noexcept
 

Static Public Member Functions

static Timeget () noexcept
 

Additional Inherited Members

- Public Types inherited from rili::service::TimeBase
typedef std::chrono::steady_clock Clock
 

Detailed Description

Give ability to create promises which will be resolved after some time. This can be used for example as timeouts implementation.

Remarks
is non-copyable
Note
create internally single thread which manage all timers
See also
rili::service::TimeBase
rili::CancalablePromise<void>

Member Function Documentation

static Time& rili::service::Time::get ( )
staticnoexcept

Get or create rili::service::Time instance.

New rili::service::Time is created if was not created earlier. If rili::service::Time was created previously return existing instance.

Returns
Instance of rili::service::Time
CancelablePromise<void> rili::service::Time::promiseUntil ( Clock::time_point const &  timePoint)
overridevirtualnoexcept

This function return rili::CancelablePromise<void> which will be resolved as soon as possible after timePoint time moment will be achived.

Remarks
if promise will be canceled resources related to timer will be released.
is thread safe
Parameters
timePointdefines moment after which returned promise should be resolved.
Returns
rili::CancelablePromise<void> which will be resolved in given timePoint.
See also
promiseFor()

Implements rili::service::TimeBase.


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