18 #include "pandabase.h" 20 #include "trueClock.h" 22 #include "cycleData.h" 23 #include "cycleDataReader.h" 24 #include "cycleDataWriter.h" 25 #include "cycleDataStageReader.h" 26 #include "pipelineCycler.h" 28 #include "referenceCount.h" 29 #include "pointerTo.h" 30 #include "vector_double.h" 35 INLINE ulong get_sec()
const;
36 INLINE ulong get_usec()
const;
83 void set_mode(Mode mode);
84 INLINE Mode get_mode()
const;
87 INLINE
double get_real_time()
const;
88 INLINE
double get_long_time()
const;
91 void set_real_time(
double time);
99 void set_dt(
double dt);
100 void set_frame_rate(
double frame_rate);
102 INLINE
double get_max_dt()
const;
103 INLINE
void set_max_dt(
double max_dt);
105 INLINE
double get_degrade_factor()
const;
106 INLINE
void set_degrade_factor(
double degrade_factor);
108 INLINE
void set_average_frame_rate_interval(
double time);
109 INLINE
double get_average_frame_rate_interval()
const;
117 INLINE
bool check_errors(
Thread *current_thread);
122 static void (*_start_clock_wait)();
123 static void (*_start_clock_busy_wait)();
124 static void (*_stop_clock_wait)();
127 void wait_until(
double want_time);
128 static void make_global_clock();
129 static void dummy_clock_wait();
133 double _start_short_time;
134 double _start_long_time;
135 double _actual_frame_time;
137 double _user_frame_rate;
138 double _degrade_factor;
143 double _average_frame_rate_interval;
148 class EXPCL_PANDA_PUTIL CData :
public CycleData {
151 INLINE CData(
const CData ©);
155 return ClockObject::get_class_type();
159 double _reported_frame_time;
160 double _reported_frame_time_epoch;
175 static void init_type() {
176 ReferenceCount::init_type();
177 register_type(_type_handle,
"ClockObject",
178 ReferenceCount::get_class_type());
185 EXPCL_PANDA_PUTIL ostream &
186 operator << (ostream &out, ClockObject::Mode mode);
187 EXPCL_PANDA_PUTIL istream &
188 operator >> (istream &in, ClockObject::Mode &mode);
190 #include "clockObject.I"
A single page of data maintained by a PipelineCycler.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
A ClockObject keeps track of elapsed real time and discrete time.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
An interface to whatever real-time clock we might have available in the current environment.
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
A base class for all things that want to be reference-counted.
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.