EmbeddedProto
2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
|
Class template that specifies the interface of an arry with the data type. More...
#include <RepeatedField.h>
Public Member Functions | |
RepeatedField ()=default | |
virtual | ~RepeatedField ()=default |
virtual uint32_t | get_length () const =0 |
Obtain the total number of DATA_TYPE items in the array. More... | |
virtual uint32_t | get_max_length () const =0 |
Obtain the maximum number of DATA_TYPE items which can at most be stored in the array. More... | |
virtual uint32_t | get_size () const =0 |
Obtain the total number of bytes currently stored in the array. More... | |
virtual uint32_t | get_max_size () const =0 |
Obtain the maximum number of bytes which can at most be stored in the array. More... | |
virtual DATA_TYPE & | get (uint32_t index)=0 |
Get a reference to the value at the given index. More... | |
virtual const DATA_TYPE & | get_const (uint32_t index) const =0 |
Get a constant reference to the value at the given index. More... | |
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... | |
virtual void | set (uint32_t index, const DATA_TYPE &value)=0 |
Set the value at the given index. More... | |
virtual Error | set_data (const DATA_TYPE *data, const uint32_t length)=0 |
Given a different array of known length copy that data into this object. More... | |
virtual Error | add (const DATA_TYPE &value)=0 |
Append a value to the end of the array. More... | |
virtual void | clear ()=0 |
Remove all data in the array and set it to the default value. 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... | |
Class template that specifies the interface of an arry with the data type.
|
default |
|
virtualdefault |
|
pure virtual |
Append a value to the end of the array.
[in] | value | The data to add. |
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Remove all data in the array and set it to the default value.
Implements EmbeddedProto::Field.
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
inlinefinal |
Function to deserialize this array.
From a buffer of data fill this array with data.
buffer | [in] The memory from which the message is obtained. |
|
pure virtual |
Get a reference to the value at the given index.
[in] | index | The desired index to return. |
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Get a constant reference to the value at the given index.
[in] | index | The desired index to return. |
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Obtain the total number of DATA_TYPE items in the array.
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Obtain the maximum number of DATA_TYPE items which can at most be stored in the array.
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Obtain the maximum number of bytes which can at most be stored in the array.
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
Obtain the total number of bytes currently stored in the array.
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
inline |
Get a reference to the value at the given index.
[in] | index | The desired index to return. |
|
inline |
Get a reference to the value at the given index. But constant.
[in] | index | The desired index to return. |
|
inlinevirtual |
Implements EmbeddedProto::Field.
|
inlinefinalvirtual |
Implements EmbeddedProto::Field.
|
inline |
Calculate the size of this field when serialized.
The calculation only includes the data, not the size required by the tag and
|
inline |
Calculate the size of this field when serialized.
|
pure virtual |
Set the value at the given index.
[in] | index | The desired index to change. |
[in] | value | The value we would like to set. |
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.
|
pure virtual |
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. |
Implemented in EmbeddedProto::RepeatedFieldFixedSize< DATA_TYPE, MAX_LENGTH >.