prophet::Alarm Class Reference

Alarm registration. More...

#include <Alarm.h>

Inheritance diagram for prophet::Alarm:
dtn::ProphetTimer prophet::AlarmImpl

List of all members.

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

Detailed Description

Alarm registration.

Definition at line 68 of file Alarm.h.


Constructor & Destructor Documentation

prophet::Alarm::Alarm ( ExpirationHandler handler  )  [inline]

Constructor.

Definition at line 74 of file Alarm.h.

virtual prophet::Alarm::~Alarm (  )  [inline, virtual]

Destructor.

Definition at line 80 of file Alarm.h.


Member Function Documentation

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.

Referenced by prophet::Encounter::handle_bundle_received(), prophet::Encounter::handle_timeout(), prophet::Encounter::hello_interval_changed(), prophet::Encounter::receive_tlv(), prophet::Controller::shutdown(), and prophet::Encounter::~Encounter().

virtual bool prophet::Alarm::cancelled (  )  const [pure virtual]

Accessors.

Implemented in prophet::AlarmImpl, and dtn::ProphetTimer.

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]
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().


Member Data Documentation

action to perform when alarm expires

Definition at line 111 of file Alarm.h.

Referenced by timeout().


The documentation for this class was generated from the following file:
Generated on Sun Nov 21 11:41:14 2010 for DTN Reference Implementation by  doxygen 1.6.3