Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoAlarmSensor Class Reference

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

#include <Inventor/sensors/SoAlarmSensor.h>

+ Inheritance diagram for SoAlarmSensor:

Public Member Functions

 SoAlarmSensor ()
 Constructor.
 
 SoAlarmSensor (SoSensorCB *func, void *data)
 This constructor takes the callback function and data to be called when the sensor is triggered.
 
virtual ~SoAlarmSensor ()
 Destroys the sensor, freeing up any memory associated with it after unscheduling it.
 
void setTime (const SbTime &absTime)
 Sets the sensor to go off at the specified time.
 
void setTimeFromNow (const SbTime &relTime)
 Sets the sensor to go off the given amount of time from now.
 
const SbTimegetTime () const
 Returns the time at which the sensor is set to be triggered.
 
virtual void schedule ()
 Adds this sensor to the timer queue.
 
- Public Member Functions inherited from SoTimerQueueSensor
 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 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.
 

Detailed Description

Triggers a delegate once sometime in the future.

This type of sensor can be used to schedule a one-time delegate 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 74 of file SoAlarmSensor.h.

Constructor & Destructor Documentation

◆ SoAlarmSensor() [1/2]

SoAlarmSensor::SoAlarmSensor ( )

Constructor.

◆ SoAlarmSensor() [2/2]

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

This constructor takes the callback function and data to be called when the sensor is triggered.

◆ ~SoAlarmSensor()

virtual SoAlarmSensor::~SoAlarmSensor ( )
virtual

Destroys the sensor, freeing up any memory associated with it after unscheduling it.

Member Function Documentation

◆ getTime()

const SbTime & SoAlarmSensor::getTime ( ) const
inline

Returns the time at which the sensor is set to be triggered.

This is similar to the getTriggerTime method, but returns the time even if the sensor has not yet been scheduled.

Definition at line 115 of file SoAlarmSensor.h.

◆ schedule()

virtual void SoAlarmSensor::schedule ( )
virtual

Adds this sensor to the timer queue.

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

Reimplemented from SoTimerQueueSensor.

◆ setTime()

void SoAlarmSensor::setTime ( const SbTime absTime)

Sets the sensor to go off at the specified time.

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)

Sets the sensor to go off the given amount of time from now.

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: