Panda3D
pStatClientControlMessage.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 pStatClientControlMessage.h
10  * @author drose
11  * @date 2000-07-09
12  */
13 
14 #ifndef PSTATCLIENTCONTROLMESSAGE_H
15 #define PSTATCLIENTCONTROLMESSAGE_H
16 
17 #include "pandabase.h"
18 
19 #include "pStatCollectorDef.h"
20 
21 #include "pvector.h"
22 
23 class Datagram;
24 class PStatClientVersion;
25 
26 /**
27  * This kind of message is sent from the client to the server on the TCP
28  * socket to establish critical control information.
29  */
30 class EXPCL_PANDA_PSTATCLIENT PStatClientControlMessage {
31 public:
33 
34  void encode(Datagram &datagram) const;
35  bool decode(const Datagram &datagram, PStatClientVersion *version);
36 
37  enum Type {
38  T_datagram = 0,
39  T_hello,
40  T_define_collectors,
41  T_define_threads,
42  T_invalid
43  };
44 
45  Type _type;
46 
47  // Used for T_hello
48  std::string _client_hostname;
49  std::string _client_progname;
50  int _major_version;
51  int _minor_version;
52 
53  // Used for T_define_collectors
54  pvector<PStatCollectorDef *> _collectors;
55 
56  // Used for T_define_threads
57  int _first_thread_index;
58  pvector<std::string> _names;
59 };
60 
61 
62 #endif
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
This kind of message is sent from the client to the server on the TCP socket to establish critical co...
Records the version number of a particular client.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.