Panda3D
Classes | 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. 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 (size_t n) const
 Returns the height of the nth level value. More...
 
int get_level_collector (size_t 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...
 
size_t get_num_events () const
 Returns the number of individual events stored in the FrameData. More...
 
size_t 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 (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). More...
 
int get_time_collector (size_t 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 (size_t 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...
 

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 92 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 63 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 77 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 45 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 120 of file pStatFrameData.I.

◆ get_level()

double PStatFrameData::get_level ( size_t  n) const
inline

Returns the height of the nth level value.

Definition at line 195 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 186 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 130 of file pStatFrameData.I.

◆ get_num_events()

size_t PStatFrameData::get_num_events ( ) const
inline

Returns the number of individual events stored in the FrameData.

Definition at line 140 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 178 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 107 of file pStatFrameData.I.

References is_empty().

Referenced by 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 169 of file pStatFrameData.I.

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

◆ is_empty()

bool PStatFrameData::is_empty ( ) const
inline

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

Definition at line 36 of file pStatFrameData.I.

References is_level_empty(), and is_time_empty().

Referenced by get_start().

◆ 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 28 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 158 of file pStatFrameData.I.

◆ 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 19 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 64 of file pStatFrameData.cxx.

References clear().

◆ sort_time()

void PStatFrameData::sort_time ( )

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

Definition at line 27 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 54 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 36 of file pStatFrameData.cxx.

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


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