XII Release 0.1.0
Loading...
Searching...
No Matches
xiiDeduplicationWriteContext Class Reference

Serialization Context that de-duplicates objects when writing to a stream. Duplicated objects are identified by their address and only the first occurrence is written to the stream while all subsequence occurrences are just written as an index. More...

#include <DeduplicationWriteContext.h>

Inheritance diagram for xiiDeduplicationWriteContext:
[legend]

Public Types

enum class  WriteMapMode { DedupKey , DedupValue , DedupBoth }
 

Public Member Functions

template<typename T>
xiiResult WriteObject (xiiStreamWriter &ref_stream, const T &obj)
 Writes a single object to the stream. Can be either a reference or a pointer to the object.
 
template<typename T>
xiiResult WriteObject (xiiStreamWriter &ref_stream, const xiiSharedPtr< T > &pObject)
 Writes a single object to the stream.
 
template<typename T>
xiiResult WriteObject (xiiStreamWriter &ref_stream, const xiiUniquePtr< T > &pObject)
 Writes a single object to the stream.
 
template<typename ArrayType, typename ValueType>
xiiResult WriteArray (xiiStreamWriter &ref_stream, const xiiArrayBase< ValueType, ArrayType > &array)
 Writes an array of de-duplicated objects.
 
template<typename KeyType, typename Comparer>
xiiResult WriteSet (xiiStreamWriter &ref_stream, const xiiSetBase< KeyType, Comparer > &set)
 Writes a set of de-duplicated objects.
 
template<typename KeyType, typename ValueType, typename Comparer>
xiiResult WriteMap (xiiStreamWriter &ref_stream, const xiiMapBase< KeyType, ValueType, Comparer > &map, WriteMapMode mode)
 Writes a map. Mode controls whether key or value or both should de-duplicated.
 
template<typename T>
XII_ALWAYS_INLINE xiiResult WriteObject (xiiStreamWriter &ref_stream, const T &obj)
 
template<typename T>
XII_ALWAYS_INLINE xiiResult WriteObject (xiiStreamWriter &ref_stream, const xiiSharedPtr< T > &pObject)
 
template<typename T>
XII_ALWAYS_INLINE xiiResult WriteObject (xiiStreamWriter &ref_stream, const xiiUniquePtr< T > &pObject)
 
- Public Member Functions inherited from xiiSerializationContext< xiiDeduplicationWriteContext >
void SetActive (bool bActive)
 Set the context as active which means it can be accessed via GetContext in serialization methods.
 

Detailed Description

Serialization Context that de-duplicates objects when writing to a stream. Duplicated objects are identified by their address and only the first occurrence is written to the stream while all subsequence occurrences are just written as an index.


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