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

Protected Attributes | Private Member Functions

PTimeInterval Class Reference

#include <timeint.h>

Inheritance diagram for PTimeInterval:
Inheritance graph
Collaboration diagram for PTimeInterval:
Collaboration graph

List of all members.

Public Member Functions

 PTimeInterval (PInt64 millisecs=0)
 PTimeInterval (long millisecs, long seconds, long minutes=0, long hours=0, int days=0)
 PTimeInterval (const PString &str)
Overrides from class PObject
PObjectClone () const
virtual Comparison Compare (const PObject &obj) const
virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
Access functions
PInt64 GetMilliSeconds () const
long GetSeconds () const
long GetMinutes () const
int GetHours () const
int GetDays () const
DWORD GetInterval () const
virtual void SetInterval (PInt64 milliseconds=0, long seconds=0, long minutes=0, long hours=0, int days=0)
PTimeInterval operator- () const
PTimeInterval operator+ (const PTimeInterval &interval) const
PTimeIntervaloperator+= (const PTimeInterval &interval)
PTimeInterval operator- (const PTimeInterval &interval) const
PTimeIntervaloperator-= (const PTimeInterval &interval)
PTimeInterval operator* (int factor) const
PTimeIntervaloperator*= (int factor)
PTimeInterval operator/ (int factor) const
PTimeIntervaloperator/= (int factor)
Comparison functions
bool operator== (const PTimeInterval &interval) const
bool operator== (long msecs) const
bool operator!= (const PTimeInterval &interval) const
bool operator!= (long msecs) const
bool operator> (const PTimeInterval &interval) const
bool operator> (long msecs) const
bool operator>= (const PTimeInterval &interval) const
bool operator>= (long msecs) const
bool operator< (const PTimeInterval &interval) const
bool operator< (long msecs) const
bool operator<= (const PTimeInterval &interval) const
bool operator<= (long msecs) const
Miscellaneous functions
virtual PINDEX HashFunction () const

Protected Attributes

PInt64 milliseconds
 Number of milliseconds in time interval.

Private Member Functions

 PCLASSINFO (PTimeInterval, PObject)


I/O functions
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Conversion functions

enum  Formats { NormalFormat, IncludeDays, SecondsOnly }
PString AsString (int decimals=3, Formats format=NormalFormat, int width=1) const

Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator>= (const PObject &obj) const

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
BOOL IsClass (const char *cls) const
virtual BOOL InternalIsDescendant (const char *clsName) const
static const char * Class ()

Detailed Description

This class defines an arbitrary time interval to millisecond accuracy. The interval can be both positive and negative.

A long int is used to store the time interval so it is limited to LONG_MAX (found in the standard C header file limits.h) milliseconds. This is approximately 596 hours for 32 bit integers.

There is a constant, PMaxTimeInterval# which defines the maximum number of milliseconds that a time interval may be.

Definition at line 150 of file timeint.h.

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

Generated by  Doxygen 1.6.0   Back to index