Panda3D
Public Member Functions | Static Public Member Functions | Friends | List of all members
Time_Clock Class Reference

Public Member Functions

 Time_Clock (timeval &in_mytime)
 
 Time_Clock ()
 Return type : inline. More...
 
 Time_Clock (time_t time)
 The Constructor that take a time_t objext Return type : inline Argument : time_t time. More...
 
 Time_Clock (long secs, long usecs)
 Constructor that takes in sec and usecs. More...
 
 Time_Clock (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds=0, int nDST=-1)
 Construction from parts Argument : int nYear Argument : int nMonth Argument : int nDay Argument : int nHour Argument : int nMin Argument : int nSec Argument : int nDST. More...
 
 Time_Clock (const Time_Clock &timeSrc)
 yet another constructor Return type : inline Argument : const Time_Clock& timeSrc More...
 
std::string Format (const char *pFormat) const
 Used to allow access to the "C" library strftime functions. More...
 
std::string FormatGmt (const char *pFormat) const
 A Wraper to. More...
 
int GetDay () const
 Return type : inline int. More...
 
int GetDayOfWeek () const
 Return type : inline int. More...
 
struct tm * GetGmtTm (struct tm *ptm=NULL) const
 Access the stored time and convers to a struct tm format If storage location is specified then it will stor information in the provided buffer else it will use the library's internal buffer space Return type : struct tm* Argument : struct tm* ptm. More...
 
int GetHour () const
 Return type : inline int. More...
 
struct tm * GetLocalTm (struct tm *ptm=NULL) const
 Gets The local time in a tm structre from the internal time value. More...
 
int GetMinute () const
 Return type : inline int. More...
 
int GetMonth () const
 Return type : inline int. More...
 
int GetSecond () const
 Return type : inline int. More...
 
time_t GetTime () const
 Return type : inline time_t. More...
 
time_t GetTime_t ()
 
const timeval & GetTval ()
 
const timeval & GetTval () const
 
unsigned long GetUsecPart ()
 
int GetYear () const
 Return type : inline int. More...
 
bool operator!= (const Time_Clock &time) const
 .is time != Return type : inline bool Argument : const Time_Clock &time More...
 
const Time_Clockoperator+= (const Time_Span &Time_Span)
 Return type : inline const Argument : Time_Span &Time_Span. More...
 
const Time_Clockoperator-= (const Time_Span &Time_Span)
 Return type : inline const Argument : Time_Span &Time_Span. More...
 
bool operator< (const Time_Clock &time) const
 Return type : inline bool Argument : const Time_Clock &time. More...
 
bool operator<= (const Time_Clock &time) const
 Return type : inline bool Argument : const Time_Clock &time. More...
 
const Time_Clockoperator= (const Time_Clock &timeSrc)
 Return type : inline const Argument : const Time_Clock& timeSrc. More...
 
const Time_Clockoperator= (time_t t)
 Return type : inline const Argument : time_t t. More...
 
bool operator== (const Time_Clock &time) const
 
bool operator> (const Time_Clock &time) const
 Return type : inline bool Argument : const Time_Clock &time. More...
 
bool operator>= (const Time_Clock &time) const
 Return type : inline bool Argument : const Time_Clock &time. More...
 
void Set (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds=0, int nDST=-1)
 Return type : inline Argument : int nYear Argument : int nMonth Argument : int nDay Argument : int nHour Argument : int nMin Argument : int nSec Argument : unsigned long microseconds Argument : int nDST. More...
 
void ToCurrentTime ()
 Load this object with the current OS time Return type : inline void Argument : void. More...
 

Static Public Member Functions

static Time_Clock GetCurrentTime ()
 The Default no param constructor. More...
 

Friends

class Time_Span
 

Detailed Description

Definition at line 20 of file time_clock.h.

Constructor & Destructor Documentation

◆ Time_Clock() [1/5]

Time_Clock::Time_Clock ( )
inline

Return type : inline.

Definition at line 169 of file time_clock.h.

Referenced by GetCurrentTime().

◆ Time_Clock() [2/5]

Time_Clock::Time_Clock ( time_t  time)
inline

The Constructor that take a time_t objext Return type : inline Argument : time_t time.

Definition at line 323 of file time_clock.h.

◆ Time_Clock() [3/5]

Time_Clock::Time_Clock ( long  secs,
long  usecs 
)
inline

Constructor that takes in sec and usecs.

Return type : inline Argument : long secs Argument : long usecs

Definition at line 335 of file time_clock.h.

◆ Time_Clock() [4/5]

Time_Clock::Time_Clock ( int  nYear,
int  nMonth,
int  nDay,
int  nHour,
int  nMin,
int  nSec,
unsigned long  microseconds = 0,
int  nDST = -1 
)
inline

Construction from parts Argument : int nYear Argument : int nMonth Argument : int nDay Argument : int nHour Argument : int nMin Argument : int nSec Argument : int nDST.

Definition at line 106 of file time_clock.h.

◆ Time_Clock() [5/5]

Time_Clock::Time_Clock ( const Time_Clock timeSrc)
inline

yet another constructor Return type : inline Argument : const Time_Clock& timeSrc

Definition at line 347 of file time_clock.h.

Member Function Documentation

◆ Format()

std::string Time_Clock::Format ( const char *  pFormat) const
inline

Used to allow access to the "C" library strftime functions.

Return type : std::string Argument : char * pFormat

Definition at line 231 of file time_clock.h.

Referenced by operator-=().

◆ FormatGmt()

std::string Time_Clock::FormatGmt ( const char *  pFormat) const
inline

A Wraper to.

size_t strftime( char *strDest, size_t maxsize, const char *format, const struct tm *timeptr );

Return type : inline std::string Argument : char * pFormat

Definition at line 279 of file time_clock.h.

◆ GetCurrentTime()

Time_Clock Time_Clock::GetCurrentTime ( )
inlinestatic

The Default no param constructor.

. Will set time to current system time Return type : Time_Clock

Definition at line 160 of file time_clock.h.

References Time_Clock().

Referenced by Time_Out::Expired(), operator-=(), Time_Out::Remaining(), and Time_Out::ReStart().

◆ GetDay()

int Time_Clock::GetDay ( ) const
inline

Return type : inline int.

Definition at line 475 of file time_clock.h.

References GetLocalTm().

◆ GetDayOfWeek()

int Time_Clock::GetDayOfWeek ( ) const
inline

Return type : inline int.

Definition at line 511 of file time_clock.h.

References GetLocalTm().

◆ GetGmtTm()

struct tm * Time_Clock::GetGmtTm ( struct tm *  ptm = NULL) const

Access the stored time and convers to a struct tm format If storage location is specified then it will stor information in the provided buffer else it will use the library's internal buffer space Return type : struct tm* Argument : struct tm* ptm.

Definition at line 191 of file time_clock.h.

◆ GetHour()

int Time_Clock::GetHour ( ) const
inline

Return type : inline int.

Definition at line 484 of file time_clock.h.

References GetLocalTm().

◆ GetLocalTm()

struct tm * Time_Clock::GetLocalTm ( struct tm *  ptm = NULL) const

Gets The local time in a tm structre from the internal time value.

Return type : struct tm* Argument : struct tm* ptm

Definition at line 208 of file time_clock.h.

Referenced by GetDay(), GetDayOfWeek(), GetHour(), GetMinute(), GetMonth(), GetSecond(), and GetYear().

◆ GetMinute()

int Time_Clock::GetMinute ( ) const
inline

Return type : inline int.

Definition at line 493 of file time_clock.h.

References GetLocalTm().

◆ GetMonth()

int Time_Clock::GetMonth ( ) const
inline

Return type : inline int.

Definition at line 466 of file time_clock.h.

References GetLocalTm().

◆ GetSecond()

int Time_Clock::GetSecond ( ) const
inline

Return type : inline int.

Definition at line 502 of file time_clock.h.

References GetLocalTm().

◆ GetTime()

time_t Time_Clock::GetTime ( ) const
inline

Return type : inline time_t.

Definition at line 448 of file time_clock.h.

◆ GetYear()

int Time_Clock::GetYear ( ) const
inline

Return type : inline int.

Definition at line 457 of file time_clock.h.

References GetLocalTm().

◆ operator!=()

bool Time_Clock::operator!= ( const Time_Clock time) const
inline

.is time != Return type : inline bool Argument : const Time_Clock &time

Definition at line 368 of file time_clock.h.

◆ operator+=()

const Time_Clock & Time_Clock::operator+= ( const Time_Span Time_Span)
inline

Return type : inline const Argument : Time_Span &Time_Span.

Definition at line 62 of file time_general.h.

◆ operator-=()

const Time_Clock & Time_Clock::operator-= ( const Time_Span Time_Span)
inline

Return type : inline const Argument : Time_Span &Time_Span.

Definition at line 99 of file time_general.h.

References Format(), GetCurrentTime(), and Set().

◆ operator<()

bool Time_Clock::operator< ( const Time_Clock time) const
inline

Return type : inline bool Argument : const Time_Clock &time.

Definition at line 379 of file time_clock.h.

◆ operator<=()

bool Time_Clock::operator<= ( const Time_Clock time) const
inline

Return type : inline bool Argument : const Time_Clock &time.

Definition at line 401 of file time_clock.h.

◆ operator=() [1/2]

const Time_Clock & Time_Clock::operator= ( const Time_Clock timeSrc)
inline

Return type : inline const Argument : const Time_Clock& timeSrc.

Definition at line 423 of file time_clock.h.

◆ operator=() [2/2]

const Time_Clock & Time_Clock::operator= ( time_t  t)
inline

Return type : inline const Argument : time_t t.

Definition at line 437 of file time_clock.h.

◆ operator==()

bool Time_Clock::operator== ( const Time_Clock time) const
inline

. is time equal Return type : inline bool Argument : const Time_Clock &time

Definition at line 358 of file time_clock.h.

◆ operator>()

bool Time_Clock::operator> ( const Time_Clock time) const
inline

Return type : inline bool Argument : const Time_Clock &time.

Definition at line 390 of file time_clock.h.

◆ operator>=()

bool Time_Clock::operator>= ( const Time_Clock time) const
inline

Return type : inline bool Argument : const Time_Clock &time.

Definition at line 412 of file time_clock.h.

◆ Set()

void Time_Clock::Set ( int  nYear,
int  nMonth,
int  nDay,
int  nHour,
int  nMin,
int  nSec,
unsigned long  microseconds = 0,
int  nDST = -1 
)
inline

Return type : inline Argument : int nYear Argument : int nMonth Argument : int nDay Argument : int nHour Argument : int nMin Argument : int nSec Argument : unsigned long microseconds Argument : int nDST.

Definition at line 137 of file time_clock.h.

Referenced by operator-=().

◆ ToCurrentTime()

void Time_Clock::ToCurrentTime ( )
inline

Load this object with the current OS time Return type : inline void Argument : void.

Definition at line 179 of file time_clock.h.


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