Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoTimerQueueSensor Class Reference

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

#include <Inventor/sensors/SoTimerQueueSensor.h>

+ Inheritance diagram for SoTimerQueueSensor:

Public Member Functions

 SoTimerQueueSensor ()
 Constructor.
 
 SoTimerQueueSensor (SoSensorCB *func, void *data)
 Constructor that takes standard callback function and data.
 
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.
 
- Public Member Functions inherited from SoSensor
 SoSensor ()
 Constructor.
 
 SoSensor (SoSensorCB *f, void *d)
 Constructor that takes standard callback function and data.
 
void setFunction (SoSensorCB *f, void *userData)
 
void setFunction (SoSensorCB *f)
 Sets the callback function that is called when the sensor is triggered.
 
void setData (void *d)
 Sets the callback data passed to the callback function.
 
SoSensorCBgetFunction () const
 Returns the callback that will be called when the sensor is triggered.
 
void * getData () const
 Returns the user-supplied pointer that will be passed to the callback function.
 
virtual SbBool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered.
 

Additional Inherited Members

- Public Types inherited from SoSensor
typedef void SoSensorCB(void *data, SoSensor *sensor)
 This typedef defines the calling sequence for all callbacks from sensors.
 

Detailed Description

Abstract base class for sensors dependent on time.

Timer queue sensors are sensors that trigger themselves at specific times. The timer queue is normally processed as part of a program's main loop when the program is not busy doing something else. Note that processing the timer queue is not asynchronous - 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 80 of file SoTimerQueueSensor.h.

Constructor & Destructor Documentation

◆ SoTimerQueueSensor() [1/2]

SoTimerQueueSensor::SoTimerQueueSensor ( )

Constructor.

◆ SoTimerQueueSensor() [2/2]

SoTimerQueueSensor::SoTimerQueueSensor ( SoSensorCB func,
void *  data 
)

Constructor that takes standard callback function and data.

Member Function Documentation

◆ getTriggerTime()

const SbTime & SoTimerQueueSensor::getTriggerTime ( ) const
inline

Returns the time at which this sensor is scheduled to be triggered.

If the sensor is not scheduled the results are undefined.

Definition at line 101 of file SoTimerQueueSensor.h.

◆ schedule()

virtual void SoTimerQueueSensor::schedule ( )
virtual

Adds this sensor to the timer queue.

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

Implements SoSensor.

Reimplemented in SoAlarmSensor, and SoTimerSensor.

◆ unschedule()

virtual void SoTimerQueueSensor::unschedule ( )
virtual

If this sensor is scheduled, removes it from the timer queue so that it will not be triggered.

Implements SoSensor.

Reimplemented in SoTimerSensor.


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