Panda3D

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

This class is to provide a consistant interface and storage to clock time More...

`#include "time_clock.h"`

## Public Member Functions
| Time_Clock (const Time_Clock &timeSrc)
| yet another constructor More...
| Time_Clock (const timeval &in_mytime)
| Time_Clock (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds=0, int nDST=-1)
| Construction from parts. More...
| Time_Clock (long secs, long usecs)
| Constructor that takes in sec and usecs. More...
| Time_Clock (time_t time)
| The Constructor that take a time_t objext. 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 size_t strftime( char *strDest, size_t maxsize, const char *format, const struct tm *timeptr );. More...
int | GetDay () const
int | GetDayOfWeek () const
struct tm * | GetGmtTm (struct tm *ptm) const
| Access the stored time and converts 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. More...
int | GetHour () const
struct tm * | GetLocalTm (struct tm *ptm) const
| Gets The local time in a tm structre from the internal time value. More...
int | GetMinute () const
int | GetMonth () const
int | GetSecond () const
time_t | GetTime () const
time_t | GetTime_t ()
const timeval & | GetTval ()
const timeval & | GetTval () const
long | GetUsecPart ()
int | GetYear () const
bool | operator!= (const Time_Clock &time) const
| .is time != More...
const Time_Clock & | operator+= (const Time_Span &Time_Span)
const Time_Clock & | operator-= (const Time_Span &Time_Span)
bool | operator< (const Time_Clock &time) const
bool | operator<= (const Time_Clock &time) const
const Time_Clock & | operator= (const Time_Clock &timeSrc)
const Time_Clock & | operator= (time_t t)
bool | operator== (const Time_Clock &time) const
bool | operator> (const Time_Clock &time) const
bool | operator>= (const Time_Clock &time) const
void | Set (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds=0, int nDST=-1)
void | ToCurrentTime ()
| Load this object with the current OS time. More...

## Static Public Member Functions
static Time_Clock | GetCurrentTime ()
| The Default no param constructor. More...

## Friends
class | Time_Span

## Detailed Description

This class is to provide a consistant interface and storage to clock time

. Epoch based time to the second

jan-2000 .. rhh changing all time to use sub second timing...

Definition at line 14 of file time_clock.h.

## Constructor & Destructor Documentation

## ◆ Time_Clock() [1/4]

Time_Clock::Time_Clock | ( | time_t | time | ) |
| inline

The Constructor that take a time_t objext.

Definition at line 266 of file time_clock.h.

## ◆ Time_Clock() [2/4]

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

Constructor that takes in sec and usecs.

Definition at line 275 of file time_clock.h.

## ◆ Time_Clock() [3/4]

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

Construction from parts.

Definition at line 83 of file time_clock.h.

## ◆ Time_Clock() [4/4]

Time_Clock::Time_Clock | ( | const Time_Clock & | timeSrc | ) |
| inline

yet another constructor

Definition at line 285 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.

Definition at line 181 of file time_clock.h.

References GetLocalTm().

## ◆ 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 );.

Definition at line 225 of file time_clock.h.

References GetGmtTm().

## ◆ GetCurrentTime()

Time_Clock Time_Clock::GetCurrentTime | ( |  | ) |
| inline static

The Default no param constructor.

. Will set time to current system time

Definition at line 127 of file time_clock.h.

## ◆ GetGmtTm()

struct tm * Time_Clock::GetGmtTm | ( | struct tm * | ptm | ) | const
| inline

Access the stored time and converts 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.

Definition at line 153 of file time_clock.h.

Referenced by FormatGmt().

## ◆ GetLocalTm()

struct tm * Time_Clock::GetLocalTm | ( | struct tm * | ptm | ) | const
| inline

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

Definition at line 166 of file time_clock.h.

Referenced by Format().

## ◆ operator!=()

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

.is time !=

Definition at line 302 of file time_clock.h.

## ◆ operator==()

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

. is time equal

Definition at line 294 of file time_clock.h.

## ◆ ToCurrentTime()

void Time_Clock::ToCurrentTime | ( |  | ) |
| inline

Load this object with the current OS time.

Definition at line 143 of file time_clock.h.

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

- panda/src/nativenet/time_clock.h
- panda/src/nativenet/time_general.h