Serialization::Archive::Syncer Class Reference

Synchronizes 2 archives with each other. More...

`#include <Serialization.h>`

## Public Member Functions

| Syncer (Archive &dst, Archive &src)
void | syncObject (const Object &dst, const Object &src)
void | syncPrimitive (const Object &dst, const Object &src)
void | syncString (const Object &dst, const Object &src)
void | syncArray (const Object &dst, const Object &src)
void | syncSet (const Object &dst, const Object &src)
void | syncMap (const Object &dst, const Object &src)
void | syncPointer (const Object &dst, const Object &src)
void | syncMember (const Member &dstMember, const Member &srcMember)
template<typename T>
void | translateKey (T *&key)
template<typename T>
void | translateKey (T &key)

## Static Protected Member Functions

static Member | dstMemberMatching (const Object &dstObj, const Object &srcObj, const Member &srcMember)

## Detailed Description

Synchronizes 2 archives with each other.

This class is used internally at final stage of deserialization. It is not used for serialization.

The deserialization algorithm of this framework works like this:

1. The (currently running) application constructs an `Archive` object by passing a previously serialized raw data stream to the `Archive` constructor. At this stage, the raw data stream is decoded and this archive's object pool is populated with objects, which in turn are filled with data (at temporary storage location inside the respective `Object` instances) of the decoded data stream.
2. A temporary (2nd) `Archive` object is constructed internally by this framework, reflecting the (currently running) application's latest data structre layout, without touching any actual data yet. The individual `Object` instances of this 2nd `Archive` are bound to the running application's native (target) C/C++ member variables to be updated (written to) next.

Note that at this point, the 2 archives might very well have quite different data structure layouts, due to potential software changes between the original serializing application and this currently deserializing software application.

1. This Syncer class is used to transfer the actual data from the 1st to the 2nd (temporary) `Archive` object, it does so by traversing the 2 archives' object pools, trying to find the respective 2 objects on the two sides to be synchronized, and if found, it transfers the data from the 1st archive's object to the 2nd archive's object, effectively writing to the currently running application's final C/C++ memory locations.

This 3 staged approach allows to deserialize data in a much more relaxed, adaptive and flexible (while still automatic) way than traditional serialization frameworks would do.

Definition at line 1932 of file Serialization.h.

## Constructor & Destructor Documentation

## Syncer()

Serialization::Archive::Syncer::Syncer | ( | Archive & | dst,
|  | Archive & | src )

Definition at line 2667 of file Serialization.cpp.

## Member Function Documentation

## dstMemberMatching()

Member Serialization::Archive::Syncer::dstMemberMatching | ( | const Object & | dstObj,
|  | const Object & | srcObj,
|  | const Member & | srcMember )

static protected

Definition at line 2805 of file Serialization.cpp.

## syncArray()

void Serialization::Archive::Syncer::syncArray | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2692 of file Serialization.cpp.

## syncMap()

void Serialization::Archive::Syncer::syncMap | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2704 of file Serialization.cpp.

## syncMember()

void Serialization::Archive::Syncer::syncMember | ( | const Member & | dstMember,
|  | const Member & | srcMember )

Definition at line 2827 of file Serialization.cpp.

## syncObject()

void Serialization::Archive::Syncer::syncObject | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2737 of file Serialization.cpp.

## syncPointer()

void Serialization::Archive::Syncer::syncPointer | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2710 of file Serialization.cpp.

## syncPrimitive()

void Serialization::Archive::Syncer::syncPrimitive | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2679 of file Serialization.cpp.

## syncSet()

void Serialization::Archive::Syncer::syncSet | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2698 of file Serialization.cpp.

## syncString()

void Serialization::Archive::Syncer::syncString | ( | const Object & | dst,
|  | const Object & | src )

Definition at line 2685 of file Serialization.cpp.

## translateKey() [1/2]

template<typename T>

void Serialization::Archive::Syncer::translateKey | ( | T & | key | ) |

inline

Definition at line 1978 of file Serialization.h.

## translateKey() [2/2]

template<typename T>

void Serialization::Archive::Syncer::translateKey | ( | T *& | key | ) |

inline

Definition at line 1950 of file Serialization.h.

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

- Serialization.h
- Serialization.cpp