Open Inventor Reference
SoAlarmSensor Class Reference

Triggers a callback once sometime in the future. More...

#include <Inventor/sensors/SoAlarmSensor.h>

Inheritance diagram for SoAlarmSensor:
SoTimerQueueSensor SoSensor

Public Member Functions

 SoAlarmSensor ()
 Creation methods. More...
 
 SoAlarmSensor (SoSensorCB *func, void *data)
 Creation methods. More...
 
virtual ~SoAlarmSensor ()
 Destroys the sensor, freeing up any memory associated with it after unscheduling it. More...
 
void setTime (const SbTime &absTime)
 Sets the sensor to go off at the specified time. More...
 
void setTimeFromNow (const SbTime &relTime)
 Sets the sensor to go off the given amount of time from now. More...
 
const SbTimegetTime () const
 Returns the time the sensor is scheduled to be triggered. More...
 
virtual void schedule ()
 Overrides the regular schedule() method because we have to set up the trigger time first. More...
 
- Public Member Functions inherited from SoTimerQueueSensor
 SoTimerQueueSensor ()
 Constructors. The second form takes standard callback function and data. More...
 
 SoTimerQueueSensor (SoSensorCB *func, void *data)
 
virtual ~SoTimerQueueSensor ()
 Destructor. More...
 
const SbTimegetTriggerTime () const
 Returns the time at which this sensor is scheduled to be triggered. More...
 
virtual void unschedule ()
 If this sensor is scheduled, removes it from the timer queue so that it will not be triggered. More...
 
virtual bool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in the timer queue to be triggered. More...
 
- Public Member Functions inherited from SoSensor
 SoSensor ()
 Constructors. The second form takes callback function and data. More...
 
 SoSensor (SoSensorCB *f, void *d)
 
virtual ~SoSensor ()
 Virtual destructor so that subclasses are deleted properly. More...
 
void setFunction (SoSensorCB *f)
 Sets the callback function that is called when the sensor is triggered. More...
 
void setData (void *d)
 Sets the callback data passed to the callback function. More...
 
SoSensorCBgetFunction () const
 Returns the callback function that will be called when the sensor is triggered. More...
 
void * getData () const
 Returns the user-supplied pointer that will be passed to the callback function. More...
 
void setNextInQueue (SoSensor *next)
 Sets/returns the next sensor in whichever queue the sensor is in. More...
 
SoSensorgetNextInQueue () const
 

Additional Inherited Members

- Static Public Member Functions inherited from SoSensor
static void initClass ()
 Initialize static members, etc. More...
 
- Protected Member Functions inherited from SoTimerQueueSensor
void setTriggerTime (const SbTime &time)
 Used by subclasses to set the time at which the sensor is to be triggered. More...
 
virtual void trigger ()
 Triggers the sensor, calling its callback function. More...
 
- Protected Attributes inherited from SoTimerQueueSensor
bool scheduled
 Whether sensor is scheduled. More...
 
- Protected Attributes inherited from SoSensor
SoSensorCBfunc
 Callback function. More...
 
void * funcData
 Data to pass to callback. More...
 

Detailed Description

This type of sensor can be used to schedule a one-time callback for some time in the future. The sensor is not guaranteed to be called at exactly that time, but will be called sometime after the specified time.

See Also
SoOneShotSensor, SoTimerSensor, SoTimerQueueSensor, SbTime

Definition at line 80 of file SoAlarmSensor.h.

Constructor & Destructor Documentation

◆ SoAlarmSensor() [1/2]

SoAlarmSensor::SoAlarmSensor ( )

The second method takes the callback function and data to be called when the sensor is triggered.

◆ SoAlarmSensor() [2/2]

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

The second method takes the callback function and data to be called when the sensor is triggered.

◆ ~SoAlarmSensor()

virtual SoAlarmSensor::~SoAlarmSensor ( )
virtual

Member Function Documentation

◆ getTime()

const SbTime& SoAlarmSensor::getTime ( ) const
inline

This differs from getTriggerTime() in that this method returns the time the sensor was set to be scheduled, even if it has not yet been scheduled.

Definition at line 113 of file SoAlarmSensor.h.

◆ schedule()

virtual void SoAlarmSensor::schedule ( )
virtual

Reimplemented from SoTimerQueueSensor.

◆ setTime()

void SoAlarmSensor::setTime ( const SbTime absTime)

You must also call schedule() for the sensor to be triggered. If the sensor is already scheduled, it must be unscheduled and then rescheduled for the change in the trigger time to take effect.

◆ setTimeFromNow()

void SoAlarmSensor::setTimeFromNow ( const SbTime relTime)

You must also call schedule() for the sensor to be triggered. If the sensor is already scheduled, it must be unscheduled and then rescheduled for the change in the trigger time to take effect.


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