Panda3D

Loading...
Searching...
No Matches
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:
32 PStatClientControlMessage();
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_expire_thread,
43 T_invalid
44 };
45
46 Type _type;
47
48 // Used for T_hello
49 std::string _client_hostname;
50 std::string _client_progname;
51 int _major_version;
52 int _minor_version;
53
54 // Used for T_define_collectors
55 pvector<PStatCollectorDef *> _collectors;
56
57 // Used for T_define_threads
58 int _first_thread_index;
59 pvector<std::string> _names;
60};
61
62
63#endif
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
PStatClientControlMessage::decode
bool decode(const Datagram &datagram, PStatClientVersion *version)
Extracts the message from the indicated datagram.
Definition pStatClientControlMessage.cxx:78
PStatClientControlMessage::encode
void encode(Datagram &datagram) const
Writes the message into the indicated datagram.
Definition pStatClientControlMessage.cxx:33
PStatClientVersion
Records the version number of a particular client.
Definition pStatClientVersion.h:26
pStatCollectorDef.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.