Panda3D
textMonitor.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file textMonitor.h
10  * @author drose
11  * @date 2000-07-12
12  */
13 
14 #ifndef TEXTMONITOR_H
15 #define TEXTMONITOR_H
16 
17 #include "pandatoolbase.h"
18 #include "pStatMonitor.h"
19 
20 // [PECI]
21 #include <iostream>
22 #include <fstream>
23 
24 class TextStats;
25 
26 /**
27  * A simple, scrolling-text stats monitor. Guaranteed to compile on every
28  * platform.
29  */
30 class TextMonitor : public PStatMonitor {
31 public:
32  TextMonitor(TextStats *server, std::ostream *outStream, bool show_raw_data);
34 
35  virtual std::string get_monitor_name();
36 
37  virtual void got_hello();
38  virtual void got_bad_version(int client_major, int client_minor,
39  int server_major, int server_minor);
40  virtual void new_data(int thread_index, int frame_number);
41  virtual void lost_connection();
42  virtual bool is_thread_safe();
43 
44  void show_ms(const PStatViewLevel *level, int indent_level);
45  void show_level(const PStatViewLevel *level, int indent_level);
46 
47 private:
48  std::ostream *_outStream; //[PECI]
49  bool _show_raw_data;
50 };
51 
52 #include "textMonitor.I"
53 
54 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void lost_connection()
Called whenever the connection to the client has been lost.
virtual std::string get_monitor_name()
Should be redefined to return a descriptive name for the type of PStatsMonitor this is.
Definition: textMonitor.cxx:43
TextStats * get_server()
Returns the server that owns this monitor.
Definition: textMonitor.cxx:34
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a single level value, or band of color, within a View.
A simple, scrolling-text stats server.
Definition: textStats.h:29
This is an abstract class that presents the interface to any number of different front-ends for the s...
Definition: pStatMonitor.h:39
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.
Definition: textMonitor.cxx:65
A simple, scrolling-text stats monitor.
Definition: textMonitor.h:30
virtual void got_hello()
Called when the "hello" message has been received from the client.
Definition: textMonitor.cxx:52
virtual bool is_thread_safe()
Should be redefined to return true if this monitor class can handle running in a sub-thread.
virtual void new_data(int thread_index, int frame_number)
Called as each frame's data is made available.
Definition: textMonitor.cxx:83