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

Sensor for one-time only callbacks when the application is idle. More...

#include <Inventor/sensors/SoIdleSensor.h>

+ Inheritance diagram for SoIdleSensor:

Public Member Functions

 SoIdleSensor ()
 Default constructor.
 
 SoIdleSensor (SoSensorCB *func, void *data)
 Constructor that takes the callback function and data to be called when the sensor is triggered.
 
virtual ~SoIdleSensor ()
 Destroys the sensor, freeing up any memory associated with it after unscheduling it.
 
- Public Member Functions inherited from SoDelayQueueSensor
 SoDelayQueueSensor ()
 Constructor.
 
 SoDelayQueueSensor (SoSensorCB *func, void *data)
 Constructor that takes standard callback and data.
 
void setPriority (uint32_t pri)
 Sets the priority of the sensor.
 
uint32_t getPriority () const
 Gets the priority of the sensor.
 
virtual void schedule ()
 If this sensor's priority is non-zero, adds this sensor to the list of delay queue sensors ready to be triggered.
 
virtual void unschedule ()
 If this sensor is scheduled, removes it from the delay 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.
 
- Static Public Member Functions inherited from SoDelayQueueSensor
static uint32_t getDefaultPriority ()
 Returns the default delay queue sensor priority, which is 100.
 

Detailed Description

Sensor for one-time only callbacks when the application is idle.

An idle sensor is almost exactly like an SoOneShotSensor, except that it is only triggered when there are no timer queue sensors waiting to be triggered and there are no events waiting to be processed; that is, idle sensors will not be triggered if the delay queue is processed because the delay queue timeout expires. If the delay queue timeout is disabled (see SoDB::setDelaySensorTimeout().), idle and one-shot sensors are exactly the same.

Note that idle sensors do not reschedule themselves. Inventor 1 idle sensors were always scheduled; call schedule() in the callback to duplicate that behavior.

See the SoOneShotSensor manual page for more information.

SEE ALSO

SoOneShotSensor, SoDelayQueueSensor

Definition at line 81 of file SoIdleSensor.h.

Constructor & Destructor Documentation

◆ SoIdleSensor() [1/2]

SoIdleSensor::SoIdleSensor ( )

Default constructor.

◆ SoIdleSensor() [2/2]

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

Constructor that takes the callback function and data to be called when the sensor is triggered.

◆ ~SoIdleSensor()

virtual SoIdleSensor::~SoIdleSensor ( )
virtual

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


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