Panda3D
Public Member Functions | Public Attributes | List of all members
PStatThread Class Reference

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

Public Member Functions

 __init__ (PStatClient client, int index)
 Normally, this constructor is called only from PStatClient. More...
 
 __init__ (const PStatThread copy)
 
 __init__ (Thread thread, PStatClient client)
 Creates a new named thread. More...
 
 addFrame (const PStatFrameData frame_data)
 This is a slightly lower-level version of new_frame that also specifies the data to send for this frame. More...
 
int getIndex ()
 Returns the index number of this particular thread within the PStatClient. More...
 
Thread getThread ()
 Returns the Panda Thread object associated with this particular PStatThread. More...
 
 newFrame ()
 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. More...
 
PStatThread operator= (const PStatThread copy)
 

Public Attributes

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

Detailed Description

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

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

Member Function Documentation

◆ __init__() [1/3]

__init__ ( PStatClient  client,
int  index 
)

Normally, this constructor is called only from PStatClient.

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

◆ __init__() [2/3]

__init__ ( const PStatThread  copy)

◆ __init__() [3/3]

__init__ ( Thread  thread,
PStatClient  client 
)

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.

◆ addFrame()

addFrame ( const PStatFrameData  frame_data)

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

◆ getIndex()

int getIndex ( )

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

◆ getThread()

Thread getThread ( )

Returns the Panda Thread object associated with this particular PStatThread.

◆ newFrame()

newFrame ( )

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.

◆ operator=()

PStatThread operator= ( const PStatThread  copy)

Member Data Documentation

◆ index

int index

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

◆ thread

Thread thread

Returns the Panda Thread object associated with this particular PStatThread.