jaffarCommon
Loading...
Searching...
No Matches
Public Member Functions | List of all members
jaffarCommon::serializer::Differential Class Referencefinal

#include <differential.hpp>

Inheritance diagram for jaffarCommon::serializer::Differential:
Inheritance graph
[legend]
Collaboration diagram for jaffarCommon::serializer::Differential:
Collaboration graph
[legend]

Public Member Functions

 Differential (void *__restrict outputDataBuffer=nullptr, const size_t outputDataBufferSize=std::numeric_limits< uint32_t >::max(), const void *__restrict referenceDataBuffer=nullptr, const size_t referenceDataBufferSize=std::numeric_limits< uint32_t >::max(), const bool useZlib=false)
 
__JAFFAR_COMMON__INLINE__ void pushContiguous (const void *const __restrict inputData=nullptr, const size_t inputDataSize=0) override
 
__JAFFAR_COMMON__INLINE__ void push (const void *const __restrict inputData, const size_t inputDataSize) override
 
size_t getReferenceDataBufferPos () const
 
size_t getDifferentialBytesCount () const
 
- Public Member Functions inherited from jaffarCommon::serializer::Base
 Base (void *__restrict outputDataBuffer, const size_t outputDataBufferSize)
 
__JAFFAR_COMMON__INLINE__ size_t getOutputSize () const
 
__JAFFAR_COMMON__INLINE__ uint8_t * getOutputDataBuffer () const
 

Additional Inherited Members

- Protected Attributes inherited from jaffarCommon::serializer::Base
uint8_t *__restrict const _outputDataBuffer
 
const size_t _outputDataBufferSize
 
size_t _outputDataBufferPos = 0
 

Detailed Description

The differential serialization class enables the compression of a input elements that, when applied to a reference data buffer, produces the a compressed output. Well used, it produces an output that is smaller than the original data. The original data can be recovered later by comparing the output to the reference data.

The compression can be applied to different elements at different times. It also enables the use of contiguous storage for elements that are not meant to be compressed.

Constructor & Destructor Documentation

◆ Differential()

jaffarCommon::serializer::Differential::Differential ( void *__restrict  outputDataBuffer = nullptr,
const size_t  outputDataBufferSize = std::numeric_limits<uint32_t>::max(),
const void *__restrict  referenceDataBuffer = nullptr,
const size_t  referenceDataBufferSize = std::numeric_limits<uint32_t>::max(),
const bool  useZlib = false 
)
inline

Default constructor for the differntial deserializer class

Parameters
[in]outputDataBufferThe output buffer onto which to write the serialized data
[in]outputDataBufferSizeThe size of the output buffer
[in]referenceDataBufferThe buffer from whence to read the reference data
[in]referenceDataBufferSizeThe size of the reference buffer
[in]useZlibSpecifies whether to apply Zlib compression after the differential compression

Member Function Documentation

◆ getDifferentialBytesCount()

size_t jaffarCommon::serializer::Differential::getDifferentialBytesCount ( ) const
inline

Gets the number of differential bytes included in the serialized output

This is useful to make sure the differential part of the serialization is not exceeded

Returns
The number of bytes used in differential compression

◆ getReferenceDataBufferPos()

size_t jaffarCommon::serializer::Differential::getReferenceDataBufferPos ( ) const
inline

Get the position of the reference buffer header.

Returns
The position of the reference buffer header. This value represents the size of the reference data at the end of the deserialization process

◆ push()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::serializer::Differential::push ( const void *const __restrict  inputDataBuffer,
const size_t  inputDataSize 
)
inlineoverridevirtual

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

Implements jaffarCommon::serializer::Base.

◆ pushContiguous()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::serializer::Differential::pushContiguous ( const void *const __restrict  inputDataBuffer = nullptr,
const size_t  inputDataSize = 0 
)
inlineoverridevirtual

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

Implements jaffarCommon::serializer::Base.


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