|
EmbeddedProto
2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
|
Go to the documentation of this file.
49 virtual ~Field() =
default;
64 virtual void clear() = 0;
78 void set(
const TYPE& v) { value_ = v; }
79 void set(
const TYPE&& v) { value_ = v; }
83 const TYPE&
get()
const {
return value_; }
84 TYPE&
get() {
return value_; }
86 operator TYPE()
const {
return value_; }
88 bool operator==(
const TYPE& rhs) {
return value_ == rhs; }
89 bool operator!=(
const TYPE& rhs) {
return value_ != rhs; }
90 bool operator>(
const TYPE& rhs) {
return value_ > rhs; }
91 bool operator<(
const TYPE& rhs) {
return value_ < rhs; }
92 bool operator>=(
const TYPE& rhs) {
return value_ >= rhs; }
93 bool operator<=(
const TYPE& rhs) {
return value_ <= rhs; }
95 template<
class TYPE_RHS>
97 template<
class TYPE_RHS>
99 template<
class TYPE_RHS>
101 template<
class TYPE_RHS>
103 template<
class TYPE_RHS>
105 template<
class TYPE_RHS>
108 void clear()
override { value_ =
static_cast<TYPE
>(0); }
123 ~int32()
override =
default;
137 ~int64()
override =
default;
~sint32() override=default
bool operator!=(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:98
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:175
int64(const int64_t &v)
Definition: Fields.h:134
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:93
uint64()
Definition: Fields.h:161
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:303
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:185
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:211
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:103
floatfixed()
Definition: Fields.h:273
~doublefixed() override=default
bool operator>=(const TYPE &rhs)
Definition: Fields.h:92
~fixed64() override=default
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:143
bool operator<(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:102
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:180
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:63
void clear() override
Reset the field to it's initial value.
Definition: Fields.h:108
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:113
~sint64() override=default
sfixed64()
Definition: Fields.h:259
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:273
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:221
floatfixed(const float &&v)
Definition: Fields.h:275
int32()
Definition: Fields.h:119
bool operator<=(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:106
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:53
The pure virtual definition of a message buffer to read from.
Definition: ReadBufferInterface.h:43
~fixed32() override=default
virtual Error serialize(WriteBufferInterface &buffer) const =0
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:236
sfixed32()
Definition: Fields.h:245
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:205
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:278
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:83
fixed32()
Definition: Fields.h:217
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:73
sfixed64(const int64_t &&v)
Definition: Fields.h:261
sint64()
Definition: Fields.h:189
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:243
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:216
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:298
TYPE FIELD_TYPE
Definition: Fields.h:71
~sfixed64() override=default
doublefixed()
Definition: Fields.h:287
Error deserialize(ReadBufferInterface &buffe) final
Definition: Fields.cpp:258
FieldTemplate(const TYPE &&v)
Definition: Fields.h:75
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:43
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:123
~sfixed32() override=default
void operator=(const TYPE &&v)
Definition: Fields.h:81
int32(const int32_t &v)
Definition: Fields.h:120
uint32()
Definition: Fields.h:147
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:253
bool operator!=(const TYPE &rhs)
Definition: Fields.h:89
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:288
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:133
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:163
virtual void clear()=0
Reset the field to it's initial value.
int64(const int64_t &&v)
Definition: Fields.h:135
doublefixed(const double &v)
Definition: Fields.h:288
uint32_t serialized_size() const
Calculate the size of this message when serialized.
Definition: Fields.cpp:36
The pure virtual definition of a message buffer used for writing .
Definition: WriteBufferInterface.h:46
sfixed64(const int64_t &v)
Definition: Fields.h:260
Error
This enumeration defines errors which can occur during serialization and deserialization.
Definition: Errors.h:38
uint32(const uint32_t &v)
Definition: Fields.h:148
sfixed32(const int32_t &&v)
Definition: Fields.h:247
fixed32(const uint32_t &&v)
Definition: Fields.h:219
void set(const TYPE &&v)
Definition: Fields.h:79
bool operator==(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:96
void operator=(const TYPE &v)
Definition: Fields.h:80
fixed32(const uint32_t &v)
Definition: Fields.h:218
const TYPE & get() const
Definition: Fields.h:83
sint32(const int32_t &v)
Definition: Fields.h:176
int64()
Definition: Fields.h:133
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:283
sint32()
Definition: Fields.h:175
~floatfixed() override=default
bool operator==(const TYPE &rhs)
Definition: Fields.h:88
sint64(const int64_t &&v)
Definition: Fields.h:191
~int64() override=default
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:231
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:248
bool operator<=(const TYPE &rhs)
Definition: Fields.h:93
fixed64(const uint64_t &&v)
Definition: Fields.h:233
virtual Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const =0
~boolean() override=default
boolean(const bool &&v)
Definition: Fields.h:205
Error serialize_with_id(uint32_t field_number, WriteBufferInterface &buffer) const final
Definition: Fields.cpp:153
boolean(const bool &v)
Definition: Fields.h:204
~uint64() override=default
floatfixed(const float &v)
Definition: Fields.h:274
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:226
bool operator<(const TYPE &rhs)
Definition: Fields.h:91
virtual Error deserialize(ReadBufferInterface &buffer)=0
uint64(const uint64_t &&v)
Definition: Fields.h:163
sint32(const int32_t &&v)
Definition: Fields.h:177
bool operator>=(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:104
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:263
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:268
TYPE & get()
Definition: Fields.h:84
FieldTemplate(const TYPE &v)
Definition: Fields.h:74
boolean()
Definition: Fields.h:203
uint64(const uint64_t &v)
Definition: Fields.h:162
bool operator>(const TYPE &rhs)
Definition: Fields.h:90
~FieldTemplate() override=default
Error deserialize(ReadBufferInterface &buffer) final
Definition: Fields.cpp:293
uint32(const uint32_t &&v)
Definition: Fields.h:149
sfixed32(const int32_t &v)
Definition: Fields.h:246
doublefixed(const double &&v)
Definition: Fields.h:289
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:195
~int32() override=default
int32(const int32_t &&v)
Definition: Fields.h:121
fixed64(const uint64_t &v)
Definition: Fields.h:232
sint64(const int64_t &v)
Definition: Fields.h:190
bool operator>(const FieldTemplate< TYPE_RHS > &rhs)
Definition: Fields.h:100
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:190
Error serialize(WriteBufferInterface &buffer) const final
Definition: Fields.cpp:200
void set(const TYPE &v)
Definition: Fields.h:78
~uint32() override=default
fixed64()
Definition: Fields.h:231