EmbeddedProto  2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
Public Member Functions | List of all members
EmbeddedProto::WriteBufferInterface Class Referenceabstract

The pure virtual definition of a message buffer used for writing . More...

#include <WriteBufferInterface.h>

Inheritance diagram for EmbeddedProto::WriteBufferInterface:
Inheritance graph
[legend]

Public Member Functions

 WriteBufferInterface ()=default
 
virtual ~WriteBufferInterface ()=default
 
virtual void clear ()=0
 Delete all data in the buffer. More...
 
virtual uint32_t get_size () const =0
 Obtain the total number of bytes currently stored in the buffer. More...
 
virtual uint32_t get_max_size () const =0
 Obtain the total number of bytes which can at most be stored in the buffer. More...
 
virtual uint32_t get_available_size () const =0
 Obtain the total number of bytes still available in the buffer. More...
 
virtual bool push (const uint8_t byte)=0
 Push a single byte into the buffer. More...
 
virtual bool push (const uint8_t *bytes, const uint32_t length)=0
 Push an array of bytes into the buffer. More...
 

Detailed Description

The pure virtual definition of a message buffer used for writing .

This interface is to be used by classes wishing to use the buffer. An actual implementation is made specific to how you would like to store data.

The buffer deals with bytes (uint8_t) only.

Constructor & Destructor Documentation

◆ WriteBufferInterface()

EmbeddedProto::WriteBufferInterface::WriteBufferInterface ( )
default

◆ ~WriteBufferInterface()

virtual EmbeddedProto::WriteBufferInterface::~WriteBufferInterface ( )
virtualdefault

Member Function Documentation

◆ clear()

virtual void EmbeddedProto::WriteBufferInterface::clear ( )
pure virtual

Delete all data in the buffer.

Implemented in EmbeddedProto::MessageSizeCalculator.

◆ get_available_size()

virtual uint32_t EmbeddedProto::WriteBufferInterface::get_available_size ( ) const
pure virtual

Obtain the total number of bytes still available in the buffer.

Implemented in EmbeddedProto::MessageSizeCalculator.

◆ get_max_size()

virtual uint32_t EmbeddedProto::WriteBufferInterface::get_max_size ( ) const
pure virtual

Obtain the total number of bytes which can at most be stored in the buffer.

Implemented in EmbeddedProto::MessageSizeCalculator.

◆ get_size()

virtual uint32_t EmbeddedProto::WriteBufferInterface::get_size ( ) const
pure virtual

Obtain the total number of bytes currently stored in the buffer.

Implemented in EmbeddedProto::MessageSizeCalculator.

◆ push() [1/2]

virtual bool EmbeddedProto::WriteBufferInterface::push ( const uint8_t *  bytes,
const uint32_t  length 
)
pure virtual

Push an array of bytes into the buffer.

The given array will be appended after already addded data in the buffer.

Parameters
[in]bytesPointer to the array of bytes.
[in]lengthThe number of bytes in the array.
Returns
True when there was space to add the bytes.

Implemented in EmbeddedProto::MessageSizeCalculator.

◆ push() [2/2]

virtual bool EmbeddedProto::WriteBufferInterface::push ( const uint8_t  byte)
pure virtual

Push a single byte into the buffer.

Parameters
[in]byteThe data to append after previously added data in the buffer.
Returns
True when there was space to add the byte.

Implemented in EmbeddedProto::MessageSizeCalculator.


The documentation for this class was generated from the following file: