Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

TrueClock Class Reference

An interface to whatever real-time clock we might have available in the current environment. More...

#include "trueClock.h"

List of all members.

Public Member Functions

int get_error_count () const
 Returns the number of clock errors that have been detected.
double get_long_time ()
double get_short_raw_time ()
double get_short_time ()
bool set_cpu_affinity (PN_uint32 mask) const

Static Public Member Functions

static TrueClockget_global_ptr ()
 Returns a pointer to the one TrueClock object in the world.

Protected Member Functions

 ~TrueClock ()
 A protected destructor because no one should try to delete the global TrueClock.

Protected Attributes

int _error_count

Static Protected Attributes

static TrueClock_global_ptr = NULL

Detailed Description

An interface to whatever real-time clock we might have available in the current environment.

There is only one TrueClock in existence, and it constructs itself.

The TrueClock returns elapsed real time in seconds since some undefined epoch. Since it is not defined at what time precisely the clock indicates zero, this value can only be meaningfully used to measure elapsed time, by sampling it at two different times and subtracting.

Definition at line 38 of file trueClock.h.


Constructor & Destructor Documentation

TrueClock::~TrueClock ( ) [inline, protected]

A protected destructor because no one should try to delete the global TrueClock.

Definition at line 95 of file trueClock.I.


Member Function Documentation

int TrueClock::get_error_count ( ) const [inline]

Returns the number of clock errors that have been detected.

Each time a clock error is detected, in which the value returned by either of the above methods is suspect, the value returned by this method will be incremented. Applications can monitor this value and react, for instance, by resynchronizing their clocks each time this value changes.

Definition at line 70 of file trueClock.I.

Referenced by ClockObject::check_errors().

TrueClock * TrueClock::get_global_ptr ( ) [inline, static]

Returns a pointer to the one TrueClock object in the world.

Definition at line 81 of file trueClock.I.

Referenced by Connection::consider_flush(), ConnectionReader::poll(), Extractor::step(), and ConnectionManager::wait_for_readers().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations