Open Inventor Reference
SoIdleSensor Class Reference

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

#include <Inventor/sensors/SoIdleSensor.h>

Inheritance diagram for SoIdleSensor:
SoDelayQueueSensor SoSensor

Public Member Functions

 SoIdleSensor ()
 Creation methods.
 
 SoIdleSensor (SoSensorCB *func, void *data)
 Creation methods.
 
virtual ~SoIdleSensor ()
 Destroys the sensor, freeing up any memory associated with it after unscheduling it.
 
- Public Member Functions inherited from SoDelayQueueSensor
 SoDelayQueueSensor ()
 Constructors. The second form takes standard callback function and data.
 
 SoDelayQueueSensor (SoSensorCB *func, void *data)
 
virtual ~SoDelayQueueSensor ()
 Destructor.
 
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.
 
virtual bool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in the delay queue to be triggered.
 
virtual bool isIdleOnly () const
 This method is overriden by IdleSensors to tell sensor manager that they should only be processed when there really is idle time (and not when the delay queue timeout expires).
 
void setCounter (uint32_t c)
 Set/inquire counter when sensor was last triggered.
 
uint32_t getCounter () const
 
- Public Member Functions inherited from SoSensor
 SoSensor ()
 Constructors. The second form takes callback function and data.
 
 SoSensor (SoSensorCB *f, void *d)
 
virtual ~SoSensor ()
 Virtual destructor so that subclasses are deleted properly.
 
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 function 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 void schedule ()=0
 Schedules the sensor for triggering at the appropriate time.
 
virtual void unschedule ()=0
 Unschedules sensor to keep it from being triggered.
 
virtual bool isScheduled () const =0
 Returns whether the sensor is scheduled.
 
virtual void trigger ()
 Triggers the sensor, calling its callback function.
 
virtual bool isBefore (const SoSensor *s) const =0
 This returns TRUE if this sensor should precede sensor s in whichever queue this sensor would be in.
 
void setNextInQueue (SoSensor *next)
 Sets/returns the next sensor in whichever queue the sensor is in.
 
SoSensorgetNextInQueue () const
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDelayQueueSensor
static uint32_t getDefaultPriority ()
 Returns the default delay queue sensor priority, which is 100.
 
- Static Public Member Functions inherited from SoSensor
static void initClass ()
 Initialize static members, etc.
 
- Protected Member Functions inherited from SoDelayQueueSensor
virtual void trigger ()
 Triggers the sensor, calling its callback function.
 
- Protected Attributes inherited from SoDelayQueueSensor
bool scheduled
 Whether sensor is scheduled.
 
- Protected Attributes inherited from SoSensor
SoSensorCBfunc
 Callback function.
 
void * funcData
 Data to pass to callback.
 

Detailed Description

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 function to duplicate that behavior.

See the SoOneShotSensor manual page for more information.

See Also
SoOneShotSensor, SoDelayQueueSensor

Definition at line 91 of file SoIdleSensor.h.

Constructor & Destructor Documentation

◆ SoIdleSensor() [1/2]

SoIdleSensor::SoIdleSensor ( )

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

◆ SoIdleSensor() [2/2]

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

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

◆ ~SoIdleSensor()

virtual SoIdleSensor::~SoIdleSensor ( )
virtual

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