A one-shot, resettable handle to trigger a callback at a later time.
More...
#include <alarm.h>
A one-shot, resettable handle to trigger a callback at a later time.
- Note
- All members of Alarm are threadsafe
-
All members of Alarm are safe to call from the Alarm's callback
Enumerator |
---|
pending |
Will trigger the callback at some point in the future.
|
cancelled |
The callback has been cancelled before being triggered.
|
triggered |
The callback has been called.
|
mir::time::Alarm::Alarm |
( |
| ) |
|
|
default |
virtual mir::time::Alarm::~Alarm |
( |
| ) |
|
|
virtualdefault |
- Note
- Destruction of the Alarm guarantees that the callback will not subsequently be called
mir::time::Alarm::Alarm |
( |
Alarm const & |
| ) |
|
|
delete |
virtual bool mir::time::Alarm::cancel |
( |
| ) |
|
|
pure virtual |
Cancels a pending alarm.
- Note
- Has no effect if the Alarm is in the Triggered state.
-
cancel() is idempotent
- Returns
- True iff the state of the Alarm is now Cancelled
Alarm& mir::time::Alarm::operator= |
( |
Alarm const & |
| ) |
|
|
delete |
virtual bool mir::time::Alarm::reschedule_for |
( |
Timestamp |
timeout | ) |
|
|
pure virtual |
Reschedule the alarm.
- Parameters
-
timeout | Time point when the alarm should be triggered |
- Returns
- True if this reschedule supersedes a previous not-yet-triggered timeout
- Note
- This cancels any previous timeout set.
virtual bool mir::time::Alarm::reschedule_in |
( |
std::chrono::milliseconds |
delay | ) |
|
|
pure virtual |
Reschedule the alarm.
- Parameters
-
delay | Delay, in milliseconds, before the Alarm will be triggered |
- Returns
- True if this reschedule supersedes a previous not-yet-triggered timeout
- Note
- This cancels any previous timeout set.
virtual State mir::time::Alarm::state |
( |
| ) |
const |
|
pure virtual |
The documentation for this class was generated from the following file:
Copyright © 2012-2016 Canonical Ltd.
Generated on Wed May 10 10:41:27 UTC 2017