Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PStatClientData Class Reference

The data associated with a particular client, but not with any one particular frame or thread: the list of collectors and threads, for instance. More...

#include <pStatClientData.h>

Inheritance diagram for PStatClientData:

PStatClientVersion ReferenceCount List of all members.

Public Member Functions

 PStatClientData (PStatReader *reader)
 ~PStatClientData ()
bool is_alive () const
 Returns true if the data is actively getting filled by a connected client, or false if the client has terminated.

void close ()
 Closes the client connection if it is open.

int get_num_collectors () const
 Returns the total number of collectors the Data knows about.

bool has_collector (int index) const
 Returns true if the indicated collector has been defined by the client already, false otherwise.

const PStatCollectorDefget_collector_def (int index) const
 Returns the nth collector definition.

string get_collector_name (int index) const
 Returns the name of the indicated collector.

string get_collector_fullname (int index) const
 Returns the "full name" of the indicated collector.

void set_collector_has_level (int index, bool flag)
 Indicates whether the given collector has level data (and consequently, whether it should appear on the Levels menu).

bool get_collector_has_level (int index) const
 Returns whether the given collector has level data (and consequently, whether it should appear on the Levels menu).

int get_num_threads () const
 Returns the total number of threads the Data knows about.

bool has_thread (int index) const
 Returns true if the indicated thread has been defined by the client already, false otherwise.

string get_thread_name (int index) const
 Returns the name of the indicated thread.

const PStatThreadDataget_thread_data (int index) const
 Returns the data associated with the indicated thread.

int get_child_distance (int parent, int child) const
 Returns the number of Collectors between the indicated parent and the child Collector in the relationship graph.

void add_collector (PStatCollectorDef *def)
 Adds a new collector definition to the dataset.

void define_thread (int thread_index, const string &name=string())
 Adds a new thread definition to the dataset.

void record_new_frame (int thread_index, int frame_number, PStatFrameData *frame_data)
 Makes room for and stores a new frame's worth of data associated with some particular thread (which may or may not have already been defined).

int get_major_version () const
int get_minor_version () const
void set_version (int major_version, int minor_version)
bool is_at_least (int major_version, int minor_version) const
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 _major_version
int _minor_version
int _ref_count

Static Protected Attributes

TypeHandle _type_handle

Private Types

typedef pvector< CollectorCollectors
typedef pvector< ThreadThreads

Private Member Functions

void slot_collector (int collector_index)
 Makes sure there is an entry in the array for a collector with the given index number.


Private Attributes

bool _is_alive
PStatReader_reader
Collectors _collectors
Threads _threads

Static Private Attributes

PStatCollectorDef _null_collector

Friends

class PStatReader

Detailed Description

The data associated with a particular client, but not with any one particular frame or thread: the list of collectors and threads, for instance.

Definition at line 48 of file pStatClientData.h.


Member Typedef Documentation

typedef pvector<Collector> PStatClientData::Collectors [private]
 

Definition at line 91 of file pStatClientData.h.

typedef pvector<Thread> PStatClientData::Threads [private]
 

Definition at line 99 of file pStatClientData.h.


Constructor & Destructor Documentation

PStatClientData::PStatClientData PStatReader reader  ) 
 

Definition at line 39 of file pStatClientData.cxx.

References _collectors.

PStatClientData::~PStatClientData  ) 
 

Definition at line 53 of file pStatClientData.cxx.

References _is_alive.


Member Function Documentation

void PStatClientData::add_collector PStatCollectorDef def  ) 
 

Adds a new collector definition to the dataset.

Presumably this is information just arrived from the client.

The pointer will become owned by the PStatClientData object and will be freed on destruction.

Definition at line 353 of file pStatClientData.cxx.

void PStatClientData::close  ) 
 

Closes the client connection if it is open.

Definition at line 86 of file pStatClientData.cxx.

References _collectors.

void PStatClientData::define_thread int  thread_index,
const string &  name = string()
 

Adds a new thread definition to the dataset.

Presumably this is information just arrived from the client.

Definition at line 378 of file pStatClientData.cxx.

Referenced by get_child_distance().

int PStatClientData::get_child_distance int  parent,
int  child
const
 

Returns the number of Collectors between the indicated parent and the child Collector in the relationship graph.

If child is the same as parent, returns zero. If child is an immediate child of parent, returns 1. If child is a grandchild of parent, returns 2, and so on. If child is not a descendant of parent at all, returns -1.

Definition at line 319 of file pStatClientData.cxx.

References _threads, define_thread(), and nassertv.

Referenced by get_num_threads().

const PStatCollectorDef & PStatClientData::get_collector_def int  index  )  const
 

Returns the nth collector definition.

Definition at line 138 of file pStatClientData.cxx.

References _collectors, PStatCollectorDef::_name, PStatCollectorDef::_parent_index, get_collector_fullname(), and has_collector().

Referenced by PStatStripChart::begin_draw(), get_num_threads(), GtkStatsStripWindow::layout_window(), GtkStatsStripWindow::mark_dead(), GtkStatsStripWindow::new_collector(), and PStatStripChart::PStatStripChart().

string PStatClientData::get_collector_fullname int  index  )  const
 

Returns the "full name" of the indicated collector.

This will be the concatenation of all of the collector's parents' names (except Frame) and the collector's own name.

Definition at line 177 of file pStatClientData.cxx.

References _collectors.

Referenced by get_collector_def().

bool PStatClientData::get_collector_has_level int  index  )  const
 

Returns whether the given collector has level data (and consequently, whether it should appear on the Levels menu).

Definition at line 223 of file pStatClientData.cxx.

References _threads, nassertr, and NULL.

Referenced by GtkStatsStripWindow::mark_dead().

string PStatClientData::get_collector_name int  index  )  const
 

Returns the name of the indicated collector.

Definition at line 154 of file pStatClientData.cxx.

References _collectors, nassertv, and slot_collector().

int PStatClientData::get_num_collectors  )  const
 

Returns the total number of collectors the Data knows about.

Definition at line 105 of file pStatClientData.cxx.

References _collectors, _null_collector, and has_collector().

Referenced by GtkStatsStripWindow::mark_dead(), PStatStripChart::new_data(), and PStatPianoRoll::PStatPianoRoll().

int PStatClientData::get_num_threads  )  const
 

Returns the total number of threads the Data knows about.

Definition at line 239 of file pStatClientData.cxx.

References get_child_distance(), get_collector_def(), and has_collector().

Referenced by PStatStripChart::new_data(), and PStatPianoRoll::PStatPianoRoll().

const PStatThreadData * PStatClientData::get_thread_data int  index  )  const
 

Returns the data associated with the indicated thread.

This will create a thread definition if it does not already exist.

Definition at line 292 of file pStatClientData.cxx.

References _threads.

Referenced by PStatPianoRoll::PStatPianoRoll().

string PStatClientData::get_thread_name int  index  )  const
 

Returns the name of the indicated thread.

Definition at line 272 of file pStatClientData.cxx.

References _collectors, and NULL.

Referenced by GtkStatsStripWindow::layout_window().

bool PStatClientData::has_collector int  index  )  const
 

Returns true if the indicated collector has been defined by the client already, false otherwise.

It is possible for the client to start streaming data before all of the collectors have been defined.

Definition at line 124 of file pStatClientData.cxx.

Referenced by get_collector_def(), get_num_collectors(), get_num_threads(), GtkStatsStripWindow::layout_window(), GtkStatsStripWindow::mark_dead(), and PStatStripChart::PStatStripChart().

bool PStatClientData::has_thread int  index  )  const
 

Returns true if the indicated thread has been defined by the client already, false otherwise.

It is possible for the client to start streaming data before all of the threads have been defined.

Definition at line 258 of file pStatClientData.cxx.

Referenced by GtkStatsStripWindow::layout_window().

bool PStatClientData::is_alive  )  const
 

Returns true if the data is actively getting filled by a connected client, or false if the client has terminated.

Definition at line 73 of file pStatClientData.cxx.

References _is_alive, _reader, and NULL.

void PStatClientData::record_new_frame int  thread_index,
int  frame_number,
PStatFrameData frame_data
 

Makes room for and stores a new frame's worth of data associated with some particular thread (which may or may not have already been defined).

The pointer will become owned by the PStatThreadData object and will be freed on destruction.

Definition at line 416 of file pStatClientData.cxx.

void PStatClientData::set_collector_has_level int  index,
bool  flag
 

Indicates whether the given collector has level data (and consequently, whether it should appear on the Levels menu).

Definition at line 203 of file pStatClientData.cxx.

References _threads.

void PStatClientData::slot_collector int  collector_index  )  [private]
 

Makes sure there is an entry in the array for a collector with the given index number.

Definition at line 434 of file pStatClientData.cxx.

Referenced by get_collector_name().


Friends And Related Function Documentation

friend class PStatReader [friend]
 

Definition at line 103 of file pStatClientData.h.


Member Data Documentation

Collectors PStatClientData::_collectors [private]
 

Definition at line 92 of file pStatClientData.h.

Referenced by close(), get_collector_def(), get_collector_fullname(), get_collector_name(), get_num_collectors(), get_thread_name(), and PStatClientData().

bool PStatClientData::_is_alive [private]
 

Definition at line 82 of file pStatClientData.h.

Referenced by is_alive(), and ~PStatClientData().

PStatCollectorDef PStatClientData::_null_collector [static, private]
 

Referenced by get_num_collectors().

PStatReader* PStatClientData::_reader [private]
 

Definition at line 83 of file pStatClientData.h.

Referenced by is_alive().

Threads PStatClientData::_threads [private]
 

Definition at line 100 of file pStatClientData.h.

Referenced by get_child_distance(), get_collector_has_level(), get_thread_data(), and set_collector_has_level().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:49 2003 for Panda-Tool by doxygen1.3