Coin
4.0.3
Coin3D core library
|
The SoDelayQueueSensor class is the abstract base class for priority scheduled sensors. More...
#include <Inventor/sensors/SoDelayQueueSensor.h>
Public Member Functions | |
SoDelayQueueSensor (SoSensorCB *func, void *data) | |
SoDelayQueueSensor (void) | |
virtual | ~SoDelayQueueSensor (void) |
uint32_t | getPriority (void) const |
virtual SbBool | isIdleOnly (void) const |
virtual SbBool | isScheduled (void) const |
virtual void | schedule (void) |
void | setPriority (uint32_t pri) |
virtual void | trigger (void) |
virtual void | unschedule (void) |
Public Member Functions inherited from SoSensor | |
SoSensor (SoSensorCB *func, void *data) | |
SoSensor (void) | |
virtual | ~SoSensor (void) |
void * | getData (void) const |
SoSensorCBPtr | getFunction (void) const |
SoSensor * | getNextInQueue (void) const |
void | setData (void *callbackdata) |
void | setFunction (SoSensorCB *callbackfunction) |
void | setNextInQueue (SoSensor *next) |
Static Public Member Functions | |
static uint32_t | getDefaultPriority (void) |
Static Public Member Functions inherited from SoSensor | |
static void | initClass (void) |
Protected Attributes | |
SbBool | scheduled |
Protected Attributes inherited from SoSensor | |
SoSensorCB * | func |
void * | funcData |
The SoDelayQueueSensor class is the abstract base class for priority scheduled sensors.
Delay queue sensors are invoked upon various events not related to time occurrences. See documentation of subclasses to see which types of events can be surveilled by the built-in sensor types.
The priority values can be used to queue events by their importance, so the sensors are triggered in the sequence you want.
The queue of delay sensors (i.e. instances of subclasses of SoDelayQueueSensor) will be processed as soon as either the runtime system is idle, or if it is continually busy they will be processed within a fixed amount of time.
This time interval is by default 1/12th of a second, but can be controlled with the SoSensorManager::setDelaySensorTimeout() interface.
SoDelayQueueSensor::SoDelayQueueSensor | ( | void | ) |
Default constructor.
SoDelayQueueSensor::SoDelayQueueSensor | ( | SoSensorCB * | func, |
void * | data ) |
Constructor taking as arguments the sensor callback function and the userdata which will be passed to the callback.
|
virtual |
Destructor.
|
static |
Returns the default scheduling priority value. The default sensor priority is 100.
uint32_t SoDelayQueueSensor::getPriority | ( | void | ) | const |
Returns sensor scheduling priority.
|
virtual |
Returns a flag indicating whether or not the sensor should only be triggered if the application is truly idle, and not when the delay queue is processed because of the delay queue timeout.
|
virtual |
Check if this sensor is scheduled for triggering.
Implements SoSensor.
Put the sensor in the global delay queue. This means it will be triggered either when the CPU is idle, or when the specified delay queue timeout is reached.
Implements SoSensor.
void SoDelayQueueSensor::setPriority | ( | uint32_t | pri | ) |
Set this sensor's priority in the scheduling queue. When sensors are processed, high priority sensors will trigger before low priority sensors.
Please note that a low number means a high priority. A sensor with priority 5 will trigger before a sensor with priority 6.
Sensors with priority 0 have a special meaning in Coin/Inventor. They are called immediate sensors, and will trigger immediately after the current notification chain has finished. Priority 0 sensors should be used with care, since they might lead to bad performance if you do some processing in the sensor callback.
This setting does not affect SoDataSensor delete-callback invocations, which always are immediate.
Trigger the sensor's callback function.
Reimplemented from SoSensor.
Reimplemented in SoDataSensor, and SoFieldSensor.
Remove sensor from the delay queue, without triggering it first.
Implements SoSensor.
|
protected |
TRUE
if the sensor is currently scheduled.