CLinearTimeDelta Class Reference

#include <timeutil.h>


Public Member Functions

 CLinearTimeDelta (void)
 CLinearTimeDelta (INT64 arg_t100ns)
 CLinearTimeDelta (CLinearTimeAbsolute, CLinearTimeAbsolute)
void ReturnTimeValueStruct (struct timeval *tv)
long ReturnMilliseconds (void)
INT64 ReturnMicroseconds (void)
long ReturnDays (void)
long ReturnSeconds (void)
char * ReturnSecondsString (int nFracDigits=0)
INT64 Return100ns (void)
void SetTimeValueStruct (struct timeval *tv)
void SetMilliseconds (unsigned long arg_dwMilliseconds)
void SetSeconds (INT64 arg_tSeconds)
void SetSecondsString (char *arg_szSeconds)
void Set100ns (INT64 arg_t100ns)
void operator+= (const CLinearTimeDelta &ltd)

Private Attributes

INT64 m_tDelta

Static Private Attributes

static char m_Buffer [204]

Friends

class CLinearTimeAbsolute
bool operator< (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
bool operator> (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
bool operator== (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
bool operator<= (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
bool operator!= (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
CLinearTimeDelta operator- (const CLinearTimeAbsolute &lta, const CLinearTimeAbsolute &ltb)
CLinearTimeDelta operator- (const CLinearTimeDelta &lta, const CLinearTimeDelta &ltb)
int operator/ (const CLinearTimeDelta &ltdA, const CLinearTimeDelta &ltdB)
CLinearTimeDelta operator * (const CLinearTimeDelta &ltdA, int nScaler)
CLinearTimeAbsolute operator+ (const CLinearTimeAbsolute &ltdA, const CLinearTimeDelta &ltdB)
CLinearTimeAbsolute operator- (const CLinearTimeAbsolute &lta, const CLinearTimeDelta &ltd)


Detailed Description

Definition at line 80 of file timeutil.h.


Constructor & Destructor Documentation

CLinearTimeDelta::CLinearTimeDelta ( void   ) 

Definition at line 687 of file timeutil.cpp.

References m_tDelta.

00688 {
00689     m_tDelta = 0;
00690 }

CLinearTimeDelta::CLinearTimeDelta ( INT64  arg_t100ns  ) 

Definition at line 692 of file timeutil.cpp.

References m_tDelta.

00693 {
00694     m_tDelta = arg_t100ns;
00695 }

CLinearTimeDelta::CLinearTimeDelta ( CLinearTimeAbsolute  ,
CLinearTimeAbsolute   
)

Definition at line 1142 of file timeutil.cpp.

References CLinearTimeAbsolute::m_tAbsolute, and m_tDelta.

01143 {
01144     m_tDelta = t1.m_tAbsolute - t0.m_tAbsolute;
01145 }


Member Function Documentation

void CLinearTimeDelta::operator+= ( const CLinearTimeDelta ltd  ) 

Definition at line 1176 of file timeutil.cpp.

References m_tDelta.

01177 {
01178     m_tDelta += ltd.m_tDelta;
01179 }

INT64 CLinearTimeDelta::Return100ns ( void   ) 

Definition at line 762 of file timeutil.cpp.

References m_tDelta.

Referenced by report_timecheck().

00763 {
00764     return m_tDelta;
00765 }

long CLinearTimeDelta::ReturnDays ( void   ) 

Definition at line 1147 of file timeutil.cpp.

References m_tDelta.

01148 {
01149     return (long)(m_tDelta/FACTOR_100NS_PER_DAY);
01150 }

INT64 CLinearTimeDelta::ReturnMicroseconds ( void   ) 

Definition at line 742 of file timeutil.cpp.

References FACTOR_100NS_PER_MICROSECOND, and m_tDelta.

Referenced by CMuxAlarm::Sleep().

00743 {
00744     return m_tDelta/FACTOR_100NS_PER_MICROSECOND;
00745 }

long CLinearTimeDelta::ReturnMilliseconds ( void   ) 

Definition at line 737 of file timeutil.cpp.

References FACTOR_100NS_PER_MILLISECOND, and m_tDelta.

Referenced by report_timecheck().

00738 {
00739     return (long)(m_tDelta/FACTOR_100NS_PER_MILLISECOND);
00740 }

long CLinearTimeDelta::ReturnSeconds ( void   ) 

Definition at line 1152 of file timeutil.cpp.

References m_tDelta.

Referenced by CallBack_ShowDispatches(), check_idle(), check_mail_expiration(), dump_users(), fetch_connect(), fetch_idle(), FUNCTION(), list_db_stats(), list_options(), report_timecheck(), ShowPsLine(), shutdownsock(), and CMuxAlarm::Sleep().

01153 {
01154     return (long)(m_tDelta/FACTOR_100NS_PER_SECOND);
01155 }

char * CLinearTimeDelta::ReturnSecondsString ( int  nFracDigits = 0  ) 

Definition at line 665 of file timeutil.cpp.

References ConvertToSecondsString(), m_Buffer, and m_tDelta.

Referenced by do_command(), list_options(), and Task_RunQueueEntry().

00666 {
00667     ConvertToSecondsString(m_Buffer, m_tDelta, nFracDigits);
00668     return m_Buffer;
00669 }

void CLinearTimeDelta::ReturnTimeValueStruct ( struct timeval *  tv  ) 

Definition at line 697 of file timeutil.cpp.

References FACTOR_100NS_PER_MICROSECOND, i64FloorDivision(), i64FloorDivisionMod(), and m_tDelta.

Referenced by CMuxAlarm::Set().

00698 {
00699     INT64 Leftover;
00700     tv->tv_sec = (long)i64FloorDivisionMod(m_tDelta, FACTOR_100NS_PER_SECOND, &Leftover);
00701     tv->tv_usec = (long)i64FloorDivision(Leftover, FACTOR_100NS_PER_MICROSECOND);
00702 }

void CLinearTimeDelta::Set100ns ( INT64  arg_t100ns  ) 

Definition at line 757 of file timeutil.cpp.

References m_tDelta.

Referenced by ConvertAllFieldsToLinearTime(), create_obj(), GetProcessorUsage(), initialize_objects(), and report_timecheck().

00758 {
00759     m_tDelta = arg_t100ns;
00760 }

void CLinearTimeDelta::SetMilliseconds ( unsigned long  arg_dwMilliseconds  ) 

Definition at line 732 of file timeutil.cpp.

References FACTOR_100NS_PER_MILLISECOND, and m_tDelta.

00733 {
00734     m_tDelta = arg_dwMilliseconds * FACTOR_100NS_PER_MILLISECOND;
00735 }

void CLinearTimeDelta::SetSeconds ( INT64  arg_tSeconds  ) 

Definition at line 752 of file timeutil.cpp.

References m_tDelta.

Referenced by cf_init(), ConvertAllFieldsToLinearTime(), dispatch_CacheTick(), dispatch_DatabaseDump(), dispatch_FreeListReconstruction(), dispatch_IdleCheck(), do_queue(), do_timewarp(), init_timer(), SetupGlobalThrottle(), SetupThrottle(), and CHashFile::Tick().

00753 {
00754     m_tDelta = arg_tSeconds * FACTOR_100NS_PER_SECOND;
00755 }

void CLinearTimeDelta::SetSecondsString ( char *  arg_szSeconds  ) 

Definition at line 747 of file timeutil.cpp.

References m_tDelta, and ParseFractionalSecondsString().

Referenced by CF_HAND(), and do_wait().

00748 {
00749     ParseFractionalSecondsString(m_tDelta, arg_szSeconds);
00750 }

void CLinearTimeDelta::SetTimeValueStruct ( struct timeval *  tv  ) 

Definition at line 713 of file timeutil.cpp.

References FACTOR_100NS_PER_MICROSECOND, and m_tDelta.

Referenced by GetProcessorUsage().

00714 {
00715     m_tDelta = FACTOR_100NS_PER_SECOND * tv->tv_sec
00716              + FACTOR_100NS_PER_MICROSECOND * tv->tv_usec;
00717 }


Friends And Related Function Documentation

friend class CLinearTimeAbsolute [friend]

Definition at line 82 of file timeutil.h.

CLinearTimeDelta operator * ( const CLinearTimeDelta ltdA,
int  nScaler 
) [friend]

Definition at line 1207 of file timeutil.cpp.

01208 {
01209     CLinearTimeDelta ltdResult;
01210     ltdResult.m_tDelta = ltd.m_tDelta * Scale;
01211     return ltdResult;
01212 }

bool operator!= ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 439 of file timeutil.cpp.

00440 {
00441     return lta.m_tDelta != ltb.m_tDelta;
00442 }

CLinearTimeAbsolute operator+ ( const CLinearTimeAbsolute ltdA,
const CLinearTimeDelta ltdB 
) [friend]

Definition at line 1195 of file timeutil.cpp.

01196 {
01197     CLinearTimeAbsolute lta;
01198     lta.m_tAbsolute = ltaA.m_tAbsolute + ltdB.m_tDelta;
01199     return lta;
01200 }

CLinearTimeAbsolute operator- ( const CLinearTimeAbsolute lta,
const CLinearTimeDelta ltd 
) [friend]

Definition at line 454 of file timeutil.cpp.

00455 {
00456     CLinearTimeAbsolute t;
00457     t.m_tAbsolute = lta.m_tAbsolute - ltd.m_tDelta;
00458     return t;
00459 }

CLinearTimeDelta operator- ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 1188 of file timeutil.cpp.

01189 {
01190     CLinearTimeDelta ltd;
01191     ltd.m_tDelta = lta.m_tDelta - ltb.m_tDelta;
01192     return ltd;
01193 }

CLinearTimeDelta operator- ( const CLinearTimeAbsolute lta,
const CLinearTimeAbsolute ltb 
) [friend]

Definition at line 1181 of file timeutil.cpp.

01182 {
01183     CLinearTimeDelta ltd;
01184     ltd.m_tDelta = ltaA.m_tAbsolute - ltaB.m_tAbsolute;
01185     return ltd;
01186 }

int operator/ ( const CLinearTimeDelta ltdA,
const CLinearTimeDelta ltdB 
) [friend]

Definition at line 1214 of file timeutil.cpp.

01215 {
01216     int iResult = (int)(ltdA.m_tDelta / ltdB.m_tDelta);
01217     return iResult;
01218 }

bool operator< ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 1220 of file timeutil.cpp.

01221 {
01222     return ltdA.m_tDelta < ltdB.m_tDelta;
01223 }

bool operator<= ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 444 of file timeutil.cpp.

00445 {
00446     return lta.m_tDelta <= ltb.m_tDelta;
00447 }

bool operator== ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 434 of file timeutil.cpp.

00435 {
00436     return lta.m_tDelta == ltb.m_tDelta;
00437 }

bool operator> ( const CLinearTimeDelta lta,
const CLinearTimeDelta ltb 
) [friend]

Definition at line 1225 of file timeutil.cpp.

01226 {
01227     return ltdA.m_tDelta > ltdB.m_tDelta;
01228 }


Field Documentation

char CLinearTimeDelta::m_Buffer [static, private]

Definition at line 97 of file timeutil.h.

Referenced by ReturnSecondsString().

INT64 CLinearTimeDelta::m_tDelta [private]

Definition at line 96 of file timeutil.h.

Referenced by CLinearTimeAbsolute::CLinearTimeAbsolute(), CLinearTimeDelta(), operator *(), operator!=(), operator+(), CLinearTimeAbsolute::operator+=(), operator+=(), operator-(), CLinearTimeAbsolute::operator-=(), operator/(), operator<(), operator<=(), operator==(), operator>(), Return100ns(), ReturnDays(), ReturnMicroseconds(), ReturnMilliseconds(), ReturnSeconds(), ReturnSecondsString(), ReturnTimeValueStruct(), Set100ns(), SetMilliseconds(), SetSeconds(), SetSecondsString(), SetTimeValueStruct(), and CLinearTimeAbsolute::UTC2Local().


The documentation for this class was generated from the following files:
Generated on Mon May 28 04:40:24 2007 for MUX by  doxygen 1.4.7