Panda3D
|
A simple, scrolling-text stats monitor. More...
#include "textMonitor.h"
Public Member Functions | |
TextMonitor (TextStats *server, ostream *outStream, bool show_raw_data) | |
virtual string | get_monitor_name () |
Should be redefined to return a descriptive name for the type of PStatsMonitor this is. | |
TextStats * | get_server () |
Returns the server that owns this monitor. | |
virtual void | got_bad_version (int client_major, int client_minor, int server_major, int server_minor) |
Like got_hello(), this is called when the "hello" message has been received from the client. | |
virtual void | got_hello () |
Called when the "hello" message has been received from the client. | |
virtual bool | is_thread_safe () |
Should be redefined to return true if this monitor class can handle running in a sub-thread. | |
virtual void | lost_connection () |
Called whenever the connection to the client has been lost. | |
virtual void | new_data (int thread_index, int frame_number) |
Called as each frame's data is made available. | |
void | show_level (const PStatViewLevel *level, int indent_level) |
void | show_ms (const PStatViewLevel *level, int indent_level) |
A simple, scrolling-text stats monitor.
Guaranteed to compile on every platform.
Definition at line 32 of file textMonitor.h.
string TextMonitor::get_monitor_name | ( | ) | [virtual] |
Should be redefined to return a descriptive name for the type of PStatsMonitor this is.
Implements PStatMonitor.
Definition at line 50 of file textMonitor.cxx.
TextStats * TextMonitor::get_server | ( | ) |
Returns the server that owns this monitor.
Reimplemented from PStatMonitor.
Definition at line 39 of file textMonitor.cxx.
void TextMonitor::got_bad_version | ( | int | client_major, |
int | client_minor, | ||
int | server_major, | ||
int | server_minor | ||
) | [virtual] |
Like got_hello(), this is called when the "hello" message has been received from the client.
At this time, the client's hostname and program name will be known. However, the client appears to be an incompatible version and the connection will be terminated; the monitor should issue a message to that effect.
Reimplemented from PStatMonitor.
Definition at line 79 of file textMonitor.cxx.
References PStatMonitor::get_client_hostname(), and PStatMonitor::get_client_progname().
void TextMonitor::got_hello | ( | ) | [virtual] |
Called when the "hello" message has been received from the client.
At this time, the client's hostname and program name will be known.
Reimplemented from PStatMonitor.
Definition at line 62 of file textMonitor.cxx.
References PStatMonitor::get_client_hostname(), and PStatMonitor::get_client_progname().
bool TextMonitor::is_thread_safe | ( | ) | [virtual] |
Should be redefined to return true if this monitor class can handle running in a sub-thread.
This is not related to the question of whether it can handle multiple different PStatThreadDatas; this is strictly a question of whether or not the monitor itself wants to run in a sub-thread.
Reimplemented from PStatMonitor.
Definition at line 186 of file textMonitor.cxx.
void TextMonitor::lost_connection | ( | ) | [virtual] |
Called whenever the connection to the client has been lost.
This is a permanent state change. The monitor should update its display to represent this, and may choose to close down automatically.
Reimplemented from PStatMonitor.
Definition at line 170 of file textMonitor.cxx.
void TextMonitor::new_data | ( | int | thread_index, |
int | frame_number | ||
) | [virtual] |
Called as each frame's data is made available.
There is no gurantee the frames will arrive in order, or that all of them will arrive at all. The monitor should be prepared to accept frames received out-of-order or missing.
Reimplemented from PStatMonitor.
Definition at line 100 of file textMonitor.cxx.
References PStatView::all_collectors_known(), PStatViewLevel::get_child(), PStatMonitor::get_client_data(), PStatClientData::get_collector_fullname(), PStatClientData::get_collector_has_level(), PStatThreadData::get_frame(), PStatThreadData::get_frame_rate(), PStatThreadData::get_latest_frame_number(), PStatMonitor::get_level_view(), PStatView::get_net_value(), PStatViewLevel::get_num_children(), PStatFrameData::get_num_events(), PStatClientData::get_num_toplevel_collectors(), PStatView::get_thread_data(), PStatClientData::get_thread_name(), PStatFrameData::get_time(), PStatFrameData::get_time_collector(), PStatView::get_top_level(), PStatClientData::get_toplevel_collector(), PStatMonitor::get_view(), PStatClientData::has_collector(), PStatFrameData::is_start(), and PStatView::set_to_frame().