Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
PStatFrameData Class Reference

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.
void | add_start (int index, double time)
| Adds a 'start collector' data point to the frame data.
void | add_stop (int index, double time)
| Adds a 'stop collector' data point to the frame data.
void | clear ()
| Removes all the data points from the frame data, in preparation for building up a new frame's worth.
double | get_end () const
| Returns the time of the last data point in the frame data.
double | get_level (size_t n) const
| Returns the height of the nth level value.
int | get_level_collector (size_t n) const
| Returns the index of the collector associated with the nth level value.
double | get_net_time () const
| Returns the total time elapsed for the frame.
size_t | get_num_events () const
| Returns the number of individual events stored in the FrameData.
size_t | get_num_levels () const
| Returns the number of individual level values stored in the FrameData.
double | get_start () const
| Returns the time of the first data point in the frame data.
double | get_time (size_t 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).
int | get_time_collector (size_t n) const
| Returns the index of the collector associated with the nth event.
bool | is_empty () const
| Returns true if the FrameData has no time or level data.
bool | is_level_empty () const
| Returns true if there are no levels indicated in the frame data, false otherwise.
bool | is_start (size_t n) const
| Returns true if the nth event represents a start event, or false if it represents a stop event.
bool | is_time_empty () const
| Returns true if there are no time events in the frame data, false otherwise.
void | read_datagram (DatagramIterator &source, PStatClientVersion *version)
| Extracts the FrameData definition from the datagram.
void | sort_time ()
| Ensures the frame data is in monotonically increasing order by time.
void | swap (PStatFrameData &other)
| Exchanges the data in this object with the data in the other.
bool | write_datagram (Datagram &destination, PStatClient *client) const
| Writes the definition of the FrameData to the datagram.

## Detailed Description

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 33 of file pStatFrameData.h.

## Member Function Documentation

## ◆ add_level()

void PStatFrameData::add_level | ( | int | index,
|  | double | level )
| inline

Adds a particular level value associated with a given collector to the frame data.

Definition at line 91 of file pStatFrameData.I.

## ◆ add_start()

void PStatFrameData::add_start | ( | int | index,
|  | double | time )
| inline

Adds a 'start collector' data point to the frame data.

Definition at line 62 of file pStatFrameData.I.

## ◆ add_stop()

void PStatFrameData::add_stop | ( | int | index,
|  | double | time )
| inline

Adds a 'stop collector' data point to the frame data.

Definition at line 76 of file pStatFrameData.I.

## ◆ clear()

void PStatFrameData::clear | ( |  | ) |
| inline

Removes all the data points from the frame data, in preparation for building up a new frame's worth.

Definition at line 44 of file pStatFrameData.I.

Referenced by read_datagram().

## ◆ get_end()

double PStatFrameData::get_end | ( |  | ) | const
| 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 119 of file pStatFrameData.I.

References is_empty().

## ◆ get_level()

double PStatFrameData::get_level | ( | size_t | n | ) | const
| inline

Returns the height of the nth level value.

Definition at line 194 of file pStatFrameData.I.

## ◆ get_level_collector()

int PStatFrameData::get_level_collector | ( | size_t | n | ) | const
| inline

Returns the index of the collector associated with the nth level value.

Definition at line 185 of file pStatFrameData.I.

## ◆ get_net_time()

double PStatFrameData::get_net_time | ( |  | ) | const
| inline

Returns the total time elapsed for the frame.

Definition at line 129 of file pStatFrameData.I.

References is_empty().

## ◆ get_num_events()

size_t PStatFrameData::get_num_events | ( |  | ) | const
| inline

Returns the number of individual events stored in the FrameData.

Definition at line 139 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

## ◆ get_num_levels()

size_t PStatFrameData::get_num_levels | ( |  | ) | const
| inline

Returns the number of individual level values stored in the FrameData.

Definition at line 177 of file pStatFrameData.I.

## ◆ get_start()

double PStatFrameData::get_start | ( |  | ) | const
| 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 106 of file pStatFrameData.I.

References is_empty().

Referenced by PStatThreadData::get_frame(), PStatThreadData::get_frame_number_at_time(), PStatThreadData::record_new_frame(), and PStatStripChart::update().

## ◆ get_time()

double PStatFrameData::get_time | ( | size_t | n | ) | const
| 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 168 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

## ◆ get_time_collector()

int PStatFrameData::get_time_collector | ( | size_t | n | ) | const
| inline

Returns the index of the collector associated with the nth event.

Definition at line 147 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

## ◆ is_empty()

bool PStatFrameData::is_empty | ( |  | ) | const
| inline

Returns true if the FrameData has no time or level data.

Definition at line 35 of file pStatFrameData.I.

References is_level_empty(), and is_time_empty().

Referenced by get_end(), get_net_time(), get_start(), and PStatThreadData::record_new_frame().

## ◆ is_level_empty()

bool PStatFrameData::is_level_empty | ( |  | ) | const
| inline

Returns true if there are no levels indicated in the frame data, false otherwise.

Definition at line 27 of file pStatFrameData.I.

Referenced by is_empty().

## ◆ is_start()

bool PStatFrameData::is_start | ( | size_t | n | ) | const
| inline

Returns true if the nth event represents a start event, or false if it represents a stop event.

Definition at line 157 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

## ◆ is_time_empty()

bool PStatFrameData::is_time_empty | ( |  | ) | const
| inline

Returns true if there are no time events in the frame data, false otherwise.

Definition at line 18 of file pStatFrameData.I.

Referenced by is_empty().

## ◆ read_datagram()

void PStatFrameData::read_datagram | ( | DatagramIterator & | source,
|  | PStatClientVersion * | version )

Extracts the FrameData definition from the datagram.

Definition at line 108 of file pStatFrameData.cxx.

References clear(), DatagramIterator::get_float32(), DatagramIterator::get_remaining_size(), DatagramIterator::get_uint16(), DatagramIterator::get_uint32(), and PStatClientVersion::is_at_least().

## ◆ sort_time()

void PStatFrameData::sort_time | ( |  | ) |

Ensures the frame data is in monotonically increasing order by time.

Definition at line 26 of file pStatFrameData.cxx.

## ◆ swap()

void PStatFrameData::swap | ( | PStatFrameData & | other | ) |
| inline

Exchanges the data in this object with the data in the other.

Definition at line 53 of file pStatFrameData.I.

## ◆ write_datagram()

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 35 of file pStatFrameData.cxx.

References Datagram::add_float32(), Datagram::add_uint16(), and Datagram::modify_array().

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

- panda/src/pstatclient/pStatFrameData.h
- panda/src/pstatclient/pStatFrameData.cxx
- panda/src/pstatclient/pStatFrameData.I