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
§ State
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.
|
§ Alarm() [1/2]
mir::time::Alarm::Alarm |
( |
| ) |
|
|
default |
§ ~Alarm()
virtual mir::time::Alarm::~Alarm |
( |
| ) |
|
|
virtualdefault |
- Note
- Destruction of the Alarm guarantees that the callback will not subsequently be called
§ Alarm() [2/2]
mir::time::Alarm::Alarm |
( |
Alarm const & |
| ) |
|
|
delete |
§ cancel()
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
§ operator=()
Alarm& mir::time::Alarm::operator= |
( |
Alarm const & |
| ) |
|
|
delete |
§ reschedule_for()
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.
§ reschedule_in()
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.
§ state()
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 Sat Dec 3 12:48:59 UTC 2016