EmbeddedProto
2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
|
A template class that actually holds some data. More...
#include <RepeatedFieldFixedSize.h>
Public Member Functions | |
RepeatedFieldFixedSize () | |
~RepeatedFieldFixedSize () override=default | |
RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH > & | operator= (const RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH > &rhs) |
Assign one repieted field to the other, but only when the length and type matches. More... | |
uint32_t | get_length () const override |
Obtain the total number of DATA_TYPE items in the array. More... | |
uint32_t | get_max_length () const override |
Obtain the maximum number of DATA_TYPE items which can at most be stored in the array. More... | |
uint32_t | get_size () const override |
Obtain the total number of bytes currently stored in the array. More... | |
uint32_t | get_max_size () const override |
Obtain the maximum number of bytes which can at most be stored in the array. More... | |
DATA_TYPE & | get (uint32_t index) override |
Get a reference to the value at the given index. More... | |
const DATA_TYPE & | get_const (uint32_t index) const override |
Get a constant reference to the value at the given index. More... | |
void | set (uint32_t index, const DATA_TYPE &value) override |
Set the value at the given index. More... | |
Error | set_data (const DATA_TYPE *data, const uint32_t length) override |
Given a different array of known length copy that data into this object. More... | |
Error | add (const DATA_TYPE &value) override |
Append a value to the end of the array. More... | |
void | clear () override |
Remove all data in the array and set it to the default value. More... | |
Public Member Functions inherited from EmbeddedProto::RepeatedField< DATA_TYPE > | |
RepeatedField ()=default | |
virtual | ~RepeatedField ()=default |
DATA_TYPE & | operator[] (uint32_t index) |
Get a reference to the value at the given index. More... | |
const DATA_TYPE & | operator[] (uint32_t index) const |
Get a reference to the value at the given index. But constant. More... | |
Error | serialize (WriteBufferInterface &buffer) const |
Error | serialize_with_id (uint32_t field_number, WriteBufferInterface &buffer) const final |
Error | deserialize (::EmbeddedProto::ReadBufferInterface &buffer) final |
Function to deserialize this array. More... | |
uint32_t | serialized_size_packed (int32_t field_number) const |
Calculate the size of this field when serialized. More... | |
uint32_t | serialized_size_unpacked (int32_t field_number) const |
Calculate the size of this field when serialized. More... | |
Public Member Functions inherited from EmbeddedProto::Field | |
Field ()=default | |
virtual | ~Field ()=default |
virtual Error | deserialize (ReadBufferInterface &buffer)=0 |
uint32_t | serialized_size () const |
Calculate the size of this message when serialized. More... | |
A template class that actually holds some data.
This is a separate class to make it possible to not have the size defined in every function or class using this type of object.
|
inline |
|
overridedefault |
|
inlineoverridevirtual |
Append a value to the end of the array.
[in] | value | The data to add. |
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Remove all data in the array and set it to the default value.
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Get a reference to the value at the given index.
[in] | index | The desired index to return. |
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Get a constant reference to the value at the given index.
[in] | index | The desired index to return. |
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Obtain the total number of DATA_TYPE items in the array.
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Obtain the maximum number of DATA_TYPE items which can at most be stored in the array.
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Obtain the maximum number of bytes which can at most be stored in the array.
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Obtain the total number of bytes currently stored in the array.
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inline |
Assign one repieted field to the other, but only when the length and type matches.
|
inlineoverridevirtual |
Set the value at the given index.
[in] | index | The desired index to change. |
[in] | value | The value we would like to set. |
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.
|
inlineoverridevirtual |
Given a different array of known length copy that data into this object.
[in] | data | A pointer the array to copy from. |
[in] | length | The number of value of DATA_TYPE in the array. |
Implements EmbeddedProto::RepeatedField< DATA_TYPE >.