Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

msec Class Reference

#include <msec.h>

List of all members.


Detailed Description

Time handling...

Definition at line 79 of file msec.h.

Public Member Functions

 msec ()
 Constructor, sets the time to the current system time.

 msec (const msec &in_msec)
 Constructor using another msec object.

 msec (const int sec, const int milsec)
 Constructor using seconds and milli sconds.

msecoperator-= (const long millisec)
msecoperator-= (const timeval &t1)
msecoperator+= (const long millisec)
msecoperator+= (const timeval &t1)
msecoperator= (const msec &t)
msecoperator= (const timeval &t1)
 operator unsigned long () const
 Use as an unsigned long.

void refresh ()
 Set the time to the current system time.

void SetInfinite ()
 Set the object out into the future as far as possible.

int IsInfinite () const
 Check if the time is infinite.

void GetDelta (const msec &future, timeval &timeout) const
 Get the difference between this and the given time.

void GetDeltaFromNow (timeval &timeout) const
 Get the difference between this object and the current system time.

const char * get_printable () const
 Return the time as printable string.


Private Attributes

timeval m_time
char m_output_buffer [MSECOUTBUF]

Friends

DLLOPT friend int operator== (const msec &t1, const msec &t2)
DLLOPT friend int operator!= (const msec &t1, const msec &t2)
DLLOPT friend int operator< (const msec &t1, const msec &t2)
DLLOPT friend int operator> (const msec &t1, const msec &t2)
DLLOPT friend int operator<= (const msec &t1, const msec &t2)
DLLOPT friend int operator>= (const msec &t1, const msec &t2)


Constructor & Destructor Documentation

msec::msec  )  [inline]
 

Constructor, sets the time to the current system time.

Definition at line 85 of file msec.h.

msec::msec const msec in_msec  )  [inline]
 

Constructor using another msec object.

Parameters:
in_msec - Time for this object

Definition at line 92 of file msec.h.

msec::msec const int  sec,
const int  milsec
[inline]
 

Constructor using seconds and milli sconds.

Parameters:
sec - Seconds
milsec - Milli seconds

Definition at line 100 of file msec.h.


Member Function Documentation

const char* msec::get_printable  )  const
 

Return the time as printable string.

void msec::GetDelta const msec future,
timeval &  timeout
const
 

Get the difference between this and the given time.

If future is before this objects time, "timeout" will be set to zero.

Parameters:
future - Time to compare to
timeout - Will be filled with the difference

Referenced by GetDeltaFromNow().

void msec::GetDeltaFromNow timeval &  timeout  )  const [inline]
 

Get the difference between this object and the current system time.

If the system time is before this objects time, "timeout" will be set to zero.

Parameters:
timeout - Will be filled with the difference

Definition at line 161 of file msec.h.

References GetDelta().

int msec::IsInfinite  )  const [inline]
 

Check if the time is infinite.

Returns:
True, if the time is infinite.

Definition at line 142 of file msec.h.

msec::operator unsigned long  )  const [inline]
 

Use as an unsigned long.

Returns:
Time in milli seconds

Definition at line 124 of file msec.h.

msec& msec::operator+= const timeval &  t1  ) 
 

msec& msec::operator+= const long  millisec  ) 
 

msec& msec::operator-= const timeval &  t1  ) 
 

msec& msec::operator-= const long  millisec  ) 
 

msec& msec::operator= const timeval &  t1  ) 
 

msec& msec::operator= const msec t  )  [inline]
 

Definition at line 116 of file msec.h.

References m_time.

void msec::refresh  ) 
 

Set the time to the current system time.

void msec::SetInfinite  )  [inline]
 

Set the object out into the future as far as possible.

Definition at line 135 of file msec.h.


Friends And Related Function Documentation

DLLOPT friend int operator!= const msec t1,
const msec t2
[friend]
 

DLLOPT friend int operator< const msec t1,
const msec t2
[friend]
 

DLLOPT friend int operator<= const msec t1,
const msec t2
[friend]
 

Definition at line 107 of file msec.h.

DLLOPT friend int operator== const msec t1,
const msec t2
[friend]
 

DLLOPT friend int operator> const msec t1,
const msec t2
[friend]
 

DLLOPT friend int operator>= const msec t1,
const msec t2
[friend]
 

Definition at line 109 of file msec.h.


Member Data Documentation

char msec::m_output_buffer[MSECOUTBUF] [private]
 

Definition at line 171 of file msec.h.

timeval msec::m_time [private]
 

Definition at line 170 of file msec.h.

Referenced by operator=().


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 22:42:18 2005 for SNMP++ by doxygen 1.3.2