SbTime(3)
π NAME π
okay bestie, first things first β you're looking at SbTime(3), straight out of the Library Functions Manual, and it's literally the moment this whole page stops being mysterious.
SbTime β The SbTime class instances represents time values. that's it, that's the whole identity π
β¨ SYNOPSIS β¨
#include <Inventor/SbTime.h>
π Public Member Functions
SbTime (void)
SbTime (const double sec)
SbTime (const int32_t sec, const long usec)
SbTime (const struct timeval *const tv)
void setToTimeOfDay (void)
void setValue (const double sec)
void setValue (const int32_t sec, const long usec)
void setValue (const struct timeval *const tv)
void setMsecValue (const unsigned long msec)
double getValue (void) const
void getValue (time_t &sec, long &usec) const
void getValue (struct timeval *tv) const
unsigned long getMsecValue (void) const
SbString format (const char *const fmt='%S.%i') const
SbString formatDate (const char *const fmt=NULL) const
SbBool parsedate (const char *const date)
SbTime & operator+= (const SbTime &tm)
SbTime & operator-= (const SbTime &tm)
SbTime operator- (void) const
SbTime & operator*= (const double s)
SbTime & operator/= (const double s)
double operator/ (const SbTime &tm) const
SbTime operator% (const SbTime &tm) const
int operator== (const SbTime &tm) const
int operator!= (const SbTime &tm) const
SbBool operator< (const SbTime &tm) const
SbBool operator> (const SbTime &tm) const
SbBool operator<= (const SbTime &tm) const
SbBool operator>= (const SbTime &tm) const
void print (FILE *fp) const
π Static Public Member Functions
static SbTime getTimeOfDay (void)
static SbTime zero (void)
static SbTime max (void)
static SbTime maxTime (void)
π«Ά Friends
SbTime operator+ (const SbTime &t0, const SbTime &t1)
SbTime operator- (const SbTime &t0, const SbTime &t1)
SbTime operator* (const double s, const SbTime &tm)
SbTime operator* (const SbTime &tm, const double s)
SbTime operator/ (const SbTime &tm, const double s)
π Detailed Description π
The SbTime class instances represents time values. (yes it says "instances represents", we do not fix the grammar of our elders, we respect it π«‘)
SbTime is a convenient way of doing system independent representation and calculations on time values of high resolution. like, it's giving "portable high-res clock energy" and honestly? we're obsessed π
π Constructor & Destructor Documentation π
SbTime::SbTime (void )
The default constructor sets up a time instance of 0 seconds. blank slate, clean girl era, zero on the clock β°β¨
References setValue().
Referenced by:
getTimeOfDay(), maxTime(), operator!=(), operator%(), operator*, operator*,
operator+, operator+=(), operator-, operator-(),
operator-=(), operator/(), operator/, operator<(), operator<=(),
operator==(), operator>(), operator>=(), and zero().
SbTime::SbTime (const double sec)
Construct and initialize an SbTime instance to a time specified as sec seconds. drop a double in, get a time out, no drama π
References setValue().
SbTime::SbTime (const int32_t sec, const long usec)
Construct and initialize an SbTime instance to a date and time sec number of seconds and usec number of microseconds. seconds AND microseconds, she's precise like that π
References setValue().
SbTime::SbTime (const struct timeval *const tv)
Construct and initialize an SbTime instance to the date and time given by the struct timeval. For information on the timeval structure, please consult your system developer documentation. (iykyk β go read your system's docs, bestie, this page isn't gonna do it for you π)
References setValue().
to be continued, bestie β part 2 is coming and we are NOT done here π¦
β¨ Member Function Documentation β¨
Okay bestie, let's get into the functions! These are the methods that make SbTime do its thing. π
SbTime SbTime::getTimeOfDay (void ) [static]
This static method is giving main character energy β it returns an SbTime instance with the current clock time. The time is given as a particular number of seconds and microseconds since 00:00:00 January 1, 1970, in Coordinated Universal Time (UTC). No cap. π°οΈβ¨
- See also:
setToTimeOfDay(). - References:
SbTime(). - Referenced by:
SoIntersectionDetectionAction::apply(),SoSensorManager::processTimerQueue(),SoVRMLAudioClip::read(),SoSceneManager::render(),SoTimerSensor::schedule(), andsetToTimeOfDay().
void SbTime::setToTimeOfDay (void )
Set this SbTime to be the current clock time. The current time will be given as a particular number of seconds and microseconds since 00:00:00.00 1st January 1970. It's giving "what time is it? time to slay". β°π
- See also:
getTimeOfDay(). - References:
getTimeOfDay(). - Referenced by:
SoAlarmSensor::setTimeFromNow().
SbTime SbTime::zero (void ) [static]
Returns an SbTime instance representing zero time. Zero, zilch, nada β but make it iconic. π
- See also:
zero(). - References:
SbTime(). - Referenced by:
SoDB::enableRealTimeSensor(),SoSensorManager::insertDelaySensor(),SoSensorManager::setDelaySensorTimeout(),SoDB::setRealTimeInterval(),SoElapsedTime::SoElapsedTime(),SoOneShot::SoOneShot(),SoRotor::SoRotor(),SoTimeCounter::SoTimeCounter(), andSoVRMLMovieTexture::SoVRMLMovieTexture().
SbTime SbTime::max (void ) [static]
Returns an SbTime instance representing the maximum representable time/date. But bestie, beware: this method is not available under MSWindows, as max() crashes with a define macro Microsoft has polluted the global namespace with. So Windows girlies, don't even try it. π
- See also:
zero(). - References:
maxTime().
SbTime SbTime::maxTime (void ) [static]
Returns an SbTime instance representing the maximum representable time/date. This one works everywhere, so it's the safe baddie. π
- See also:
zero(). - References:
SbTime(). - Referenced by:
max().
void SbTime::setValue (const double sec)
Reset an SbTime instance to sec number of seconds. Simple, clean, slay. β¨
- See also:
getValue(). - Referenced by:
SbTime(),SbTime(),SbTime(),SbTime(), andsetMsecValue().
void SbTime::setValue (const int32_t sec, const long usec)
Reset an SbTime instance to sec number of seconds and usec number of microseconds. Two-for-one deal, we love to see it. π
- See also:
getValue().
void SbTime::setValue (const struct timeval *const tv)
Reset an SbTime instance to the date and time given by the timeval struct. For info on the timeval struct, please consult your developer system documentation. Ngl, that's a you problem, but we trust you. π
- See also:
getValue().
void SbTime::setMsecValue (const unsigned long msec)
Set the time by msec number of milliseconds. Millisecond precision, periodt. β±οΈ
- See also:
getMsecValue(). - References:
setValue().
double SbTime::getValue (void ) const
Return time as number of seconds. That's it, that's the vibe. π°οΈ
- See also:
setValue(). - Referenced by:
SoSensorManager::insertTimerSensor(),operator%(),operator-(),operator/(),print(), andSbCondVar::timedWait().
void SbTime::getValue (time_t & sec, long & usec) const
Return number of seconds and microseconds which the SbTime instance represents. Two values, one call β efficient queen. π
- See also:
setValue().
void SbTime::getValue (struct timeval * tv) const
Returns the time as a timeval structure. For info on the timeval structure, please consult your system developer documentation. Again, that's on you, but we believe in you. π
- See also:
setValue().
unsigned long SbTime::getMsecValue (void ) const
Return number of milliseconds which the SbTime instance represents.
Important note: you should in general avoid using this function, as it has an inherent API design flaw (from the original SGI Open Inventor design). The problem is that anunsigned longwraps around in a fairly short time when used for counting milliseconds: in less than 50 days. (And sinceSbTimeinstances are often initialized to be the time since the start of the epoch (ie1970-01-01 00:00), the value will have wrapped around many, many times.)
You are probably better off using the getValue() method which returns a double for the number of seconds, then multiply by 1000.0 if you need to know the current number of milliseconds of the SbTime instance. Trust, this is the way. π
- See also:
setMsecValue() - References:
SoDebugError::postWarning().
SbString SbTime::format (const char *const fmt = '%S.%i') const
Uses the formatting specified below to return a string representation of the stored date/time. Any format specifiers must be prefixed with a '' symbol, any other text in the format string fmt will be copied directly to the resultant SbString. So you can go wild with your own text. π¨
Here's the full specifier menu:
%% - insert a single ''.
D - number of days.
H - number of hours.
h - remaining hours after subtracting number of days.
M - number of minutes.
m - remaining minutes after subtracting the total number of hours.
S - number of seconds.
s - remaining seconds after subtracting the total number of minutes.
I - number of milliseconds.
i - remaining milliseconds after subtracting the total number of
seconds.
U - number of microseconds.
u - remaining microseconds after subtracting the total number of
mseconds.
The result shows UTC time, not corrected for local time zone nor daylight savings time. So if you're like "why is it off by hours?" β that's why, bestie. π
- See also:
formatDate(). - References:
SbString::addIntString(), andSoDebugError::postWarning(). - Referenced by:
formatDate().
SbString SbTime::formatDate (const char *const fmt = NULL) const
Accepts the formatting identifiers specified by the POSIX strftime() function to return a string representation of the stored date. Check your reference documentation for strftime() for info on the format modifiers available. It's giving "let me customize my date string". π
β¨
Default formatting is used if fmt is NULL. Note that the default formatting is different on Microsoft Windows systems versus all other systems. For Windows, it is "%#c", for other systems it is "%A, %D %r" (again, see system documentation on strftime() for more information). So Windows girlies get a different vibe, no cap. π»
The value of SbTime will be interpreted as seconds since 00:00:00 1970-01-01.
The result shows local time, according to local time zone and daylight savings time (if and when applicable). So this one respects your timezone, periodt. π
- See also:
format(). - References:
format(). - Referenced by:
print().
SbBool SbTime::parsedate (const char *const date)
This method takes a date string and converts it to the internal SbTime format. The date string must conform to one of three formats, namely the RFC 822 / RFC 1123 format (Wkd, DD Mnth YYYY HH:MM:SS GMT), the RFC 850 / RFC 1036 format (Weekday, DD-Mnth-YY HH:MM:SS GMT), or the asctime() format (Wkdy Mnth D HH:MM:SS YYYY). So you gotta speak one of those three languages, or it's a no from her. π£οΈ
Feeding an invalid date string to this method will make it return FALSE. So don't come with nonsense, bestie. π
ββοΈ
- References:
SoDebugError::post(),SoDebugError::postInfo(), andSoDebugError::postWarning().
SbTime & SbTime::operator+= (const SbTime & tm)
Add tm to time value and return reference to self. It's giving "I'm adding to myself and returning me". Main character energy. π
- References:
SbTime().
SbTime & SbTime::operator-= (const SbTime & tm)
Subtract tm from time value and return reference to self. Subtracting but still returning self β confident. π
- References:
SbTime().
SbTime SbTime::operator- (void ) const
Return the negated time. Flip the sign, flip the vibe. π
- References:
getValue(), andSbTime().
SbTime & operator*= (const double s)
Multiply time value with s and return reference to self. Math but make it slay. βοΈ
SbTime & operator/= (const double s)
Divide time value with s and return reference to self. Division, but we're not dividing the friendship. π€
- References:
SoDebugError::postWarning().
double operator/ (const SbTime & tm) const
Find the factor between this SbTime and the one given in tm, and return the result. It's giving ratio. π
- References:
getValue(),SoDebugError::postWarning(), andSbTime().
SbTime SbTime::operator% (const SbTime & tm) const
Returns the remainder time when dividing on tm. Modulo but make it time. β³
- References:
getValue(),SoDebugError::postWarning(), andSbTime().
int SbTime::operator== (const SbTime & tm) const
Check if the time value is equal to that of tm. Equality check, periodt. β
- References:
SbTime().
int SbTime::operator!= (const SbTime & tm) const
Check if the time value is not equal to that of tm. Not equal? We love a good inequality. β
- References:
SbTime().
SbBool SbTime::operator< (const SbTime & tm) const
Compares with tm and return TRUE if less. Less than, but make it iconic. π
- References:
SbTime().
SbBool SbTime::operator> (const SbTime & tm) const
Compares with tm and return TRUE if larger than. Greater than, slay. π
- References:
SbTime().
SbBool SbTime::operator<= (const SbTime & tm) const
Compares with tm and return TRUE if less or equal. Less than or equal, we love inclusivity. π«Ά
- References:
SbTime().
SbBool SbTime::operator>= (const SbTime & tm) const
Compares with tm and return TRUE if larger or equal. Greater than or equal, periodt. π
- References:
SbTime().
void SbTime::print (FILE * fp) const
Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile. So if you're in release mode, this is a no-op, bestie. π
- References:
formatDate(),SbString::getString(), andgetValue().
π Friends And Related Symbol Documentation π
These are the friend functions β they're not members, but they're still part of the squad. π«
SbTime operator+ (const SbTime & t0, const SbTime & t1) [friend]
Add the two SbTimes and return the result. Friendship goals. π
- References:
SbTime().
SbTime operator- (const SbTime & t0, const SbTime & t1) [friend]
Subtract t1 from t0 and return the result. Subtraction, but with friends. π€
- References:
SbTime().
SbTime operator* (const double s, const SbTime & tm) [friend]
Multiply time value tm with s and return result. Multiplication, but make it friendly. βοΈ
- References:
SbTime().
SbTime operator* (const SbTime & tm, const double s) [friend]
Multiply time value tm with s and return result. Same as above but with the arguments flipped β commutative, we love to see it. π
- References:
SbTime().
SbTime operator/ (const SbTime & tm, const double s) [friend]
Divide time value tm with s and return result. Division, but friendly. β
- References:
SbTime().
β¨ Author β¨
Generated automatically by Doxygen for Coin from the source code. So you know it's legit. π€
That's a wrap, bestie! This was Coin, Version 2.5.0, SbTime(3) β thanks for reading, mwah! πβ¨π
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms