SoTimerQueueSensor(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– 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) const
  • virtual void schedule (void)
  • virtual void unschedule (void)
  • virtual SbBool isScheduled (void) const
  • virtual 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) const
  • void setData (void *callbackdata)
  • void * getData (void) const
  • void 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 * func
  • void * 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 (from SoQt / 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