Panda3D
|
#include <pandadoc.hpp>
Public Member Functions | |
bool | clientConnect (str hostname, int port) |
The nonstatic implementation of connect(). | |
clientDisconnect () | |
The nonstatic implementation of disconnect(). | |
bool | clientIsConnected () |
The nonstatic implementation of is_connected(). | |
clientMainTick () | |
A convenience function to call new_frame() on the given PStatClient's main thread, and any other threads with a sync_name of "Main". | |
clientResumeAfterPause () | |
Resumes the PStatClient after the simulation has been paused for a while. | |
clientThreadTick (str sync_name) | |
A convenience function to call new_frame() on all of the threads with the indicated sync name. | |
str | getClientName () |
Retrieves the name of the client as set. | |
PStatCollector | getCollector (int index) |
Returns the nth collector. | |
PStatCollectorDef | getCollectorDef (int index) |
Returns the definition body of the nth collector. | |
str | getCollectorFullname (int index) |
Returns the "full name" of the indicated collector. | |
str | getCollectorName (int index) |
Returns the name of the indicated collector. | |
list | getCollectors () |
PStatThread | getCurrentThread () |
Returns a handle to the currently-executing thread. | |
PStatThread | getMainThread () |
Returns a handle to the client's Main thread. | |
double | getMaxRate () |
Returns the maximum number of packets that will be sent to the server per second, per thread. | |
int | getNumCollectors () |
Returns the total number of collectors the Client knows about. | |
int | getNumThreads () |
Returns the total number of threads the Client knows about. | |
double | getRealTime () |
Returns the time according to to the PStatClient's clock object. | |
PStatThread | getThread (int index) |
Returns the nth thread. | |
str | getThreadName (int index) |
Returns the name of the indicated thread. | |
Thread | getThreadObject (int index) |
Returns the Panda Thread object associated with the indicated PStatThread. | |
list | getThreads () |
str | getThreadSyncName (int index) |
Returns the sync_name of the indicated thread. | |
setClientName (str name) | |
Sets the name of the client. | |
setMaxRate (double rate) | |
Controls the number of packets that will be sent to the server. | |
Static Public Member Functions | |
static bool | connect (str hostname, int port) |
Attempts to establish a connection to the indicated PStatServer. | |
static | disconnect () |
Closes the connection previously established. | |
static PStatClient | getGlobalPstats () |
Returns a pointer to the global PStatClient object. | |
static bool | isConnected () |
Returns true if the client believes it is connected to a working PStatServer, false otherwise. | |
static | mainTick () |
A convenience function to call new_frame() on the global PStatClient's main thread, and any other threads with a sync_name of "Main". | |
static | resumeAfterPause () |
Resumes the PStatClient after the simulation has been paused for a while. | |
static | threadTick (str sync_name) |
A convenience function to call new_frame() on any threads with the indicated sync_name. | |
Public Attributes | |
String | client_name |
Retrieves the name of the client as set. | |
PStatCollector | collectors [] |
Returns the nth collector. | |
PStatThread | current_thread |
Returns a handle to the currently-executing thread. | |
PStatThread | main_thread |
Returns a handle to the client's Main thread. | |
double | max_rate |
Returns the maximum number of packets that will be sent to the server per second, per thread. | |
double | real_time |
Returns the time according to to the PStatClient's clock object. | |
PStatThread | threads [] |
Returns the nth thread. | |
bool clientConnect | ( | str | hostname, |
int | port ) |
The nonstatic implementation of connect().
clientDisconnect | ( | ) |
The nonstatic implementation of disconnect().
bool clientIsConnected | ( | ) |
The nonstatic implementation of is_connected().
clientMainTick | ( | ) |
A convenience function to call new_frame() on the given PStatClient's main thread, and any other threads with a sync_name of "Main".
clientResumeAfterPause | ( | ) |
Resumes the PStatClient after the simulation has been paused for a while.
This allows the stats to continue exactly where it left off, instead of leaving a big gap that would represent a chug.
clientThreadTick | ( | str | sync_name | ) |
A convenience function to call new_frame() on all of the threads with the indicated sync name.
|
static |
Attempts to establish a connection to the indicated PStatServer.
Returns true if successful, false on failure.
|
static |
Closes the connection previously established.
str getClientName | ( | ) |
Retrieves the name of the client as set.
PStatCollector getCollector | ( | int | index | ) |
Returns the nth collector.
PStatCollectorDef getCollectorDef | ( | int | index | ) |
Returns the definition body of the nth collector.
str getCollectorFullname | ( | int | index | ) |
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.
str getCollectorName | ( | int | index | ) |
Returns the name of the indicated collector.
list getCollectors | ( | ) |
PStatThread getCurrentThread | ( | ) |
Returns a handle to the currently-executing thread.
This is the thread that PStatCollectors will be counted in if they do not specify otherwise.
|
static |
Returns a pointer to the global PStatClient object.
It's legal to declare your own PStatClient locally, but it's also convenient to have a global one that everyone can register with. This is the global one.
PStatThread getMainThread | ( | ) |
Returns a handle to the client's Main thread.
This is the thread that started the application.
double getMaxRate | ( | ) |
Returns the maximum number of packets that will be sent to the server per second, per thread.
See set_max_rate().
int getNumCollectors | ( | ) |
Returns the total number of collectors the Client knows about.
int getNumThreads | ( | ) |
Returns the total number of threads the Client knows about.
double getRealTime | ( | ) |
Returns the time according to to the PStatClient's clock object.
It keeps its own clock, instead of using the global clock object, so the stats won't get mucked up if you put the global clock in non-real-time mode or something.
PStatThread getThread | ( | int | index | ) |
Returns the nth thread.
str getThreadName | ( | int | index | ) |
Returns the name of the indicated thread.
Thread getThreadObject | ( | int | index | ) |
Returns the Panda Thread object associated with the indicated PStatThread.
list getThreads | ( | ) |
str getThreadSyncName | ( | int | index | ) |
Returns the sync_name of the indicated thread.
|
static |
Returns true if the client believes it is connected to a working PStatServer, false otherwise.
|
static |
A convenience function to call new_frame() on the global PStatClient's main thread, and any other threads with a sync_name of "Main".
|
static |
Resumes the PStatClient after the simulation has been paused for a while.
This allows the stats to continue exactly where it left off, instead of leaving a big gap that would represent a chug.
setClientName | ( | str | name | ) |
Sets the name of the client.
This is reported to the PStatsServer, and will presumably be written in the title bar or something.
setMaxRate | ( | double | rate | ) |
Controls the number of packets that will be sent to the server.
Normally, one packet is sent per frame, but this can flood the server with more packets than it can handle if the frame rate is especially good (e.g. if nothing is onscreen at the moment). Set this parameter to a reasonable number to prevent this from happening.
This number specifies the maximum number of packets that will be sent to the server per second, per thread.
|
static |
A convenience function to call new_frame() on any threads with the indicated sync_name.
String client_name |
Retrieves the name of the client as set.
PStatCollector collectors[] |
Returns the nth collector.
PStatThread current_thread |
Returns a handle to the currently-executing thread.
This is the thread that PStatCollectors will be counted in if they do not specify otherwise.
PStatThread main_thread |
Returns a handle to the client's Main thread.
This is the thread that started the application.
double max_rate |
Returns the maximum number of packets that will be sent to the server per second, per thread.
See set_max_rate().
double real_time |
Returns the time according to to the PStatClient's clock object.
It keeps its own clock, instead of using the global clock object, so the stats won't get mucked up if you put the global clock in non-real-time mode or something.
PStatThread threads[] |
Returns the nth thread.