GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SBTIME (3)

NAME

SbTime — class for representation of a time

CONTENTS

Inherits From
Synopsis
Description
Methods
File Format/defaults
See Also

INHERITS FROM

SbTime

SYNOPSIS

#include <Inventor/SbTime.h>

Methods from class SbTime:

       
                    
                     SbTime()    
   
                    
                     SbTime(double sec)    
   
                    
                     SbTime(int32_t sec, long usec)    
   
                    
                     SbTime(const struct timeval *tv)    
static SbTime    
                    
static SbTime        getTimeOfDay()    
void    
                    
void                 setToTimeOfDay()    
static SbTime    
                    
static SbTime        zero()    
static SbTime    
                    
static SbTime        max()    
void    
                    
void                 setValue(double sec)    
void    
                    
void                 setValue(int32_t sec, long usec)    
void    
                    
void                 setValue(const struct timeval *tv)    
void    
                    
void                 setMsecValue(unsigned long msec)    
double    
                    
double               getValue() const    
void    
                    
void                 getValue(int32_t &sec, long &usec) const    
void    
                    
void                 getValue(struct timeval *tv) const    
unsigned long    
                    
unsigned long        getMsecValue() const    
SbString    
                    
SbString             format(const char *fmt = "%S.%i") const    
SbString    
                    
SbString             formatDate(const char *fmt = "%A, %D %r") const    
SbTime    
                    
SbTime               operator +(const SbTime &t0, const SbTime &t1)    
SbTime    
                    
SbTime               operator -(const SbTime &t0, const SbTime &t1)    
SbTime &    
                    
SbTime &             operator +=(const SbTime &tm)    
SbTime &    
                    
SbTime &             operator -=(const SbTime &tm)    
SbTime    
                    
SbTime               operator -() const    
SbTime    
                    
SbTime               operator *(double s, const SbTime &tm)    
SbTime    
                    
SbTime               operator *(const SbTime &tm, double s)    
SbTime    
                    
SbTime               operator /(const SbTime &tm, double s)    
SbTime &    
                    
SbTime &             operator *=(double s)    
SbTime &    
                    
SbTime &             operator /=(double s)    
double    
                    
double               operator /(const SbTime &tm) const    
SbTime    
                    
SbTime               operator %(const SbTime &tm) const    
int    
                    
int                  operator ==(const SbTime &tm) const    
int    
                    
int                  operator !=(const SbTime &tm) const    
SbBool    
                    
SbBool               operator <(const SbTime &tm) const    
SbBool    
                    
SbBool               operator >(const SbTime &tm) const    
SbBool    
                    
SbBool               operator <=(const SbTime &tm) const    
SbBool    
                    
SbBool               operator >=(const SbTime &tm) const

DESCRIPTION

This class represents and performs operations on time. Operations may be done in seconds, seconds and microseconds, or using a struct timeval (defined in /usr/include/sys/time.h).

METHODS

       
                    
                     SbTime()    
   
                    
                     SbTime(double sec)    
   
                    
                     SbTime(int32_t sec, long usec)    
   
                    
                     SbTime(const struct timeval *tv)
Constructors taking seconds, seconds and microseconds, or a struct timeval. NOTE that an integer parameter will not automatically cast to a double to invoke the constructor taking seconds; that is, SbTime(1) will result in a compilation error. SbTime(1.0) must be used instead. This is to avoid errors in upgrading from an earlier release, in which SbTime(1) had different semantics. In future releases, this distinction will be eliminated, and the effect of SbTime(1.0) and that of SbTime(1) will be identical.

    static SbTime    
                    
static SbTime        getTimeOfDay()
Get the current time (seconds since Jan 1, 1970).

    void    
                    
void                 setToTimeOfDay()
Set to the current time (seconds since Jan 1, 1970).

    static SbTime    
                    
static SbTime        zero()
Get a zero time.

    static SbTime    
                    
static SbTime        max()
Get a time far, far into the future.

    void    
                    
void                 setValue(double sec)
Set time from a double (in seconds).

    void    
                    
void                 setValue(int32_t sec, long usec)
Set time from seconds + microseconds.

    void    
                    
void                 setValue(const struct timeval *tv)
Set time from a struct timeval.

    void    
                    
void                 setMsecValue(unsigned long msec)
Set time from milliseconds.

    double    
                    
double               getValue() const
Get time in seconds as a double.

    void    
                    
void                 getValue(int32_t &sec, long &usec) const
Get time in seconds and microseconds.

    void    
                    
void                 getValue(struct timeval *tv) const
Get time in a struct timeval.

    unsigned long    
                    
unsigned long        getMsecValue() const
Get time in milliseconds (for Xt).

    SbString    
                    
SbString             format(const char *fmt = "%S.%i") const
Convert to a string. The default format is seconds with 3 digits of fraction precision. fmt is a character string that consists of field descriptors and text characters, in a manner analogous to cftime (3C) and printf (3S). Each field descriptor consists of a % character followed by another character which specifies the replacement for the field descriptor. All other characters are copied from fmt into the result. The following field descriptors are supported:



% the ‘%’ character D total number of days H total number of hours M total number of minutes S total number of seconds I total number of milliseconds U total number of microseconds h hours remaining after the days (00-23) m minutes remaining after the hours (00-59) s seconds remaining after the minutes (00-59) i milliseconds remaining after the seconds (000-999) u microseconds remaining after the seconds (000000-999999)

The uppercase descriptors are formatted with a leading ‘—’ for negative times; the lowercase descriptors are formatted fixed width, with leading zeros. For example, a reasonable format string might be "elapsed time: %M minutes, %s seconds". The default value of fmt, "%S.%i", formats the time as seconds with 3 digits of fractional precision.

    SbString    
                    
SbString             formatDate(const char *fmt = "%A, %D %r") const
Convert to a date string, interpreting the time as seconds since Jan 1, 1970. The default format gives "Tuesday, 01/26/93 11:23:41 AM". See the cftime() reference page for explanation of the format string.

    SbTime    
                    
SbTime               operator +(const SbTime &t0, const SbTime &t1)    
SbTime    
                    
SbTime               operator -(const SbTime &t0, const SbTime &t1)
Addition and subtraction of two times.

    SbTime &    
                    
SbTime &             operator +=(const SbTime &tm)    
SbTime &    
                    
SbTime &             operator -=(const SbTime &tm)
Addition and subtraction of two times which modifies the time structure.

    SbTime    
                    
SbTime               operator -() const
Unary negation.

    SbTime    
                    
SbTime               operator *(double s, const SbTime &tm)    
SbTime    
                    
SbTime               operator *(const SbTime &tm, double s)    
SbTime    
                    
SbTime               operator /(const SbTime &tm, double s)
Multiplication and division by scalar.

    SbTime &    
                    
SbTime &             operator *=(double s)    
SbTime &    
                    
SbTime &             operator /=(double s)
Destructive multiplication and division by scalar.

    double    
                    
double               operator /(const SbTime &tm) const
Division by another time.

    SbTime    
                    
SbTime               operator %(const SbTime &tm) const
Modulus for two times (remainder when time1 is divided by time2).

    int    
                    
int                  operator ==(const SbTime &tm) const    
int    
                    
int                  operator !=(const SbTime &tm) const
Equality operators.

    SbBool    
                    
SbBool               operator <(const SbTime &tm) const    
SbBool    
                    
SbBool               operator >(const SbTime &tm) const    
SbBool    
                    
SbBool               operator <=(const SbTime &tm) const    
SbBool    
                    
SbBool               operator >=(const SbTime &tm) const
Relational operators.

FILE FORMAT/DEFAULTS

SEE ALSO

cftime

Search for    or go to Top of page |  Section 3 |  Main Index


SBTIME(3IV) (-->)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.