Public Types | |
typedef std::chrono::steady_clock | Clock |
Public Member Functions | |
template<class Rep , class Period > | |
CancelablePromise< void > | promiseFor (std::chrono::duration< Rep, Period > const &duration) noexcept |
virtual CancelablePromise< void > | promiseUntil (Clock::time_point const &timePoint) noexcept=0 |
Detailed Description
It can be used for example as timeouts implementation. Derivering form this class could be usefull if you wnat provide own implementation related to timer management or to create mocks or stubs for testing purposes.
- Remarks
- is abstract class
- use steady clock
- See also
- rili::service::Time
- rili::Promise
Member Typedef Documentation
typedef std::chrono::steady_clock rili::service::TimeBase::Clock |
define type of clock used by Time related services.
Member Function Documentation
|
inlinenoexcept |
This function return rili::CancelablePromise<void> which will be resolved when time(from duration
) elapse.
If promise will be canceled resources related to timer will be released. Implementation of this method depends on implementation of promiseUntil.
- Remarks
- if promise will be canceled resources related to timer will be released.
- is thread safe.
- See also
- rili::CancalablePromise<void>
- promiseUntil
- Parameters
-
duration points how much time should elapse until returned promise will be resolved
- Returns
- rili::CancelablePromise<void> which will be resolved after given in duration time
|
pure virtualnoexcept |
promiseUntil is pure virtual method intended to be interface for Time related services.
Derived class should provide implementation, which will resolved returned promise exactly at given time point ar as soon as possible after it.
- Note
- It is expected that implementation of this method in derived should be thread safe.
- Parameters
-
timePoint defines moment after which returned promise should be resolved.
- Returns
- rili::CancelablePromise<void> which will be resolved in given timePoint.
- See also
- promiseFor
Implemented in rili::service::Time.
The documentation for this class was generated from the following file:
- rili/service/Time.hpp