gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Time Class Reference

#include <Time.H>

Inheritance diagram for Time:
[legend]
Collaboration diagram for Time:
[legend]

Public Member Functions

 Time ()
 
 Time (long sec, long usec)
 
virtual ~Time ()
 
glong getSecs () const
 
glong getUSecs () const
 
TimegetTime ()
 
Time operator- (const Time &t)
 
Timeoperator-= (const Time &t)
 
Time operator+ (const Time &t)
 
Timeoperator+= (const Time &t)
 

Static Public Member Functions

static string getTimeString ()
 
static string getTimeString (char *formatStr)
 

Private Attributes

GTimeVal time
 

Friends

ostream & operator<< (ostream &o, const Time &t)
 

Additional Inherited Members

- Static Protected Attributes inherited from TimeFormat< 0 >
static char timeFormat []
 The time format to use for converting seconds to a human readable time. More...
 

Detailed Description

Cross platform time.

Examples:
TimeTest.C.

Definition at line 41 of file Time.H.

Constructor & Destructor Documentation

◆ Time() [1/2]

Time::Time ( )
inline

Definition at line 45 of file Time.H.

◆ Time() [2/2]

Time::Time ( long  sec,
long  usec 
)
inline

Construct and initialise the time.

Parameters
secThe seconds component of the time.
usecThe micro-seconds component of the time.

Definition at line 51 of file Time.H.

◆ ~Time()

virtual Time::~Time ( )
inlinevirtual

Definition at line 56 of file Time.H.

Member Function Documentation

◆ getSecs()

glong Time::getSecs ( ) const
inline

get sex : returns the seconds component of the time variable.

Returns
the seconds value of the private time variable.
Examples:
TimeTest.C.

Definition at line 61 of file Time.H.

Here is the caller graph for this function:

◆ getTime()

Time& Time::getTime ( )
inline

Get the current time.

Returns
A reference to this object for use with operators.

Definition at line 71 of file Time.H.

◆ getTimeString() [1/2]

static string Time::getTimeString ( )
inlinestatic

Get a textual representation of the current time. Uses the timeFormat string to format the time into a string.

Returns
the time as a string, and empty string on error

Definition at line 122 of file Time.H.

◆ getTimeString() [2/2]

static string Time::getTimeString ( char *  formatStr)
inlinestatic

Get a textual representation of the current time.

Parameters
formatStrthe format to use when turning the time into a string, if NULL, then use timeFormat.
Returns
the time as a string, and empty string on error

Definition at line 130 of file Time.H.

◆ getUSecs()

glong Time::getUSecs ( ) const
inline

get u sex : returns the micro-seconds component of the time variable.

Returns
the seconds value of the private time variable.

Definition at line 66 of file Time.H.

Here is the caller graph for this function:

◆ operator+()

Time Time::operator+ ( const Time t)
inline

Addition operator : add the provided time from the local time variable.

Parameters
tThe time to add.
Returns
this time plus the provided time.

Definition at line 97 of file Time.H.

Here is the call graph for this function:

◆ operator+=()

Time& Time::operator+= ( const Time t)
inline

Addition and assign operator : add the provided time from the local time variable.

Parameters
tThe time to add.
Returns
A reference to this Time class, where this time plus the provided time.

Definition at line 105 of file Time.H.

Here is the call graph for this function:

◆ operator-()

Time Time::operator- ( const Time t)
inline

Subtraction operator : subtract the provided time from the local time variable.

Parameters
tThe time to subtract.
Returns
this time minus the provided time.

Definition at line 80 of file Time.H.

Here is the call graph for this function:

◆ operator-=()

Time& Time::operator-= ( const Time t)
inline

Subtract and assign operator : subtract the provided time from the local time variable.

Parameters
tThe time to subtract.
Returns
A reference to this Time class, this time minus the provided time.

Definition at line 88 of file Time.H.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  o,
const Time t 
)
friend

Definition at line 110 of file Time.H.

Member Data Documentation

◆ time

GTimeVal Time::time
private

Definition at line 42 of file Time.H.


The documentation for this class was generated from the following file:
gtkIOStream: Time Class Reference
GTK+ IOStream  Beta