Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
PStatThread Class Reference

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

#include "pStatThread.h"

Public Member Functions

 PStatThread ()
 Normally, this constructor is called only from PStatClient.
 
 PStatThread (const PStatThread &copy)
 
 PStatThread (PStatClient *client, int index)
 Normally, this constructor is called only from PStatClient.
 
 PStatThread (Thread *thread, PStatClient *client=nullptr)
 Creates a new named thread.
 
void add_frame (const PStatFrameData &frame_data)
 This is a slightly lower-level version of new_frame that also specifies the data to send for this frame.
 
PStatClientget_client () const
 
int get_index () const
 
Threadget_thread () const
 
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)
 

Public Attributes

 get_index
 Returns the index number of this particular thread within the PStatClient.
 
 get_thread
 Returns the Panda Thread object associated with this particular PStatThread.
 

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 28 of file pStatThread.h.

Constructor & Destructor Documentation

◆ PStatThread() [1/4]

PStatThread::PStatThread ( )
inline

Normally, this constructor is called only from PStatClient.

Use one of the constructors below to create your own Thread.

Definition at line 18 of file pStatThread.I.

Referenced by PStatThread().

◆ PStatThread() [2/4]

PStatThread::PStatThread ( PStatClient * client,
int index )
inline

Normally, this constructor is called only from PStatClient.

Use one of the constructors below to create your own Thread.

Definition at line 26 of file pStatThread.I.

◆ PStatThread() [3/4]

PStatThread::PStatThread ( Thread * thread,
PStatClient * client = nullptr )
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 37 of file pStatThread.I.

References PStatThread(), and Thread::get_pstats_index.

◆ PStatThread() [4/4]

PStatThread::PStatThread ( const PStatThread & copy)
inline

Definition at line 62 of file pStatThread.I.

Member Function Documentation

◆ add_frame()

void PStatThread::add_frame ( const PStatFrameData & frame_data)

This is a slightly lower-level version of new_frame that also specifies the data to send for this frame.

Definition at line 37 of file pStatThread.cxx.

Referenced by GraphicsStateGuardian::flush_timer_queries().

◆ get_client()

PStatClient * PStatThread::get_client ( ) const
inline

Definition at line 89 of file pStatThread.I.

◆ new_frame()

void PStatThread::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.

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

Definition at line 26 of file pStatThread.cxx.

◆ operator=()

void PStatThread::operator= ( const PStatThread & copy)
inline

Definition at line 72 of file pStatThread.I.

Friends And Related Symbol Documentation

◆ PStatClient

friend class PStatClient
friend

Definition at line 55 of file pStatThread.h.

◆ PStatCollector

friend class PStatCollector
friend

Definition at line 56 of file pStatThread.h.

Member Data Documentation

◆ get_index

int PStatThread::get_index
inline

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

Definition at line 46 of file pStatThread.h.

◆ get_thread

Thread * PStatThread::get_thread

Returns the Panda Thread object associated with this particular PStatThread.

Definition at line 45 of file pStatThread.h.


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