Panda3D
 All Classes Functions Variables Enumerations
pStatMonitor.I
1 // Filename: pStatMonitor.I
2 // Created by: drose (14Jul00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: PStatMonitor::get_server
18 // Access: Public
19 // Description: Returns the server that owns this monitor.
20 ////////////////////////////////////////////////////////////////////
23  return _server;
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: PStatMonitor::get_client_data
28 // Access: Public
29 // Description: Returns the client data associated with this monitor.
30 ////////////////////////////////////////////////////////////////////
31 INLINE const PStatClientData *PStatMonitor::
32 get_client_data() const {
33  return _client_data;
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: PStatMonitor::get_collector_name
38 // Access: Public
39 // Description: Returns the name of the indicated collector, if it is
40 // known.
41 ////////////////////////////////////////////////////////////////////
42 INLINE string PStatMonitor::
43 get_collector_name(int collector_index) {
44  if (!_client_data.is_null() &&
45  _client_data->has_collector(collector_index)) {
46  return _client_data->get_collector_name(collector_index);
47  }
48  return "Unknown";
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: PStatMonitor::is_client_known
53 // Access: Public
54 // Description: Returns true if we've yet received the "hello"
55 // message from the client indicating its name, etc.
56 ////////////////////////////////////////////////////////////////////
57 INLINE bool PStatMonitor::
58 is_client_known() const {
59  return _client_known;
60 }
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: PStatMonitor::get_client_hostname
64 // Access: Public
65 // Description: Returns the hostname of the client we're connected
66 // to, if known. This may not be known immediately at
67 // creation time, but should be learned shortly
68 // thereafter when we receive the client's "hello"
69 // message. See is_client_known().
70 ////////////////////////////////////////////////////////////////////
71 INLINE string PStatMonitor::
73  return _client_hostname;
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: PStatMonitor::get_client_progname
78 // Access: Public
79 // Description: Returns the program name of the client we're
80 // connected to, if known. This may not be known
81 // immediately at creation time, but should be learned
82 // shortly thereafter when we receive the client's
83 // "hello" message. See is_client_known().
84 ////////////////////////////////////////////////////////////////////
85 INLINE string PStatMonitor::
87  return _client_progname;
88 }
string get_client_progname() const
Returns the program name of the client we're connected to, if known.
Definition: pStatMonitor.I:86
string get_collector_name(int collector_index)
Returns the name of the indicated collector, if it is known.
Definition: pStatMonitor.I:43
The data associated with a particular client, but not with any one particular frame or thread: the li...
string get_client_hostname() const
Returns the hostname of the client we're connected to, if known.
Definition: pStatMonitor.I:72
PStatServer * get_server()
Returns the server that owns this monitor.
Definition: pStatMonitor.I:22
bool is_client_known() const
Returns true if we've yet received the "hello" message from the client indicating its name...
Definition: pStatMonitor.I:58
const PStatClientData * get_client_data() const
Returns the client data associated with this monitor.
Definition: pStatMonitor.I:32
The overall manager of the network connections.
Definition: pStatServer.h:41