Panda3D
Classes | Public Member Functions
PStatFrameData Class Reference

Contains the raw timing and level data for a single frame. More...

#include "pStatFrameData.h"

List of all members.

Classes

class  DataPoint

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 (int n) const
 Returns the height of the nth level value.
int get_level_collector (int 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.
int get_num_events () const
 Returns the number of individual events stored in the FrameData.
int 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 (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).
int get_time_collector (int 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 (int 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 36 of file pStatFrameData.h.


Member Function Documentation

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 114 of file pStatFrameData.I.

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

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

Definition at line 80 of file pStatFrameData.I.

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

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

Definition at line 97 of file pStatFrameData.I.

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 56 of file pStatFrameData.I.

Referenced by read_datagram().

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 148 of file pStatFrameData.I.

References is_empty().

Referenced by PStatStripChart::compute_average_pixel_data(), and PStatStripChart::get_average_net_value().

double PStatFrameData::get_level ( int  n) const [inline]

Returns the height of the nth level value.

Definition at line 244 of file pStatFrameData.I.

int PStatFrameData::get_level_collector ( int  n) const [inline]

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

Definition at line 233 of file pStatFrameData.I.

double PStatFrameData::get_net_time ( ) const [inline]

Returns the total time elapsed for the frame.

Definition at line 160 of file pStatFrameData.I.

References is_empty().

Referenced by PStatStripChart::get_average_net_value().

int PStatFrameData::get_num_events ( ) const [inline]

Returns the number of individual events stored in the FrameData.

Definition at line 173 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

int PStatFrameData::get_num_levels ( ) const [inline]

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

Definition at line 222 of file pStatFrameData.I.

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 132 of file pStatFrameData.I.

References is_empty().

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

double PStatFrameData::get_time ( int  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 210 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

int PStatFrameData::get_time_collector ( int  n) const [inline]

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

Definition at line 184 of file pStatFrameData.I.

Referenced by TextMonitor::new_data().

bool PStatFrameData::is_empty ( ) const [inline]

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

Definition at line 45 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().

bool PStatFrameData::is_level_empty ( ) const [inline]

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

Definition at line 34 of file pStatFrameData.I.

Referenced by is_empty().

bool PStatFrameData::is_start ( int  n) const [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.

Referenced by TextMonitor::new_data().

bool PStatFrameData::is_time_empty ( ) const [inline]

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

Definition at line 23 of file pStatFrameData.I.

Referenced by is_empty().

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().

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

Definition at line 31 of file pStatFrameData.cxx.

void PStatFrameData::swap ( PStatFrameData other) [inline]

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

Definition at line 68 of file pStatFrameData.I.

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(), and Datagram::add_uint16().


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