SoTimerQueueSensor(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– SoTimerQueueSensor πŸ’–

okay bestie, this is SoTimerQueueSensor(3) from the Library Functions Manual β€” like, a whole page about the abstract base class for sensors that go off on timer events. it's giving "clock but make it C++" and honestly? iconic. πŸ•βœ¨


✨ NAME ✨

SoTimerQueueSensor β€” the abstract base class for sensors that trigger on certain timer events. it's the mom of the timer sensor family, she doesn't do the work herself but she sets the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <Inventor/sensors/SoTimerQueueSensor.h>

Inherits SoSensor.

Inherited by SoAlarmSensor, and SoTimerSensor.

πŸŽ€ 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 🌈

okay so the SoTimerQueueSensor class is the abstract base class for sensors triggering on certain timer events. no cap. that's the whole deal.

Timer sensors trigger upon specific points in time. like, a specific moment. they're very "I'll be there at 7:00 sharp" of them. ⏰

This class is an abstract superclass which collects the common interface of the various non-abstract timer sensor classes. so it's like, the group chat rules that all the specific sensor girlies agree to follow. if you wanna know all the ways you can specify base times, intervals, alarm-style single triggering, repeated triggers, etc. β€” go read the docs of the subclasses, bestie. they have the tea. 🍡

note bestie, this one matters: Coin timer sensors should in no way be considered "hard real-time". like, you genuinely 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. all of those can cause the processing of sensor queues (from SoQt / SoWin / SoXt / whatever) to be slightly delayed, thereby causing delays in timer sensor triggering. it's not sloppy, it's just... life.

On modern systems, though, a timer will usually trigger within a few milliseconds of it's designated time. so like, chill. it's fine. 🫢

If a timer sensor can not trigger at the exact moment it has been scheduled, it will be triggered at the first opportunity after the scheduled time has passed. it doesn't ghost you forever, it just shows up fashionably late. πŸ’…

Here's a simple usage example. it's a stand-alone example, which only demonstrates how to set up a repeating timer sensor with a callback:

#include <Inventor/Xt/SoXt.h>
#include <Inventor/sensors/SoTimerSensor.h>
#include <stdio.h>

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. the classic. the no-args baddie. ✨

SoTimerQueueSensor::SoTimerQueueSensor (SoSensorCB * func, void * data)

Constructor taking as arguments the sensor callback function and the userdata which will be passed the callback. so you hand it a function and a lil data bundle and it knows what to do. 🎁

See also: setFunction(), setData()

SoTimerQueueSensor::~SoTimerQueueSensor (void ) [virtual]

Destructor. she's leaving the function, say bye. πŸ‘‹


πŸŽ€ Member Function Documentation πŸŽ€

const SbTime & SoTimerQueueSensor::getTriggerTime (void ) const

Returns the time at which the sensor will trigger. it's literally telling you the moment. fr fr. ⏱️

See also: setTriggerTime()

void SoTimerQueueSensor::schedule (void ) [virtual]

Put the sensor in the global timer queue. congrats, you're on the list. πŸ’Œ

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. so like, cancelled, 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, basically. πŸ‘‘

See also: schedule(), unschedule()

Implements SoSensor.

void SoTimerQueueSensor::trigger (void ) [virtual]

Trigger the sensor's callback function. do it. no thoughts, just call the callback. πŸ”₯

Reimplemented from SoSensor.

void SoTimerQueueSensor::setTriggerTime (const SbTime & time) [protected]

Set absolute time at which to trigger sensor. very specific. very precise. very her. πŸ•°οΈ

See also: getTriggerTime()


πŸ’œ Member Data Documentation πŸ’œ

SbBool SoTimerQueueSensor::scheduled [protected]

TRUE if the sensor is currently scheduled. simple as that, bestie. πŸ’–


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code. so, not a human, but the machine ate and left no crumbs. πŸ€–βœ¨


and that's the whole page, bestie!! πŸŽ€πŸ¦‹πŸŒΈπŸ’… this was Coin Version 3.1.3 of SoTimerQueueSensor(3) β€” stay scheduled, stay slay. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from