#include <Alarm.h>
Public Member Functions | |
Alarm (ExpirationHandler *handler) | |
Constructor. | |
virtual | ~Alarm () |
Destructor. | |
virtual void | schedule (u_int milliseconds)=0 |
How many milliseconds in the future to schedule this alarm. | |
virtual u_int | time_remaining () const =0 |
Milliseconds remaining until alarm expires. | |
virtual void | cancel ()=0 |
Disable the alarm; do not execute the handler. | |
virtual void | timeout () |
Invoke timeout handler. | |
virtual bool | pending () const =0 |
Accessors. | |
virtual bool | cancelled () const =0 |
Accessors. | |
Protected Attributes | |
ExpirationHandler *const | handler_ |
action to perform when alarm expires |
Definition at line 68 of file Alarm.h.
prophet::Alarm::Alarm | ( | ExpirationHandler * | handler | ) | [inline] |
virtual prophet::Alarm::~Alarm | ( | ) | [inline, virtual] |
virtual void prophet::Alarm::cancel | ( | ) | [pure virtual] |
Disable the alarm; do not execute the handler.
It is expected that the host's timer implementation will cleanup a cancelled Alarm's memory ...
Implemented in prophet::AlarmImpl, and dtn::ProphetTimer.
virtual bool prophet::Alarm::cancelled | ( | ) | const [pure virtual] |
virtual bool prophet::Alarm::pending | ( | ) | const [pure virtual] |
virtual void prophet::Alarm::schedule | ( | u_int | milliseconds | ) | [pure virtual] |
How many milliseconds in the future to schedule this alarm.
Implemented in prophet::AlarmImpl, and dtn::ProphetTimer.
virtual u_int prophet::Alarm::time_remaining | ( | ) | const [pure virtual] |
Milliseconds remaining until alarm expires.
Implemented in prophet::AlarmImpl, and dtn::ProphetTimer.
Referenced by prophet::Encounter::time_remaining().
virtual void prophet::Alarm::timeout | ( | ) | [inline, virtual] |
Invoke timeout handler.
It is expected that a successfully executed ExpirationHandler will clean up Alarm's memory
Definition at line 103 of file Alarm.h.
References prophet::ExpirationHandler::handle_timeout(), and handler_.
Referenced by dtn::ProphetTimer::timeout().
ExpirationHandler* const prophet::Alarm::handler_ [protected] |