15 #include "config_pstats.h"
16 #include "pStatClientControlMessage.h"
17 #include "pStatClientVersion.h"
20 #include "datagramIterator.h"
27 PStatClientControlMessage::
28 PStatClientControlMessage() {
49 case T_define_collectors:
52 for (
int i = 0; i < (int)_collectors.size(); i++) {
53 _collectors[i]->write_datagram(datagram);
58 case T_define_threads:
62 for (
int i = 0; i < (int)_names.size(); i++) {
70 <<
"Invalid PStatClientControlMessage::Type " << (int)_type <<
"\n";
98 case T_define_collectors:
102 for (
int i = 0; i < num; i++) {
105 _collectors.push_back(def);
110 case T_define_threads:
115 for (
int i = 0; i < num; i++) {
127 <<
"Read invalid PStatClientControlMessage type: " << (int)_type <<
"\n";
void add_uint8(PN_uint8 value)
Adds an unsigned 8-bit integer to the datagram.
void add_string(const string &str)
Adds a variable-length string to the datagram.
virtual void clear()
Resets the datagram to empty, in preparation for building up a new datagram.
void encode(Datagram &datagram) const
Writes the message into the indicated datagram.
PN_uint8 get_uint8()
Extracts an unsigned 8-bit integer.
string get_string()
Extracts a variable-length string.
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
int get_remaining_size() const
Return the bytes left in the datagram.
bool decode(const Datagram &datagram, PStatClientVersion *version)
Extracts the message from the indicated datagram.
Records the version number of a particular client.
void add_uint16(PN_uint16 value)
Adds an unsigned 16-bit integer to the datagram.
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 ...