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

PTimeInterval Class Reference

#include <timeint.h>

Inheritance diagram for PTimeInterval:

PObject PTimer

List of all members.

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.

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

Conversion functions

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

Run Time Type functions

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

Public Member Functions

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
int GetDays () const
int GetHours () const
DWORD GetInterval () const
PInt64 GetMilliSeconds () const
long GetMinutes () const
long GetSeconds () const
virtual void SetInterval (PInt64 milliseconds=0, long seconds=0, long minutes=0, long hours=0, int days=0)
Miscellaneous functions
virtual PINDEX HashFunction () const
Comparison functions
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
bool operator>= (const PTimeInterval &interval) const
PTimeInterval operator* (int factor) const
PTimeIntervaloperator*= (int factor)
PTimeInterval operator+ (const PTimeInterval &interval) const
PTimeIntervaloperator+= (const PTimeInterval &interval)
PTimeInterval operator- (const PTimeInterval &interval) const
PTimeInterval operator- () const
PTimeIntervaloperator-= (const PTimeInterval &interval)
PTimeInterval operator/ (int factor) const
PTimeIntervaloperator/= (int factor)
 PTimeInterval (const PString &str)
 PTimeInterval (long millisecs, long seconds, long minutes=0, long hours=0, int days=0)
 PTimeInterval (PInt64 millisecs=0)

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)

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

Generated by  Doxygen 1.6.0   Back to index