24 PStatClientControlMessage::
25 PStatClientControlMessage() {
44 case T_define_collectors:
47 for (
int i = 0; i < (int)_collectors.size(); i++) {
48 _collectors[i]->write_datagram(datagram);
53 case T_define_threads:
57 for (
int i = 0; i < (int)_names.size(); i++) {
65 <<
"Invalid PStatClientControlMessage::Type " << (int)_type <<
"\n";
91 case T_define_collectors:
95 for (
int i = 0; i < num; i++) {
98 _collectors.push_back(def);
103 case T_define_threads:
108 for (
int i = 0; i < num; i++) {
120 <<
"Read invalid PStatClientControlMessage type: " << (int)_type <<
"\n";
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
virtual void clear()
Resets the datagram to empty, in preparation for building up a new datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
size_t get_remaining_size() const
Return the bytes left in the datagram.
std::string get_string()
Extracts a variable-length string.
bool decode(const Datagram &datagram, PStatClientVersion *version)
Extracts the message from the indicated datagram.
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
void encode(Datagram &datagram) const
Writes the message into the indicated datagram.
Records the version number of a particular client.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_string(const std::string &str)
Adds a variable-length string to the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
Defines the details about the Collectors: the name, the suggested color, etc.
void read_datagram(DatagramIterator &source, PStatClientVersion *version)
Extracts the collectorDef definition from the datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...