openikev2::Alarm Class Reference

This class represents an Alarm used to receive programmed events. More...

#include <alarm.h>

List of all members.

Public Member Functions

 Alarm (Alarmable &alarmable, uint32_t msec_total)
 Creates a new Alarm, setting the receiver of the notification and the total Alarm time.
virtual void reset ()
 Resets the count down and enables the Alarm.
virtual void disable ()
 Disables the alarm.
virtual void setTime (uint32_t milliseconds)
 Sets the alarm total time.
virtual uint32_t getTotalTime () const
 Returns the total time of the Alarm.
virtual ~Alarm ()
 Deletes alarm.

Protected Member Functions

virtual void notifyAlarmable ()
 Notifies alarm timeout to the receiver of the event.

Protected Attributes

bool enabled
 Indicates if this alarm must notify to the Alarmable object when its time expires.
auto_ptr< Mutexmutex
 Mutex used to protect Alarm accesses.
Alarmablealarmable
 Alarmable object to be notified.
int64_t msec_total
 Total time of the Alarm (in milliseconds).This time is used when the Alarm is reseted.
int64_t msec_left
 Remainig time of the Alarm (in milliseconds).

Friends

class AlarmControllerImpl


Detailed Description

This class represents an Alarm used to receive programmed events.

Author:
Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj.fernandez@dif.um.es, alejandro_perez@dif.um.es>


Constructor & Destructor Documentation

openikev2::Alarm::Alarm ( Alarmable alarmable,
uint32_t  msec_total 
)

Creates a new Alarm, setting the receiver of the notification and the total Alarm time.

Parameters:
alarmable Receiver of the alarm notification
msec_total Total time of the alarm (in milliseconds)


Member Function Documentation

void openikev2::Alarm::disable (  )  [virtual]

Disables the alarm.

It will not alarm the Alarmable when the count down finishes.

void openikev2::Alarm::setTime ( uint32_t  milliseconds  )  [virtual]

Sets the alarm total time.

Parameters:
milliseconds Total time in milliseconds.

uint32_t openikev2::Alarm::getTotalTime (  )  const [virtual]

Returns the total time of the Alarm.

Returns:
The total time of the Alarm (in milliseconds)


Generated on Fri Jul 27 11:04:48 2007 for libopenikev2 by  doxygen 1.5.1