EmbeddedProto
2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
|
This is a wrapper around a ReadBufferInterface only exposing a given number of bytes. More...
#include <ReadBufferSection.h>
Public Member Functions | |
ReadBufferSection ()=delete | |
Explicitly delete the default constructor in favor of the one with parameters. More... | |
ReadBufferSection (ReadBufferInterface &buffer, const uint32_t size) | |
The constructor of the class with the required parameters. More... | |
virtual | ~ReadBufferSection ()=default |
uint32_t | get_size () const override |
Return the number of bytes remaining. More... | |
uint32_t | get_max_size () const override |
Obtain the total number of bytes which can at most be stored in the buffer. More... | |
bool | peek (uint8_t &byte) const override |
Expose the function of the parent buffer. More... | |
void | advance () override |
Decrement the size and call advance on the parent buffer. More... | |
void | advance (const uint32_t N) override |
Decrement the size by N bytes and call advance on the parent buffer. More... | |
bool | pop (uint8_t &byte) override |
Decrement the size and pop the next byte from the parent buffer. More... | |
Public Member Functions inherited from EmbeddedProto::ReadBufferInterface | |
ReadBufferInterface ()=default | |
virtual | ~ReadBufferInterface ()=default |
This is a wrapper around a ReadBufferInterface only exposing a given number of bytes.
This class is used when decoding a length delimited fields. It is constructed given a message buffer and a size. This class will return bytes from the buffer for the given number of bytes stated in the size parameter.
|
delete |
Explicitly delete the default constructor in favor of the one with parameters.
EmbeddedProto::ReadBufferSection::ReadBufferSection | ( | ReadBufferInterface & | buffer, |
const uint32_t | size | ||
) |
The constructor of the class with the required parameters.
buffer | The actual data buffer from which the bytes are obtained. |
size | The maximum number of bytes to return from buffer. |
|
virtualdefault |
|
overridevirtual |
Decrement the size and call advance on the parent buffer.
This will not do anything if size zero is reached.
Implements EmbeddedProto::ReadBufferInterface.
|
overridevirtual |
Decrement the size by N bytes and call advance on the parent buffer.
This will not do anything if size zero is reached.
Implements EmbeddedProto::ReadBufferInterface.
|
overridevirtual |
Obtain the total number of bytes which can at most be stored in the buffer.
In the case of this buffer section this will return the size of the section.
Implements EmbeddedProto::ReadBufferInterface.
|
overridevirtual |
Return the number of bytes remaining.
Implements EmbeddedProto::ReadBufferInterface.
|
overridevirtual |
Expose the function of the parent buffer.
This will not do anything if size zero is reached.
Implements EmbeddedProto::ReadBufferInterface.
|
overridevirtual |
Decrement the size and pop the next byte from the parent buffer.
This will not do anything if size zero is reached.
Implements EmbeddedProto::ReadBufferInterface.