Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
BufferAccessor Class Referenceabstract

Base class for a buffer accessor object. More...

#include <cs_BufferAccessor.h>

Inheritance diagram for BufferAccessor:

Public Member Functions

virtual ~BufferAccessor ()
 Default destructor. More...
 
virtual cs_ret_code_t assign (buffer_ptr_t buffer, cs_buffer_size_t size)=0
 Assign the buffer used to hold the data. More...
 
virtual cs_buffer_size_t getBufferSize () const =0
 Get the capacity of the buffer. More...
 
virtual cs_buffer_size_t getSerializedSize () const =0
 Get the size of the serialized data in the buffer. More...
 
virtual cs_buffer_size_t getRemainingCapacity () const
 
virtual cs_data_t getSerializedBuffer ()=0
 Get the pointer to the buffer. More...
 

Detailed Description

Base class for a buffer accessor object.

Any object that works on a buffer can use this as a base class.

Constructor & Destructor Documentation

◆ ~BufferAccessor()

virtual BufferAccessor::~BufferAccessor ( )
inlinevirtual

Default destructor.

Member Function Documentation

◆ assign()

virtual cs_ret_code_t BufferAccessor::assign ( buffer_ptr_t  buffer,
cs_buffer_size_t  size 
)
pure virtual

Assign the buffer used to hold the data.

Parameters
[in]bufferThe buffer to be used.
[in]sizeSize of buffer in bytes.
Returns
ERR_SUCCESS on success.

Implemented in ControlPacketAccessor< PAYLOAD_SIZE >, and ResultPacketAccessor< PAYLOAD_SIZE >.

◆ getBufferSize()

virtual cs_buffer_size_t BufferAccessor::getBufferSize ( ) const
pure virtual

Get the capacity of the buffer.

Returns
Maximum size of the buffer in bytes.

Implemented in ControlPacketAccessor< PAYLOAD_SIZE >, and ResultPacketAccessor< PAYLOAD_SIZE >.

◆ getRemainingCapacity()

virtual cs_buffer_size_t BufferAccessor::getRemainingCapacity ( ) const
inlinevirtual

◆ getSerializedBuffer()

virtual cs_data_t BufferAccessor::getSerializedBuffer ( )
pure virtual

Get the pointer to the buffer.

Returns
Struct with pointer to buffer and size of the serialized data in bytes.

Implemented in ControlPacketAccessor< PAYLOAD_SIZE >, and ResultPacketAccessor< PAYLOAD_SIZE >.

◆ getSerializedSize()

virtual cs_buffer_size_t BufferAccessor::getSerializedSize ( ) const
pure virtual

Get the size of the serialized data in the buffer.

Returns
Size of the serialized data in bytes.

Implemented in ControlPacketAccessor< PAYLOAD_SIZE >, and ResultPacketAccessor< PAYLOAD_SIZE >.


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