Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Timespan Class Reference

#include <Timespan.h>

List of all members.


Detailed Description

A class that represents time spans up to microsecond resolution.

Definition at line 50 of file Timespan.h.


Public Types

typedef Timestamp::TimeDiff TimeDiff

Public Member Functions

Timespanassign (long seconds, long microseconds)
 Assigns a new span.
Timespanassign (int days, int hours, int minutes, int seconds, int microseconds)
 Assignment operator.
int days () const
int hours () const
 Returns the number of days.
int microseconds () const
 Returns the total number of milliseconds.
int milliseconds () const
 Returns the total number of seconds.
int minutes () const
 Returns the total number of hours.
bool operator!= (TimeDiff microseconds) const
bool operator!= (const Timespan &ts) const
Timespan operator+ (TimeDiff microseconds) const
Timespan operator+ (const Timespan &d) const
Timespanoperator+= (TimeDiff microseconds)
Timespanoperator+= (const Timespan &d)
Timespan operator- (TimeDiff microseconds) const
Timespan operator- (const Timespan &d) const
Timespanoperator-= (TimeDiff microseconds)
Timespanoperator-= (const Timespan &d)
bool operator< (TimeDiff microseconds) const
bool operator< (const Timespan &ts) const
bool operator<= (TimeDiff microseconds) const
bool operator<= (const Timespan &ts) const
Timespanoperator= (TimeDiff microseconds)
 Assignment operator.
Timespanoperator= (const Timespan &timespan)
 Destroys the Timespan.
bool operator== (TimeDiff microseconds) const
bool operator== (const Timespan &ts) const
 Swaps the Timespan with another one.
bool operator> (TimeDiff microseconds) const
bool operator> (const Timespan &ts) const
bool operator>= (TimeDiff microseconds) const
bool operator>= (const Timespan &ts) const
int seconds () const
 Returns the total number of minutes.
void swap (Timespan &timespan)
 Timespan (const Timespan &timespan)
 Creates a Timespan.
 Timespan (int days, int hours, int minutes, int seconds, int microseconds)
 Timespan (long seconds, long microseconds)
 Creates a Timespan.
 Timespan (TimeDiff microseconds)
 Creates a zero Timespan.
int totalHours () const
 Returns the number of hours (0 to 23).
TimeDiff totalMicroseconds () const
TimeDiff totalMilliseconds () const
 Returns the number of milliseconds (0 to 999).
int totalMinutes () const
 Returns the number of minutes (0 to 59).
int totalSeconds () const
 Returns the number of seconds (0 to 59).
int useconds () const
 ~Timespan ()
 Creates a Timespan from another one.

Static Public Attributes

static const TimeDiff DAYS = 24*Timespan::HOURS
 The number of microseconds in a hour.
static const TimeDiff HOURS = 60*Timespan::MINUTES
 The number of microseconds in a minute.
static const TimeDiff MILLISECONDS = 1000
 Returns the total number of microseconds.
static const TimeDiff MINUTES = 60*Timespan::SECONDS
 The number of microseconds in a second.
static const TimeDiff SECONDS = 1000*Timespan::MILLISECONDS
 The number of microseconds in a millisecond.

Private Attributes

TimeDiff _span
 The number of microseconds in a day.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index