Open Inventor Reference
SoTimerQueueSensor Class Reference

Abstract base class for sensors dependent on time. More...

#include <Inventor/sensors/SoTimerQueueSensor.h>

Inheritance diagram for SoTimerQueueSensor:
SoSensor SoAlarmSensor SoTimerSensor

List of all members.

Public Member Functions

 SoTimerQueueSensor ()
 Constructors. The second form takes standard callback function and data.
 SoTimerQueueSensor (SoSensorCB *func, void *data)
virtual ~SoTimerQueueSensor ()
 Destructor.
const SbTimegetTriggerTime () const
 Returns the time at which this sensor is scheduled to be triggered.
virtual void schedule ()
 Adds this sensor to the timer queue.
virtual void unschedule ()
 If this sensor is scheduled, removes it from the timer queue so that it will not be triggered.
virtual SbBool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in the timer queue to be triggered.

Protected Member Functions

void setTriggerTime (const SbTime &time)
 Used by subclasses to set the time at which the sensor is to be triggered.
virtual void trigger ()
 Triggers the sensor, calling its callback function.

Protected Attributes

SbBool scheduled
 Whether sensor is scheduled.

Detailed Description

Timer queue sensors are sensors that trigger themselves at specific times. The timer queue is normally processed as part of a programs main loop when the program is not busy doing something else. Note that processing the timer queue is not asynchronous em the program must re-enter its main loop for timers to be triggered. When the timer queue is processed, all timers scheduled to go off at or before the current time are triggered once, in order from earliest to latest.

See Also
SoTimerSensor, SoAlarmSensor, SoIdleSensor, SoOneShotSensor, SoDataSensor

Definition at line 85 of file SoTimerQueueSensor.h.


Constructor & Destructor Documentation

SoTimerQueueSensor::SoTimerQueueSensor ( )
SoTimerQueueSensor::SoTimerQueueSensor ( SoSensorCB func,
void *  data 
)
virtual SoTimerQueueSensor::~SoTimerQueueSensor ( ) [virtual]

Member Function Documentation

const SbTime& SoTimerQueueSensor::getTriggerTime ( ) const [inline]

If the sensor is not scheduled the results are undefined.

Definition at line 97 of file SoTimerQueueSensor.h.

virtual SbBool SoTimerQueueSensor::isScheduled ( ) const [virtual]

Implements SoSensor.

virtual void SoTimerQueueSensor::schedule ( ) [virtual]

Subclasses provide methods for setting when the sensor will be triggered.

Implements SoSensor.

Reimplemented in SoAlarmSensor, and SoTimerSensor.

void SoTimerQueueSensor::setTriggerTime ( const SbTime time) [protected]
virtual void SoTimerQueueSensor::trigger ( ) [protected, virtual]

This overrides the method in SoSensor because it has to reset the schedule flag before triggering.

Reimplemented from SoSensor.

virtual void SoTimerQueueSensor::unschedule ( ) [virtual]

Implements SoSensor.

Reimplemented in SoTimerSensor.


Member Data Documentation

Definition at line 119 of file SoTimerQueueSensor.h.


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