jaffarCommon
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
jaffarCommon::serializer::Base Class Referenceabstract

#include <base.hpp>

Inheritance diagram for jaffarCommon::serializer::Base:
Inheritance graph
[legend]

Public Member Functions

 Base (void *__restrict outputDataBuffer, const size_t outputDataBufferSize)
 
virtual void push (const void *const __restrict inputDataBuffer=nullptr, const size_t inputDataSize=0)=0
 
virtual void pushContiguous (const void *const __restrict inputDataBuffer=nullptr, const size_t inputDataSize=0)=0
 
__JAFFAR_COMMON__INLINE__ size_t getOutputSize () const
 
__JAFFAR_COMMON__INLINE__ uint8_t * getOutputDataBuffer () const
 

Protected Attributes

uint8_t *__restrict const _outputDataBuffer
 
const size_t _outputDataBufferSize
 
size_t _outputDataBufferPos = 0
 

Detailed Description

Base class for serializers

A serializer receives a output data buffer upon creation, and allows the user to fill it up with different elements (e.g. attributes of a class) by repeated calls to the different 'push' functions.

Constructor & Destructor Documentation

◆ Base()

jaffarCommon::serializer::Base::Base ( void *__restrict  outputDataBuffer,
const size_t  outputDataBufferSize 
)
inline

Default constructor for the serializer classes

Parameters
[in]outputDataBufferThe input buffer from whence to read the input data
[in]outputDataBufferSizeThe size of the input buffer

Member Function Documentation

◆ getOutputDataBuffer()

__JAFFAR_COMMON__INLINE__ uint8_t * jaffarCommon::serializer::Base::getOutputDataBuffer ( ) const
inline

The internally-stored output data buffer size

Returns
A reference to the output data buffer

◆ getOutputSize()

__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::serializer::Base::getOutputSize ( ) const
inline

The internally-stored output data buffer size

Returns
The size of the output data so far (at the end, this represents the output buffer size)

◆ push()

virtual void jaffarCommon::serializer::Base::push ( const void *const __restrict  inputDataBuffer = nullptr,
const size_t  inputDataSize = 0 
)
pure virtual

Serializes the specified number of bytes onto the output data buffer, pushing the information from the input data buffer

Note
The input buffer may be compressed or non-contiguous
Parameters
[out]inputDataBufferThe contiguous output buffer from which data is serialized. Passing nullptr is allowed and can be used to determine the required output buffer size
[in]inputDataSizeThe number of bytes from the input data buffer to serialize

Implemented in jaffarCommon::serializer::Differential, and jaffarCommon::serializer::Contiguous.

◆ pushContiguous()

virtual void jaffarCommon::serializer::Base::pushContiguous ( const void *const __restrict  inputDataBuffer = nullptr,
const size_t  inputDataSize = 0 
)
pure virtual

Serializes the specified number of contiguous bytes onto the output data buffer, pushing the information from the input buffer

Note
This function forces the treatment of the input and output as uncompressed contiguous buffers
Parameters
[out]inputDataBufferThe contiguous output buffer from which data is serialized. Passing nullptr is allowed and can be used to determine the required output buffer size
[in]inputDataSizeThe number of bytes from the input data buffer to serialize

Implemented in jaffarCommon::serializer::Differential, and jaffarCommon::serializer::Contiguous.

Member Data Documentation

◆ _outputDataBuffer

uint8_t* __restrict const jaffarCommon::serializer::Base::_outputDataBuffer
protected

The write-only internally stored output data buffer

◆ _outputDataBufferPos

size_t jaffarCommon::serializer::Base::_outputDataBufferPos = 0
protected

The current header position of the output data buffer (how much was used)

◆ _outputDataBufferSize

const size_t jaffarCommon::serializer::Base::_outputDataBufferSize
protected

The size of the output data buffer


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