#include <timer.h>
|
| Timer ()=default |
|
virtual | ~Timer ()=default |
|
virtual std::unique_ptr< Alarm > | notify_in (std::chrono::milliseconds delay, std::function< void()> const &callback)=0 |
| Create an Alarm that calls the callback after the specified delay. More...
|
|
virtual std::unique_ptr< Alarm > | notify_at (Timestamp time_point, std::function< void()> const &callback)=0 |
| Create an Alarm that calls the callback at the specified time. More...
|
|
virtual std::unique_ptr< Alarm > | create_alarm (std::function< void()> const &callback)=0 |
| Create an Alarm that will not fire until scheduled. More...
|
|
virtual std::unique_ptr< Alarm > | create_alarm (std::function< void()> const &callback, std::function< void()> const &lock, std::function< void()> const &unlock)=0 |
| Create an Alarm that will not fire until scheduled. More...
|
|
| Timer (Timer const &)=delete |
|
Timer & | operator= (Timer const &)=delete |
|
mir::time::Timer::Timer |
( |
| ) |
|
|
default |
virtual mir::time::Timer::~Timer |
( |
| ) |
|
|
virtualdefault |
mir::time::Timer::Timer |
( |
Timer const & |
| ) |
|
|
delete |
virtual std::unique_ptr<Alarm> mir::time::Timer::create_alarm |
( |
std::function< void()> const & |
callback | ) |
|
|
pure virtual |
Create an Alarm that will not fire until scheduled.
- Parameters
-
callback | Function to call when the Alarm signals |
- Returns
- A handle to an Alarm that can later be scheduled
Implemented in mir::GLibMainLoop.
virtual std::unique_ptr<Alarm> mir::time::Timer::create_alarm |
( |
std::function< void()> const & |
callback, |
|
|
std::function< void()> const & |
lock, |
|
|
std::function< void()> const & |
unlock |
|
) |
| |
|
pure virtual |
Create an Alarm that will not fire until scheduled.
The lock/unlock functions allow the user to preserve lock ordering in situations where Alarm methods need to be called under external lock and the callback implementation needs to run code protected by the same lock. An alarm implementation may have internal locks of its own, which maybe acquired during callback dispatching; to preserve lock ordering the given lock function will be invoked during callback dispatch before any internal locks are acquired.
- Parameters
-
callback | Function to call when the Alarm signals |
lock | Function called within callback dispatching context before the alarm implementation acquires any internal lock |
unlock | Function called within callback dispatching context after the alarm implementation releases any internal lock |
- Returns
- A handle to an Alarm that can later be scheduled
Implemented in mir::GLibMainLoop.
virtual std::unique_ptr<Alarm> mir::time::Timer::notify_at |
( |
Timestamp |
time_point, |
|
|
std::function< void()> const & |
callback |
|
) |
| |
|
pure virtual |
Create an Alarm that calls the callback at the specified time.
- Parameters
-
time_point | Time point when the alarm should be triggered |
callback | Function to call when the Alarm signals |
- Returns
- A handle to an Alarm that will fire after delay ms.
Implemented in mir::GLibMainLoop.
virtual std::unique_ptr<Alarm> mir::time::Timer::notify_in |
( |
std::chrono::milliseconds |
delay, |
|
|
std::function< void()> const & |
callback |
|
) |
| |
|
pure virtual |
Create an Alarm that calls the callback after the specified delay.
- Parameters
-
delay | Time from now, in milliseconds, that the callback will fire |
callback | Function to call when the Alarm signals |
- Returns
- A handle to an Alarm that will fire after delay ms.
Implemented in mir::GLibMainLoop.
Timer& mir::time::Timer::operator= |
( |
Timer const & |
| ) |
|
|
delete |
The documentation for this class was generated from the following file:
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015