#include <pStatThreadData.h>
Inheritance diagram for PStatThreadData:
Public Member Functions | |
PStatThreadData (const PStatClientData *client_data) | |
~PStatThreadData () | |
const PStatClientData * | get_client_data () const |
Returns a pointer to the ClientData structure associated with this data. | |
bool | is_empty () const |
Returns true if the structure contains no frames, false otherwise. | |
int | get_latest_frame_number () const |
Returns the frame number of the most recent frame stored in the data. | |
int | get_oldest_frame_number () const |
Returns the frame number of the oldest frame still stored in the data. | |
bool | has_frame (int frame_number) const |
Returns true if we have received data for the indicated frame number from the client and we still have it stored, or false otherwise. | |
const PStatFrameData & | get_frame (int frame_number) const |
Returns a FrameData structure associated with the indicated frame number. | |
float | get_latest_time () const |
Returns the timestamp (in seconds elapsed since connection) of the latest available frame. | |
float | get_oldest_time () const |
Returns the timestamp (in seconds elapsed since connection) of the oldest available frame. | |
const PStatFrameData & | get_frame_at_time (float time) const |
Returns the FrameData structure associated with the latest frame not later than the indicated time. | |
int | get_frame_number_at_time (float time, int hint=-1) const |
Returns the frame number of the latest frame not later than the indicated time. | |
const PStatFrameData & | get_latest_frame () const |
Returns the FrameData associated with the most recent frame. | |
float | get_frame_rate (float time=3.0) const |
Computes the average frame rate over the past number of seconds, by counting up the number of frames elapsed in that time interval. | |
void | set_history (float time) |
Sets the number of seconds worth of frames that will be retained by the ThreadData structure as each new frame is added. | |
float | get_history () const |
Returns the number of seconds worth of frames that will be retained by the ThreadData structure as each new frame is added. | |
void | record_new_frame (int frame_number, PStatFrameData *frame_data) |
Makes room for and stores a new frame's worth of data. | |
int | get_ref_count () const |
int | ref () const |
int | unref () const |
void | test_ref_count_integrity () const |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Protected Attributes | |
int | _ref_count |
Static Protected Attributes | |
TypeHandle | _type_handle |
Private Types | |
typedef pdeque< PStatFrameData * > | Frames |
Private Attributes | |
const PStatClientData * | _client_data |
Frames | _frames |
int | _first_frame_number |
float | _history |
Static Private Attributes | |
PStatFrameData | _null_frame |
This holds the raw data as reported by the client, and it automatically handles frames received out-of-order or skipped. You can ask for a particular frame by frame number or time and receive the data for the nearest frame.
Definition at line 54 of file pStatThreadData.h.
|
Definition at line 86 of file pStatThreadData.h. |
|
Definition at line 39 of file pStatThreadData.cxx. |
|
Definition at line 54 of file pStatThreadData.cxx. References _frames. |
|
Returns a pointer to the ClientData structure associated with this data.
Definition at line 34 of file pStatThreadData.I. |
|
Returns a FrameData structure associated with the indicated frame number. If the frame data has not yet been received from the client, returns the newest frame older than the requested frame. Definition at line 140 of file pStatThreadData.cxx. References nassertr. Referenced by PStatStripChart::draw_cursor(), PStatStripChart::get_collector_under_pixel(), and PStatPianoRoll::PStatPianoRoll(). |
|
Returns the FrameData structure associated with the latest frame not later than the indicated time.
Definition at line 213 of file pStatThreadData.cxx. |
|
Returns the frame number of the latest frame not later than the indicated time. If the hint is nonnegative, it represents a frame number that we believe the correct answer to be near, which may speed the search for the frame. Definition at line 236 of file pStatThreadData.cxx. References PStatFrameData::get_start(), nassertr, NULL, and num_frames. Referenced by PStatStripChart::set_default_vertical_scale(). |
|
Computes the average frame rate over the past number of seconds, by counting up the number of frames elapsed in that time interval.
Definition at line 299 of file pStatThreadData.cxx. References _history. |
|
Returns the number of seconds worth of frames that will be retained by the ThreadData structure as each new frame is added. This affects how old the oldest frame that may be queried is. Definition at line 376 of file pStatThreadData.cxx. |
|
Returns the FrameData associated with the most recent frame.
Definition at line 281 of file pStatThreadData.cxx. References _history. |
|
Returns the frame number of the most recent frame stored in the data.
Definition at line 84 of file pStatThreadData.cxx. Referenced by PStatStripChart::draw_cursor(), PStatStripChart::new_data(), and PStatPianoRoll::PStatPianoRoll(). |
|
Returns the timestamp (in seconds elapsed since connection) of the latest available frame.
Definition at line 181 of file pStatThreadData.cxx. References _first_frame_number, and NULL. |
|
Returns the frame number of the oldest frame still stored in the data.
Definition at line 100 of file pStatThreadData.cxx. References _first_frame_number, _frames, NULL, and num_frames. |
|
Returns the timestamp (in seconds elapsed since connection) of the oldest available frame.
Definition at line 197 of file pStatThreadData.cxx. |
|
Returns true if we have received data for the indicated frame number from the client and we still have it stored, or false otherwise.
Definition at line 118 of file pStatThreadData.cxx. Referenced by PStatStripChart::set_default_vertical_scale(). |
|
Returns true if the structure contains no frames, false otherwise.
Definition at line 69 of file pStatThreadData.cxx. References _first_frame_number, _frames, and nassertr. Referenced by PStatStripChart::new_data(), and PStatPianoRoll::PStatPianoRoll(). |
|
Makes room for and stores a new frame's worth of data. Calling this function may cause old frame data to be discarded to make room, according to the amount of time set up via set_history(). The pointer will become owned by the PStatThreadData object and will be freed on destruction. Definition at line 402 of file pStatThreadData.cxx. |
|
Sets the number of seconds worth of frames that will be retained by the ThreadData structure as each new frame is added. This affects how old the oldest frame that may be queried is. Definition at line 357 of file pStatThreadData.cxx. |
|
Definition at line 84 of file pStatThreadData.h. |
|
Definition at line 88 of file pStatThreadData.h. Referenced by get_latest_time(), get_oldest_frame_number(), and is_empty(). |
|
Definition at line 87 of file pStatThreadData.h. Referenced by get_oldest_frame_number(), is_empty(), and ~PStatThreadData(). |
|
Definition at line 89 of file pStatThreadData.h. Referenced by get_frame_rate(), and get_latest_frame(). |
|
Definition at line 29 of file pStatThreadData.cxx. |