SNMP++  3.3.4
msec Class Reference

Time handling... More...

#include <msec.h>

Collaboration diagram for msec:

Public Member Functions

 msec ()
 Constructor, sets the time to the current system time. More...
 
 msec (const msec &in_msec)
 Constructor using another msec object. More...
 
 msec (const int sec, const int milsec)
 Constructor using seconds and milli sconds. More...
 
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. More...
 
void refresh ()
 Set the time to the current system time. More...
 
void SetInfinite ()
 Set the object out into the future as far as possible. More...
 
int IsInfinite () const
 Check if the time is infinite. More...
 
void GetDelta (const msec &future, timeval &timeout) const
 Get the difference between this and the given time. More...
 
void GetDeltaFromNow (timeval &timeout) const
 Get the difference between this object and the current system time. More...
 
const char * get_printable () const
 Return the time as printable string. More...
 

Private Attributes

timeval m_time
 
SNMP_PP_MUTABLE char m_output_buffer [MSECOUTBUF]
 
SNMP_PP_MUTABLE bool m_changed
 

Static Private Attributes

static SnmpSynchronized m_localtime_mutex
 

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)
 

Detailed Description

Time handling...

Definition at line 79 of file msec.h.

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 163 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 144 of file msec.h.

msec::operator unsigned long ( ) const
inline

Use as an unsigned long.

Returns
Time in milli seconds

Definition at line 125 of file msec.h.

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.

msec& msec::operator= ( const timeval &  t1)
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 136 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

SNMP_PP_MUTABLE bool msec::m_changed
private

Definition at line 174 of file msec.h.

SnmpSynchronized msec::m_localtime_mutex
staticprivate

Definition at line 178 of file msec.h.

SNMP_PP_MUTABLE char msec::m_output_buffer[MSECOUTBUF]
private

Definition at line 173 of file msec.h.

timeval msec::m_time
private

Definition at line 172 of file msec.h.

Referenced by operator=().


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