.TH "SoTimerQueueSensor" 3 "Tue Jun 23 2026 23:48:38" "Version 4.0.10" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoTimerQueueSensor \- The \fBSoTimerQueueSensor\fP class is the abstract base class for sensors triggering on certain timer events\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBSoSensor\fP\&. .PP Inherited by \fBSoAlarmSensor\fP, and \fBSoTimerSensor\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoTimerQueueSensor\fP (void)" .br .ti -1c .RI "\fBSoTimerQueueSensor\fP (SoSensorCB *\fBfunc\fP, void *data)" .br .ti -1c .RI "virtual \fB~SoTimerQueueSensor\fP (void)" .br .ti -1c .RI "const \fBSbTime\fP & \fBgetTriggerTime\fP (void) const" .br .ti -1c .RI "virtual void \fBschedule\fP (void)" .br .ti -1c .RI "virtual void \fBunschedule\fP (void)" .br .ti -1c .RI "virtual SbBool \fBisScheduled\fP (void) const" .br .ti -1c .RI "virtual void \fBtrigger\fP (void)" .br .in -1c Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "\fBSoSensor\fP (void)" .br .ti -1c .RI "\fBSoSensor\fP (SoSensorCB *\fBfunc\fP, void *data)" .br .ti -1c .RI "virtual \fB~SoSensor\fP (void)" .br .ti -1c .RI "void \fBsetFunction\fP (SoSensorCB *callbackfunction)" .br .ti -1c .RI "SoSensorCBPtr \fBgetFunction\fP (void) const" .br .ti -1c .RI "void \fBsetData\fP (void *callbackdata)" .br .ti -1c .RI "void * \fBgetData\fP (void) const" .br .ti -1c .RI "void \fBsetNextInQueue\fP (\fBSoSensor\fP *next)" .br .ti -1c .RI "\fBSoSensor\fP * \fBgetNextInQueue\fP (void) const" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void \fBsetTriggerTime\fP (const \fBSbTime\fP &time)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "SbBool \fBscheduled\fP" .br .in -1c Protected Attributes inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "SoSensorCB * \fBfunc\fP" .br .ti -1c .RI "void * \fBfuncData\fP" .br .in -1c .SS "Additional Inherited Members" Static Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SH "Detailed Description" .PP The \fBSoTimerQueueSensor\fP class is the abstract base class for sensors triggering on certain timer events\&. Timer sensors triggers upon specific points in time\&. .PP This class is an abstract superclass which collects the common interface of the various non-abstract timer sensor classes\&. See the documentation of the subclasses for information on what ways there are to specify base times, intervals, alarm-style single triggering, repeated triggers, etc\&. .PP Note that Coin timer sensors should in no way be considered "hardreal time"\&. That is, you \fIcannot\fP expect a timer to always trigger at the exact moment it was set up for\&. Delays in triggering could be due to other activities in Coin, a task suspended, or heavy load from other applications on the system\&. These situations could all cause the processing of sensor queues (from SoQt / SoWin / SoXt / whatever) to be slightly delayed, thereby causing delays in timer sensor triggering\&. .PP On modern systems, a timer will usually trigger within a few milliseconds of its designated time, though\&. .PP If a timer sensor cannot trigger at the exact moment it has been scheduled, it will be triggered at the first opportunity after the scheduled time has passed\&. .PP Here's a simple usage example\&. It's a standalone example, which only demonstrates how to set up a repeating timer sensor with a callback: .PP .PP .nf #include #include #include static void timeSensorCallback(void * data, SoSensor * sensor) { SbTime time = SbTime::getTimeOfDay(); SbString string = time\&.format("%S\&.%i"); (void)printf("%s\\n", string\&.getString()); } int main(int argc, char ** argv) { SoXt::init("test"); SoTimerSensor * timeSensor = new SoTimerSensor; timeSensor\->setFunction(timeSensorCallback); timeSensor\->setBaseTime(SbTime::getTimeOfDay()); timeSensor\->setInterval(1\&.0f); timeSensor\->schedule(); SoXt::mainLoop(); return 0; } .fi .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoTimerQueueSensor::SoTimerQueueSensor (void )" Default constructor\&. .SS "SoTimerQueueSensor::SoTimerQueueSensor (SoSensorCB * func, void * data)" Constructor taking as arguments the sensor callback function and the userdata which will be passed the callback\&. .PP \fBSee also\fP .RS 4 \fBsetFunction()\fP, \fBsetData()\fP .RE .PP .SS "SoTimerQueueSensor::~SoTimerQueueSensor (void )\fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "const \fBSbTime\fP & SoTimerQueueSensor::getTriggerTime (void ) const" Returns the time at which the sensor will trigger\&. .PP \fBSee also\fP .RS 4 \fBsetTriggerTime()\fP .RE .PP .SS "void SoTimerQueueSensor::schedule (void )\fR [virtual]\fP" Put the sensor in the global timer queue\&. .PP \fBSee also\fP .RS 4 \fBunschedule()\fP, \fBisScheduled()\fP .RE .PP .PP Implements \fBSoSensor\fP\&. .PP Reimplemented in \fBSoAlarmSensor\fP, and \fBSoTimerSensor\fP\&. .SS "void SoTimerQueueSensor::unschedule (void )\fR [virtual]\fP" Remove sensor from the timer queue, without triggering it first\&. .PP \fBSee also\fP .RS 4 \fBschedule()\fP, \fBisScheduled()\fP .RE .PP .PP Implements \fBSoSensor\fP\&. .PP Reimplemented in \fBSoTimerSensor\fP\&. .SS "SbBool SoTimerQueueSensor::isScheduled (void ) const\fR [virtual]\fP" Check if this sensor is scheduled for triggering\&. .PP \fBSee also\fP .RS 4 \fBschedule()\fP, \fBunschedule()\fP .RE .PP .PP Implements \fBSoSensor\fP\&. .SS "void SoTimerQueueSensor::trigger (void )\fR [virtual]\fP" Trigger the sensor's callback function\&. .PP Reimplemented from \fBSoSensor\fP\&. .SS "void SoTimerQueueSensor::setTriggerTime (const \fBSbTime\fP & time)\fR [protected]\fP" Set absolute time at which to trigger the sensor\&. .PP \fBSee also\fP .RS 4 \fBgetTriggerTime()\fP .RE .PP .SH "Member Data Documentation" .PP .SS "SbBool SoTimerQueueSensor::scheduled\fR [protected]\fP" \fRTRUE\fP if the sensor is currently scheduled\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.