first attempt to document and explain serialization tools for application developers
This commit is contained in:
parent
cd7e47ccbb
commit
743d8abeaf
@ -13,7 +13,21 @@
|
|||||||
#include <framework/serialize/SerializeIF.h>
|
#include <framework/serialize/SerializeIF.h>
|
||||||
//This is where we need the SerializeAdapter!
|
//This is where we need the SerializeAdapter!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* An alternative to the AutoSerializeAdapter functions to implement the conversion
|
||||||
|
* of object data to data streams or vice-versa, using linked lists.
|
||||||
|
*
|
||||||
|
* All object members with a datatype are declared as SerializeElement<element_type> inside the class.
|
||||||
|
*
|
||||||
|
* Buffers with a size header inside that class can be declared with
|
||||||
|
* SerialFixedArrayListAdapter<uint8_t,MAX_BUFFER_LENGTH,typeOfMaxData>.
|
||||||
|
* typeOfMaxData specifies the data type of the buffer header containing the buffer size that follows
|
||||||
|
* and MAX_BUFFER_LENGTH specifies the maximum allowed value for the buffer size.
|
||||||
|
* The sequence of objects is defined in the constructor by using the setStart and setNext functions.
|
||||||
|
*
|
||||||
|
* The serialization and deserialization process is done by instantiating the class and
|
||||||
|
* calling the serialize or deserialize function.
|
||||||
|
*
|
||||||
* \ingroup serialize
|
* \ingroup serialize
|
||||||
*/
|
*/
|
||||||
template<typename T, typename count_t = uint8_t>
|
template<typename T, typename count_t = uint8_t>
|
||||||
|
@ -7,7 +7,19 @@
|
|||||||
#include <framework/serialize/SerializeIF.h>
|
#include <framework/serialize/SerializeIF.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This adapter provides an interface to use the SerializeIF functions
|
||||||
|
* with arbitrary template objects to facilitate and simplify the serialization of classes
|
||||||
|
* with different multiple different data types into buffers vice-versa.
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
|
* A report class is converted into a TM buffer. The report class implements a serialize functions and calls
|
||||||
|
* the AutoSerializeAdapter::serialize function repeatedly on all object data fields.
|
||||||
|
* The getSerializedSize function is implemented by calling the
|
||||||
|
* AutoSerializeAdapter::getSerializedSize function repeatedly on all data fields.
|
||||||
|
*
|
||||||
|
* The AutoSerializeAdapter functions can also be used as an alternative to memcpy
|
||||||
|
* to retrieve data out of a buffer directly into a class variable with data type T while being able to specify endianness.
|
||||||
* \ingroup serialize
|
* \ingroup serialize
|
||||||
*/
|
*/
|
||||||
template<typename T, int>
|
template<typename T, int>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translation of objects into data streams.
|
* An interface for alle classes which require translation of objects data into data streams and vice-versa.
|
||||||
* \ingroup serialize
|
* \ingroup serialize
|
||||||
*/
|
*/
|
||||||
class SerializeIF {
|
class SerializeIF {
|
||||||
|
Loading…
Reference in New Issue
Block a user