Panda3D
Public Member Functions | Friends

PStatThread Class Reference

A lightweight class that represents a single thread of execution to PStats. More...

#include "pStatThread.h"

List of all members.

Public Member Functions

 PStatThread (Thread *thread, PStatClient *client=NULL)
 Creates a new named thread.
 PStatThread (const PStatThread &copy)
int get_index () const
 Returns the index number of this particular thread within the PStatClient.
Threadget_thread () const
 Returns the Panda Thread object associated with this particular PStatThread.
void new_frame ()
 This must be called at the start of every "frame", whatever a frame may be deemed to be, to accumulate all the stats that have collected so far for the thread and ship them off to the server.
void operator= (const PStatThread &copy)

Friends

class PStatClient
class PStatCollector

Detailed Description

A lightweight class that represents a single thread of execution to PStats.

It corresponds one-to-one with Panda's Thread instance.

Definition at line 30 of file pStatThread.h.


Constructor & Destructor Documentation

PStatThread::PStatThread ( Thread thread,
PStatClient client = NULL 
) [inline]

Creates a new named thread.

This will be used to unify tasks that share a common thread, and differentiate tasks that occur in different threads.

Definition at line 49 of file pStatThread.I.

References Thread::get_pstats_index().


Member Function Documentation

int PStatThread::get_index ( ) const [inline]

Returns the index number of this particular thread within the PStatClient.

Definition at line 119 of file pStatThread.I.

Thread * PStatThread::get_thread ( ) const

Returns the Panda Thread object associated with this particular PStatThread.

Definition at line 25 of file pStatThread.cxx.

References Thread::get_current_thread().

void PStatThread::new_frame ( ) [inline]

This must be called at the start of every "frame", whatever a frame may be deemed to be, to accumulate all the stats that have collected so far for the thread and ship them off to the server.

Calling PStatClient::thread_tick() will automatically call this for any threads with the indicated sync name.

Definition at line 106 of file pStatThread.I.


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