44 [[nodiscard]]
virtual std::uint32_t
message_id()
const = 0;
50 [[nodiscard]]
virtual std::unique_ptr<ProtoMessage>
clone()
const = 0;
65 buf.reserve(
static_cast<std::size_t
>(size));
68 if (buf.size() !=
static_cast<std::size_t
>(size))
71 std::memcpy(data, buf.data(), buf.size());
88 ProtoReader reader(data,
static_cast<std::size_t
>(size));
98 [[nodiscard]]
virtual std::uint32_t
key()
const = 0;
99 [[nodiscard]]
virtual const std::string&
name()
const = 0;
100 [[nodiscard]]
virtual const std::string&
object_id()
const = 0;
108 [[nodiscard]]
virtual std::uint32_t
key()
const = 0;
Intermediate base for ListEntities*Response messages (proto (base_class) = "InfoResponseProtoMessage"...
Definition proto_message.hpp:96
virtual const std::string & name() const =0
virtual const std::string & object_id() const =0
virtual std::uint32_t key() const =0
Base class every generated message derives from.
Definition proto_message.hpp:23
virtual bool decode(ProtoReader &reader)=0
Decode wire bytes into this message.
std::string SerializeAsString() const
Serialize to a freshly allocated string.
Definition proto_message.hpp:76
virtual std::unique_ptr< ProtoMessage > clone() const =0
A deep copy of this message as a new owning pointer.
bool SerializeToArray(void *data, const int size) const
Serialize into a caller-provided buffer of exactly size bytes.
Definition proto_message.hpp:61
ProtoMessage(const ProtoMessage &)=default
bool ParseFromArray(const void *data, const int size)
Parse wire bytes into this message. Returns false on malformed input.
Definition proto_message.hpp:85
ProtoMessage & operator=(const ProtoMessage &)=default
virtual std::uint32_t message_id() const =0
The protocol message id (the proto (id) option), or 0 if the message carries none.
virtual void encode(ProtoWriter &writer) const =0
Serialize this message's fields to writer (ascending field number).
ProtoMessage & operator=(ProtoMessage &&)=default
std::size_t ByteSizeLong() const
Alias for calculate_size() — matches protobuf's API.
Definition proto_message.hpp:55
ProtoMessage(ProtoMessage &&)=default
virtual ~ProtoMessage()=default
virtual std::size_t calculate_size() const =0
Exact number of bytes encode() will write.
virtual const char * message_name() const =0
The proto message name (e.g. "ListEntitiesLightResponse").
Intermediate base for *StateResponse messages (proto (base_class) = "StateResponseProtoMessage").
Definition proto_message.hpp:106
virtual std::uint32_t key() const =0
Self-contained proto3 wire-format primitives (varint / zigzag / fixed32 / fixed64 / length-delimited)...