EmbeddedProto
2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
|
This class is used in a message to calculate the current serialized size. More...
#include <MessageSizeCalculator.h>
Public Member Functions | |
MessageSizeCalculator ()=default | |
~MessageSizeCalculator () override=default | |
void | clear () override |
Reset the size count of the buffer. More... | |
uint32_t | get_size () const override |
Obtain the total number of bytes currently stored in the buffer. More... | |
uint32_t | get_max_size () const override |
To continue serialization return the maximum number that fits in a 32bit unsigned int. More... | |
uint32_t | get_available_size () const override |
To continue serialization return the maximum number that fits in a 32bit unsigned int. More... | |
bool | push (const uint8_t byte) override |
For calculating the size we just increment the counter and always return true. More... | |
bool | push (const uint8_t *bytes, const uint32_t length) override |
Increment the size with the given length. More... | |
Public Member Functions inherited from EmbeddedProto::WriteBufferInterface | |
WriteBufferInterface ()=default | |
virtual | ~WriteBufferInterface ()=default |
This class is used in a message to calculate the current serialized size.
To calculate the size of a message given the current data a dummy serialization is performed. This class mimics the buffer in which the data is stored. Instead of storing it, only the size is incremented for the bytes pushed. No actual data is pushed into a buffer.
|
default |
|
overridedefault |
|
inlineoverridevirtual |
Reset the size count of the buffer.
Implements EmbeddedProto::WriteBufferInterface.
|
inlineoverridevirtual |
To continue serialization return the maximum number that fits in a 32bit unsigned int.
Implements EmbeddedProto::WriteBufferInterface.
|
inlineoverridevirtual |
To continue serialization return the maximum number that fits in a 32bit unsigned int.
Implements EmbeddedProto::WriteBufferInterface.
|
inlineoverridevirtual |
Obtain the total number of bytes currently stored in the buffer.
Implements EmbeddedProto::WriteBufferInterface.
|
inlineoverridevirtual |
Increment the size with the given length.
Implements EmbeddedProto::WriteBufferInterface.
|
inlineoverridevirtual |
For calculating the size we just increment the counter and always return true.
Implements EmbeddedProto::WriteBufferInterface.