SoTimerQueueSensor(3)
π NAME π
SoTimerQueueSensor β the abstract base class for sensors that trigger on certain timer events. It's giving "parent class energy" and honestly? Iconic. πβ¨
This page is from the Coin manual, section 3, and it's the whole vibe on timer-queue sensors, bestie.
β¨ SYNOPSIS β¨
#include <Inventor/sensors/SoTimerQueueSensor.h>
Inherits SoSensor.
Inherited by SoAlarmSensor, and SoTimerSensor. (Yes queen, the whole timer family tree π³π
)
πΈ Public Member Functions πΈ
SoTimerQueueSensor (void)SoTimerQueueSensor (SoSensorCB *func, void *data)virtual ~SoTimerQueueSensor (void)const SbTime & getTriggerTime (void) constvirtual void schedule (void)virtual void unschedule (void)virtual SbBool isScheduled (void) constvirtual void trigger (void)
π«Ά Public Member Functions inherited from SoSensor π«Ά
SoSensor (void)SoSensor (SoSensorCB *func, void *data)virtual ~SoSensor (void)void setFunction (SoSensorCB *callbackfunction)SoSensorCBPtr getFunction (void) constvoid setData (void *callbackdata)void * getData (void) constvoid setNextInQueue (SoSensor *next)SoSensor * getNextInQueue (void) const
π Protected Member Functions π
void setTriggerTime (const SbTime &time)
π¦ Protected Attributes π¦
SbBool scheduled
π Protected Attributes inherited from SoSensor π
SoSensorCB * funcvoid * funcData
π Additional Inherited Members π
β Static Public Member Functions inherited from SoSensor β
static void initClass (void)
π Detailed Description π
OK so, bestie, here's the tea: SoTimerQueueSensor is the abstract base class for sensors that trigger on certain timer events.
Timer sensors trigger upon specific points in time. Periodt. β°
This class is an abstract superclass β meaning you do NOT instantiate it directly, babes β it just collects the common interface that all the various non-abstract timer sensor classes share. Wanna know the ways you can specify base times, intervals, alarm-style single triggering, repeated triggers, etc.? Go read the docs of the subclasses, because that's where all that lives. π
β οΈ Important caveat, no cap: Coin timer sensors should in no way be considered "hardreal time". That is, you cannot 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 (fromSoQt/SoWin/SoXt/ whatever) to be slightly delayed, thereby causing delays in timer sensor triggering. π
On modern systems, though, a timer will usually trigger within a few milliseconds of its designated time. Slay. β¨
And 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. It's not late, it's just fashionably delayed. π
Here's a simple usage example β a standalone one that only demonstrates how to set up a repeating timer sensor with a callback:
#include <Inventor/Xt/SoXt.h>
#include <Inventor/sensors/SoTimerSensor.h>
#include <cstdio>
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;
}
π οΈ Constructor & Destructor Documentation π οΈ
SoTimerQueueSensor::SoTimerQueueSensor (void )
Default constructor. Nothing fancy, just vibes. π
SoTimerQueueSensor::SoTimerQueueSensor (SoSensorCB * func, void * data)
Constructor taking as arguments the sensor callback function and the userdata which will be passed the callback. π«Ά
See also: setFunction(), setData()
SoTimerQueueSensor::~SoTimerQueueSensor (void ) [virtual]
Destructor. Say bye bestie ππ
π₯ Member Function Documentation π₯
const SbTime & SoTimerQueueSensor::getTriggerTime (void ) const
Returns the time at which the sensor will trigger. β±οΈ
See also: setTriggerTime()
void SoTimerQueueSensor::schedule (void ) [virtual]
Put the sensor in the global timer queue. Get in line, queen π
See also: unschedule(), isScheduled()
Implements SoSensor.
Reimplemented in SoAlarmSensor, and SoTimerSensor.
void SoTimerQueueSensor::unschedule (void ) [virtual]
Remove sensor from the timer queue, without triggering it first. No callback, no drama, just gone. π
See also: schedule(), isScheduled()
Implements SoSensor.
Reimplemented in SoTimerSensor.
SbBool SoTimerQueueSensor::isScheduled (void ) const [virtual]
Check if this sensor is scheduled for triggering. Vibe check β
See also: schedule(), unschedule()
Implements SoSensor.
void SoTimerQueueSensor::trigger (void ) [virtual]
Trigger the sensor's callback function. Do it, make it happen, main character moment π₯
Reimplemented from SoSensor.
void SoTimerQueueSensor::setTriggerTime (const SbTime & time) [protected]
Set absolute time at which to trigger the sensor. π°οΈ
See also: getTriggerTime()
πΎ Member Data Documentation πΎ
SbBool SoTimerQueueSensor::scheduled [protected]
TRUE if the sensor is currently scheduled. That's it, that's the flag π©
π Author π
Generated automatically by Doxygen for Coin from the source code. (Not a human bestie, but she ate regardless π )
Version 4.0.10 Β· Thu Jun 25 2026 00:00:00 β and that's the whole page, bestie! Go schedule something iconic. Slay, stay on time, and remember: not hardreal time, fr fr. πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms