34 : id(_id), group_count(_group_count) {
72 len = ((*bufp) - lenp) - 2;
112 if (
id == other.
id &&
Abstract base class for managing serialized statistics.
#define HT_THROW_INPUT_OVERRUN(_s_)
Base class managing serialized statistics.
StatsSerializable(uint16_t _id, uint8_t _group_count)
Constructor; creates a new object with an ID and a number of groups.
uint8_t group_count
Number of groups in group_ids.
virtual void decode_group(int group, uint16_t len, const uint8_t **bufp, size_t *remainp)=0
Abstruct function to deserialize a group from a memory buffer.
uint16_t decode_i16(const uint8_t **bufp, size_t *remainp)
Decode a 16-bit integer in little-endian order.
virtual void encode_group(int group, uint8_t **bufp) const =0
Abstruct function to serialize a group into a memory buffer.
size_t encoded_length() const
Returns the encoded length of this object.
Logging routines and macros.
Compatibility Macros for C/C++.
void encode_i16(uint8_t **bufp, uint16_t val)
Encode a 16-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
void decode(const uint8_t **bufp, size_t *remainp)
Deserializes this object from a buffer.
bool operator==(const StatsSerializable &other) const
Equal operator.
virtual size_t encoded_length_group(int group) const =0
Abstruct function returning the serialized length of a group.
StatsSerializable & operator=(const StatsSerializable &other)
Assignment operator.
uint16_t id
The statistics ID.
uint8_t group_ids[32]
The actual group IDs.
void encode(uint8_t **bufp) const
Encodes the statistics to a serialized buffer.