MADARA  3.4.1
madara::filters::BufferFilter Class Referenceabstract

Abstract base class for implementing buffer filters via a functor interface. More...

#include <BufferFilter.h>

Inheritance diagram for madara::filters::BufferFilter:
madara::filters::AESBufferFilter madara::filters::JavaBufferFilter madara::filters::LZ4BufferFilter

Public Member Functions

virtual ~BufferFilter ()
 Destructor. More...
 
virtual int decode (char *source, int size, int max_size) const =0
 Decodes the buffer in place. More...
 
virtual int encode (char *source, int size, int max_size) const =0
 Encodes the buffer in place. More...
 
virtual std::string get_id (void)=0
 Gets the id of the filter. More...
 
virtual uint32_t get_version (void)=0
 Gets the version of the filter. More...
 

Detailed Description

Abstract base class for implementing buffer filters via a functor interface.

When subclassing this class, create a new instance with the new operator, and the pointer will be managed by the underlying MADARA infrastructure.

Definition at line 26 of file BufferFilter.h.

Constructor & Destructor Documentation

◆ ~BufferFilter()

virtual madara::filters::BufferFilter::~BufferFilter ( )
inlinevirtual

Destructor.

Definition at line 32 of file BufferFilter.h.

Member Function Documentation

◆ decode()

virtual int madara::filters::BufferFilter::decode ( char *  source,
int  size,
int  max_size 
) const
pure virtual

Decodes the buffer in place.

Parameters
sourcethe source and destination buffer
sizethe amount of data in the buffer in bytes
max_sizethe amount of bytes the buffer can hold
Returns
the new size after decoding

Implemented in madara::filters::AESBufferFilter, madara::filters::LZ4BufferFilter, and madara::filters::JavaBufferFilter.

◆ encode()

virtual int madara::filters::BufferFilter::encode ( char *  source,
int  size,
int  max_size 
) const
pure virtual

Encodes the buffer in place.

Parameters
sourcethe source and destination buffer
sizethe amount of data in the buffer in bytes
max_sizethe amount of bytes the buffer can hold
Returns
the new size after encoding

Implemented in madara::filters::AESBufferFilter, madara::filters::LZ4BufferFilter, and madara::filters::JavaBufferFilter.

◆ get_id()

virtual std::string madara::filters::BufferFilter::get_id ( void  )
pure virtual

Gets the id of the filter.

This is used in the serialization process for transports and checkpoints to identify which filter is used.

Implemented in madara::filters::AESBufferFilter, madara::filters::LZ4BufferFilter, and madara::filters::JavaBufferFilter.

◆ get_version()

virtual uint32_t madara::filters::BufferFilter::get_version ( void  )
pure virtual

Gets the version of the filter.

See also
madara::utility::get_uint_version for one way to get this from a string version

Implemented in madara::filters::AESBufferFilter, madara::filters::LZ4BufferFilter, and madara::filters::JavaBufferFilter.


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