ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
active::serialise::doc::Handler Class Reference

#include <Handler.h>

Public Types

using Shared = std::shared_ptr<Handler>
 Shared pointer.
 
using Reconstruction = std::function<void*(const Object& object)>
 

Public Member Functions

 Handler ()
 
template<typename T , class Obj >
requires Reconstructable<T> && Typed<Obj>
T * reconstruct (const Obj &incoming) const
 
template<typename T >
requires Transportable<T>
void add (std::initializer_list< active::utility::String > const &tags)
 
template<typename T >
requires Transportable<T>
void add (const active::utility::String &tag)
 

Detailed Description

A class for shipping (sending/receiving) objects in a serialised document

The primary role of this class is to reconstruct class instances from the serialised document objects. An instance of this class should be populated with the identifying tags and reconstruction functions for all required document object types

Constructor & Destructor Documentation

◆ Handler()

active::serialise::doc::Handler::Handler ( )
inline

Default constructor

Member Function Documentation

◆ add() [1/2]

template<typename T >
requires Transportable<T>
void active::serialise::doc::Handler::add ( const active::utility::String & tag)
inline

Add a method of reconstructing an object of a specified type

Parameters
tagA tag that may be used to identify the object type

◆ add() [2/2]

template<typename T >
requires Transportable<T>
void active::serialise::doc::Handler::add ( std::initializer_list< active::utility::String > const & tags)
inline

Add a method of reconstructing objects of a specified type

Parameters
tagsTag(s) that may be used to identify an object of this type

◆ reconstruct()

template<typename T , class Obj >
requires Reconstructable<T> && Typed<Obj>
T * active::serialise::doc::Handler::reconstruct ( const Obj & incoming) const
inline

Reconstruct a class instance from an incoming serialised document object

Parameters
incomingThe incoming serialised document object
Returns
The unwrapped object (nullptr on failure)

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