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

Serialization Context that reads de-duplicated objects from a stream and restores the pointers. More...

#include <DeduplicationReadContext.h>

Inheritance diagram for xiiDeduplicationReadContext:
[legend]

Public Types

enum class  ReadMapMode { DedupKey , DedupValue , DedupBoth }

Public Member Functions

template<typename T>
xiiResult ReadObjectInplace (xiiStreamReader &ref_stream, T &ref_obj)
 Reads a single object inplace.
template<typename T>
xiiResult ReadObject (xiiStreamReader &ref_stream, T *&ref_pObject, xiiAllocator *pAllocator=xiiFoundation::GetDefaultAllocator())
 Reads a single object and sets the pointer to it. The given allocator is used to create the object if it doesn't exist yet.
template<typename T>
xiiResult ReadObject (xiiStreamReader &ref_stream, xiiSharedPtr< T > &ref_pObject, xiiAllocator *pAllocator=xiiFoundation::GetDefaultAllocator())
template<typename T>
xiiResult ReadObject (xiiStreamReader &ref_stream, xiiUniquePtr< T > &ref_pObject, xiiAllocator *pAllocator=xiiFoundation::GetDefaultAllocator())
template<typename ArrayType, typename ValueType>
xiiResult ReadArray (xiiStreamReader &ref_stream, xiiArrayBase< ValueType, ArrayType > &ref_array, xiiAllocator *pAllocator=xiiFoundation::GetDefaultAllocator())
 Reads an array of de-duplicated objects.
template<typename KeyType, typename Comparer>
xiiResult ReadSet (xiiStreamReader &ref_stream, xiiSetBase< KeyType, Comparer > &ref_set, xiiAllocator *pAllocator=xiiFoundation::GetDefaultAllocator())
 Reads a set of de-duplicated objects.
template<typename KeyType, typename ValueType, typename Comparer>
xiiResult ReadMap (xiiStreamReader &ref_stream, xiiMapBase< KeyType, ValueType, Comparer > &ref_map, ReadMapMode mode, xiiAllocator *pKeyAllocator=xiiFoundation::GetDefaultAllocator(), xiiAllocator *pValueAllocator=xiiFoundation::GetDefaultAllocator())
 Reads a map. Mode controls whether key or value or both should de-duplicated.
template<typename T>
XII_ALWAYS_INLINE xiiResult ReadObjectInplace (xiiStreamReader &ref_stream, T &ref_obj)
 Copyright (c) Theophilus Eriata. All Rights Reserved.
Public Member Functions inherited from xiiSerializationContext< xiiDeduplicationReadContext >
void SetActive (bool bActive)

Detailed Description

Serialization Context that reads de-duplicated objects from a stream and restores the pointers.

Member Function Documentation

◆ ReadObject() [1/2]

template<typename T>
xiiResult xiiDeduplicationReadContext::ReadObject ( xiiStreamReader & ref_stream,
xiiSharedPtr< T > & ref_pObject,
xiiAllocator * pAllocator = xiiFoundation::GetDefaultAllocator() )

Reads a single object and sets the shared pointer to it. The given allocator is used to create the object if it doesn't exist yet.

◆ ReadObject() [2/2]

template<typename T>
xiiResult xiiDeduplicationReadContext::ReadObject ( xiiStreamReader & ref_stream,
xiiUniquePtr< T > & ref_pObject,
xiiAllocator * pAllocator = xiiFoundation::GetDefaultAllocator() )

Reads a single object and sets the unique pointer to it. The given allocator is used to create the object if it doesn't exist yet.


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