'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoDelayQueueSensor(3IV) .SH NAME SoDelayQueueSensor \(em abstract base class for sensors not dependent on time .SH INHERITS FROM SoSensor > SoDelayQueueSensor .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SoDelayQueueSensor: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPriority\*(Cr(uint32_t pri) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cruint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPriority\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic uint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultPriority\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbschedule\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbunschedule\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisScheduled\*(Cr() .sp .in 1i \f1Methods from class SoSensor: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFunction\*(Cr(SoSensorCB *callbackFunction) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSoSensorCB * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetFunction\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetData\*(Cr(void *callbackData) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetData\*(Cr() const .sp .SH DESCRIPTION Delay queue sensors are separate from timer queue sensors (see \*(CbSoTimerQueueSensor\f1) and provide methods for setting the relative priorities of the sensors in the delay queue (sensors with higher priorities will be triggered \&first). .sp Sensors with non-zero priorities are added to the delay queue when scheduled, and are all processed once, in order, when the delay queue is processed, which normally happens as part of your program's \&main loop (see \*(CbSoXt::mainLoop()\f1 or \*(CbSoDB::doSelect()\f1). Typically, the delay queue is processed whenever there are no events waiting to be distributed and there are no timer queue sensors waiting to be triggered. The delay queue also \&has a timeout to ensure that delay queue sensors are triggered even if there are always events or timer sensors waiting; see \*(CbSoDB::setDelaySensorTimeout()\f1. .sp Sensors with priority 0 are treated specially. Priority 0 sensors are triggered \&almost immediately after they are scheduled, before the program returns to the main loop. Priority 0 sensors are not necessarily triggered immediately when they are scheduled, however; if they are scheduled \&as part of the evaluation of a field connection network they may not be triggered until the evaluation of the network is complete. Also, if a priority 0 sensor is scheduled within the callback method \&of another priority 0 sensor, it will not be triggered until the callback method is complete (also note that if more than one priority 0 sensor is scheduled, the order in which they fire is undefined). .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPriority\*(Cr(uint32_t pri) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cruint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPriority\*(Cr() .br .in 1i \f1Sets/gets the priority of the sensor. Priorities can be changed at any time; if the priority is changed to zero and it is already scheduled, the sensor is immediately triggered and removed from the queue. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic uint32_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultPriority\*(Cr() .br .in 1i \f1Returns the default delay queue sensor priority, which is 100. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbschedule\*(Cr() .br .in 1i \f1If this sensor's priority is non-zero, adds this sensor to the list of delay queue sensors ready to be triggered. This is a way of making a sensor fire without changing the thing it is sensing. .sp Calling \*(Cbschedule()\f1 \&within the callback function causes the sensor to be called repeatedly. Because sensors are processed only once every time the delay queue is processed (even if they reschedule themselves), timers and \&events will still be processed. This should not be done with a priority zero sensor because an infinite loop will result. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbunschedule\*(Cr() .br .in 1i \f1If this sensor is scheduled, removes it from the delay queue so that it will not be triggered. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisScheduled\*(Cr() .br .in 1i \f1Returns TRUE if this sensor has been scheduled and is waiting in the delay queue to be triggered. Sensors are removed from the queue before their callback function is triggered. .sp .in 0.5i .SH SEE ALSO \*(CbSoTimerQueueSensor, SoDataSensor, SoFieldSensor, SoIdleSensor, SoOneShotSensor, SoNodeSensor, SoPathSensor, SoSensorManager