openMSX
Public Member Functions | Protected Member Functions | Friends | List of all members
openmsx::Alarm Class Referenceabstract

#include <Alarm.hh>

Inheritance diagram for openmsx::Alarm:
Inheritance graph
[legend]
Collaboration diagram for openmsx::Alarm:
Collaboration graph
[legend]

Public Member Functions

void schedule (unsigned period)
 Arrange for the alarm() method to be called after some time. More...
 
void cancel ()
 Cancel a previous schedule() request. More...
 
bool pending () const
 Is there a pending alarm? More...
 

Protected Member Functions

 Alarm ()
 
virtual ~Alarm ()
 
void prepareDelete ()
 Concrete subclasses MUST call this method in their destructor. More...
 

Friends

class AlarmManager
 

Detailed Description

Definition at line 11 of file Alarm.hh.

Constructor & Destructor Documentation

openmsx::Alarm::Alarm ( )
protected

Definition at line 201 of file Alarm.cc.

References openmsx::AlarmManager::registerAlarm().

openmsx::Alarm::~Alarm ( )
protectedvirtual

Definition at line 209 of file Alarm.cc.

Member Function Documentation

void openmsx::Alarm::cancel ( )

Cancel a previous schedule() request.

It's ok to call cancel(), when there is no pending alarm.

Definition at line 226 of file Alarm.cc.

References openmsx::AlarmManager::stop().

bool openmsx::Alarm::pending ( ) const

Is there a pending alarm?

Definition at line 231 of file Alarm.cc.

References openmsx::AlarmManager::isPending().

void openmsx::Alarm::prepareDelete ( )
protected

Concrete subclasses MUST call this method in their destructor.

This makes sure the timer thread is not executing the alarm() method (or will not execute it while this object is being destroyed).

Definition at line 214 of file Alarm.cc.

References openmsx::AlarmManager::unregisterAlarm().

Referenced by openmsx::AfterRealTimeCmd::~AfterRealTimeCmd(), openmsx::AlarmEvent::~AlarmEvent(), and openmsx::PollEventGenerator::~PollEventGenerator().

void openmsx::Alarm::schedule ( unsigned  period)

Arrange for the alarm() method to be called after some time.

It's allowed to call this method when this Alarm was already scheduled. In that case the previous request is lost.

Parameters
periodDuration of the time in microseconds (us).

Definition at line 221 of file Alarm.cc.

References openmsx::AlarmManager::start().

Referenced by openmsx::AfterRealTimeCmd::AfterRealTimeCmd(), and openmsx::PollEventGenerator::pollNow().

Friends And Related Function Documentation

friend class AlarmManager
friend

Definition at line 57 of file Alarm.hh.


The documentation for this class was generated from the following files: