.TH "SoTimerQueueSensor" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "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 \fC#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 (\fBvoid\fP)" .br .ti -1c .RI "\fBSoTimerQueueSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoTimerQueueSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBconst\fP \fBSbTime\fP & \fBgetTriggerTime\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBschedule\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBunschedule\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisScheduled\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBtrigger\fP (\fBvoid\fP)" .br .in -1c Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "\fBSoSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetFunction\fP (SoSensorCB *\fBcallbackfunction\fP)" .br .ti -1c .RI "SoSensorCBPtr \fBgetFunction\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetData\fP (\fBvoid\fP *\fBcallbackdata\fP)" .br .ti -1c .RI "\fBvoid\fP * \fBgetData\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetNextInQueue\fP (\fBSoSensor\fP *next)" .br .ti -1c .RI "\fBSoSensor\fP * \fBgetNextInQueue\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBvoid\fP \fBsetTriggerTime\fP (\fBconst\fP \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 "\fBvoid\fP * \fBfuncData\fP" .br .in -1c .SS "Additional Inherited Members" Static Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .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 'hard real 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 (\fBvoid\fP)" Default constructor\&. .SS "SoTimerQueueSensor::SoTimerQueueSensor (SoSensorCB * func, \fBvoid\fP * 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 (\fBvoid\fP)\fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBconst\fP \fBSbTime\fP & SoTimerQueueSensor::getTriggerTime (\fBvoid\fP) const" Returns the time at which the sensor will trigger\&. .PP \fBSee also\fP .RS 4 \fBsetTriggerTime()\fP .RE .PP .SS "\fBvoid\fP SoTimerQueueSensor::schedule (\fBvoid\fP)\fC [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 "\fBvoid\fP SoTimerQueueSensor::unschedule (\fBvoid\fP)\fC [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 (\fBvoid\fP) const\fC [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 "\fBvoid\fP SoTimerQueueSensor::trigger (\fBvoid\fP)\fC [virtual]\fP" Trigger the sensor's callback function\&. .PP Reimplemented from \fBSoSensor\fP\&. .SS "\fBvoid\fP SoTimerQueueSensor::setTriggerTime (\fBconst\fP \fBSbTime\fP & time)\fC [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\fC [protected]\fP" \fCTRUE\fP if the sensor is currently scheduled\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.