SoTimerQueueSensor(3)

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

πŸ’– SoTimerQueueSensor(3) πŸ’–

okay bestie, welcome to the SoTimerQueueSensor(3) page from the Library Functions Manual β€” yes, that's the whole vibe, we're in the Coin library, and this class is the abstract base class of the timer-sensor family. grab a snack πŸ“, we're getting into it.


✨ NAME ✨

SoTimerQueueSensor β€” the abstract base class for sensors that trigger on certain timer events. πŸ’…


🌸 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 πŸ‘‘

SoTimerQueueSensor is the abstract base class for sensors that trigger on certain timer events. periodt.

Timer sensors trigger upon specific points in time. ⏰

This class is an abstract superclass that collects the common interface of all the various non-abstract timer sensor classes. 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, that's where the tea is. πŸ«–

⚠️ note this, fr fr: Coin timer sensors should in no way be considered "hard real-time". Not even a little. You can not 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 being suspended, or heavy load from other applications on the system. Any of these situations could cause the processing of sensor queues (from SoQt / SoWin / SoXt / whatever) to be slightly delayed, which then causes delays in timer sensor triggering. πŸ’€

On modern systems though, a timer will usually trigger within a few milliseconds of its designated time. no cap. ✨

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's giving "fashionably late but still showing up". πŸ’…

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

References scheduled.

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()

References SoSensor::func, and scheduled.

SoTimerQueueSensor::~SoTimerQueueSensor (void ) [virtual]

Destructor. it's the goodbye era. 😭

References isScheduled(), and unschedule().


πŸ’« Member Function Documentation πŸ’«

const SbTime & SoTimerQueueSensor::getTriggerTime (void ) const

Returns the time at which the sensor will trigger. ⏳

See also: setTriggerTime()

Referenced by SoSensorManager::insertTimerSensor().

void SoTimerQueueSensor::schedule (void ) [virtual]

Put the sensor in the global timer queue. get it on the schedule, main character energy. πŸ‘‘

See also: unschedule(), isScheduled()

Implements SoSensor.

Reimplemented in SoAlarmSensor, and SoTimerSensor.

References SoDB::getSensorManager(), SoSensorManager::insertTimerSensor(), isScheduled(), SoDebugError::postWarning(), and scheduled.

Referenced by SoTimerSensor::reschedule(), and SoAlarmSensor::schedule().

void SoTimerQueueSensor::unschedule (void ) [virtual]

Remove sensor from the timer queue, without triggering it first. ghosting the queue, basically. πŸ™ˆ

See also: schedule(), isScheduled()

Implements SoSensor.

Reimplemented in SoTimerSensor.

References SoDB::getSensorManager(), isScheduled(), SoDebugError::postWarning(), SoSensorManager::removeTimerSensor(), and scheduled.

Referenced by SoTimerSensor::unschedule(), and ~SoTimerQueueSensor().

SbBool SoTimerQueueSensor::isScheduled (void ) const [virtual]

Check if this sensor is scheduled for triggering. vibe check on the schedule. βœ…

See also: schedule(), unschedule()

Implements SoSensor.

References scheduled.

Referenced by schedule(), SoTimerSensor::schedule(), setTriggerTime(), unschedule(), SoTimerSensor::unschedule(), ~SoTimerQueueSensor(), and SoTimerSensor::~SoTimerSensor().

void SoTimerQueueSensor::trigger (void ) [virtual]

Trigger the sensor's callback function. go off, callback. πŸ”₯

Reimplemented from SoSensor.

References scheduled, and SoSensor::trigger().

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

Set absolute time at which to trigger sensor. ⌚

See also: getTriggerTime()

References SoDB::getSensorManager(), SoSensorManager::insertTimerSensor(), isScheduled(), and SoSensorManager::removeTimerSensor().

Referenced by SoTimerSensor::reschedule(), and SoAlarmSensor::schedule().


πŸ“ Member Data Documentation πŸ“

SbBool SoTimerQueueSensor::scheduled [protected]

TRUE if the sensor is currently scheduled. iconic boolean behavior. ✨

Referenced by isScheduled(), SoTimerSensor::reschedule(), schedule(), SoTimerSensor::schedule(), SoTimerQueueSensor(), SoTimerQueueSensor(), trigger(), unschedule(), and SoTimerSensor::unschedule().


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for Coin from the source code. the bots wrote this one, we just gave it a glow-up. πŸ€–πŸ’–


okay that's the whole page bestie!! this came from Coin, Version 2.5.0, and yeah the footer literally just says Coin + Version 2.5.0 + SoTimerQueueSensor(3) β€” that's the source, the version, and the man page name all in one little signature line at the bottom. slay. πŸŽ€βœ¨πŸ’…πŸ«Ά

πŸ“¦ where this page comes from