Panda3D
|
Contains the raw timing and level data for a single frame. More...
#include "pStatFrameData.h"
Public Member Functions | |
void | add_level (int index, double level) |
Adds a particular level value associated with a given collector to the frame data. More... | |
void | add_start (int index, double time) |
Adds a 'start collector' data point to the frame data. More... | |
void | add_stop (int index, double time) |
Adds a 'stop collector' data point to the frame data. More... | |
void | clear () |
Removes all the data points from the frame data, in preparation for building up a new frame's worth. More... | |
double | get_end () const |
Returns the time of the last data point in the frame data. More... | |
double | get_level (int n) const |
Returns the height of the nth level value. More... | |
int | get_level_collector (int n) const |
Returns the index of the collector associated with the nth level value. More... | |
double | get_net_time () const |
Returns the total time elapsed for the frame. More... | |
int | get_num_events () const |
Returns the number of individual events stored in the FrameData. More... | |
int | get_num_levels () const |
Returns the number of individual level values stored in the FrameData. More... | |
double | get_start () const |
Returns the time of the first data point in the frame data. More... | |
double | get_time (int n) const |
Returns the timestamp of the nth event, in seconds elapsed since some undefined epoch (which is guaranteed to be shared among all events returned from a given client). More... | |
int | get_time_collector (int n) const |
Returns the index of the collector associated with the nth event. More... | |
bool | is_empty () const |
Returns true if the FrameData has no time or level data. More... | |
bool | is_level_empty () const |
Returns true if there are no levels indicated in the frame data, false otherwise. More... | |
bool | is_start (int n) const |
Returns true if the nth event represents a start event, or false if it represents a stop event. More... | |
bool | is_time_empty () const |
Returns true if there are no time events in the frame data, false otherwise. More... | |
void | read_datagram (DatagramIterator &source, PStatClientVersion *version) |
Extracts the FrameData definition from the datagram. More... | |
void | sort_time () |
Ensures the frame data is in monotonically increasing order by time. More... | |
void | swap (PStatFrameData &other) |
Exchanges the data in this object with the data in the other. More... | |
bool | write_datagram (Datagram &destination, PStatClient *client) const |
Writes the definition of the FrameData to the datagram. More... | |
Contains the raw timing and level data for a single frame.
This is a sequence of start/stop events, as well as a table of level values, associated with a number of collectors within a single frame.
Definition at line 36 of file pStatFrameData.h.
|
inline |
Adds a particular level value associated with a given collector to the frame data.
Definition at line 114 of file pStatFrameData.I.
References get_start().
Referenced by add_stop().
|
inline |
Adds a 'start collector' data point to the frame data.
Definition at line 80 of file pStatFrameData.I.
References add_stop().
Referenced by swap().
|
inline |
Adds a 'stop collector' data point to the frame data.
Definition at line 97 of file pStatFrameData.I.
References add_level().
Referenced by add_start().
|
inline |
Removes all the data points from the frame data, in preparation for building up a new frame's worth.
Definition at line 56 of file pStatFrameData.I.
References swap().
Referenced by is_empty(), and read_datagram().
|
inline |
Returns the time of the last data point in the frame data.
This will generally be the time of the end of the frame.
Definition at line 148 of file pStatFrameData.I.
References get_net_time(), and is_empty().
Referenced by PStatView::get_level(), get_start(), and PStatStripChart::is_title_unknown().
|
inline |
Returns the height of the nth level value.
Definition at line 244 of file pStatFrameData.I.
Referenced by PStatView::get_level(), and get_level_collector().
|
inline |
Returns the index of the collector associated with the nth level value.
Definition at line 233 of file pStatFrameData.I.
References get_level().
Referenced by PStatView::get_level(), and get_num_levels().
|
inline |
Returns the total time elapsed for the frame.
Definition at line 160 of file pStatFrameData.I.
References get_num_events(), and is_empty().
Referenced by get_end(), and PStatStripChart::is_title_unknown().
|
inline |
Returns the number of individual events stored in the FrameData.
Definition at line 173 of file pStatFrameData.I.
References get_time_collector().
Referenced by PStatView::get_level(), get_net_time(), and TextMonitor::new_data().
|
inline |
Returns the number of individual level values stored in the FrameData.
Definition at line 222 of file pStatFrameData.I.
References get_level_collector().
Referenced by PStatView::get_level(), and get_time().
|
inline |
Returns the time of the first data point in the frame data.
This will generally be the time of the start of the frame.
Definition at line 132 of file pStatFrameData.I.
References get_end(), and is_empty().
Referenced by add_level(), PStatThreadData::get_frame(), PStatThreadData::get_frame_number_at_time(), PStatStripChart::is_title_unknown(), PStatThreadData::record_new_frame(), and PStatStripChart::update().
|
inline |
Returns the timestamp of the nth event, in seconds elapsed since some undefined epoch (which is guaranteed to be shared among all events returned from a given client).
Definition at line 210 of file pStatFrameData.I.
References get_num_levels().
Referenced by PStatView::get_level(), is_start(), and TextMonitor::new_data().
|
inline |
Returns the index of the collector associated with the nth event.
Definition at line 184 of file pStatFrameData.I.
References is_start().
Referenced by PStatView::get_level(), get_num_events(), and TextMonitor::new_data().
|
inline |
Returns true if the FrameData has no time or level data.
Definition at line 45 of file pStatFrameData.I.
References clear(), is_level_empty(), and is_time_empty().
Referenced by get_end(), get_net_time(), get_start(), is_level_empty(), and PStatThreadData::record_new_frame().
|
inline |
Returns true if there are no levels indicated in the frame data, false otherwise.
Definition at line 34 of file pStatFrameData.I.
References is_empty().
Referenced by is_empty(), and is_time_empty().
|
inline |
Returns true if the nth event represents a start event, or false if it represents a stop event.
Definition at line 196 of file pStatFrameData.I.
References get_time().
Referenced by PStatView::get_level(), get_time_collector(), and TextMonitor::new_data().
|
inline |
Returns true if there are no time events in the frame data, false otherwise.
Definition at line 23 of file pStatFrameData.I.
References is_level_empty().
Referenced by is_empty().
void PStatFrameData::read_datagram | ( | DatagramIterator & | source, |
PStatClientVersion * | version | ||
) |
Extracts the FrameData definition from the datagram.
Definition at line 72 of file pStatFrameData.cxx.
References clear(), DatagramIterator::get_float32(), DatagramIterator::get_remaining_size(), and DatagramIterator::get_uint16().
Referenced by PStatReader::get_monitor(), and write_datagram().
void PStatFrameData::sort_time | ( | ) |
Ensures the frame data is in monotonically increasing order by time.
Definition at line 31 of file pStatFrameData.cxx.
References write_datagram().
|
inline |
Exchanges the data in this object with the data in the other.
Definition at line 68 of file pStatFrameData.I.
References add_start().
Referenced by clear().
bool PStatFrameData::write_datagram | ( | Datagram & | destination, |
PStatClient * | client | ||
) | const |
Writes the definition of the FrameData to the datagram.
Returns true on success, false on failure.
Definition at line 42 of file pStatFrameData.cxx.
References Datagram::add_float32(), Datagram::add_uint16(), and read_datagram().
Referenced by sort_time().