HoverRace  2.0
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
HoverRace::Util::ObjectFromFactory Class Referenceabstract

Base class for object created with a Dll Factory. More...

#include <DllObjectFactory.h>

+ Inheritance diagram for HoverRace::Util::ObjectFromFactory:

Public Member Functions

 ObjectFromFactory (const ObjectFromFactoryId &pId) noexcept
 
virtual ~ObjectFromFactory ()
 
const ObjectFromFactoryIdGetTypeId () const noexcept
 
virtual void Serialize (Parcel::ObjStream &archive)=0
 

Static Public Member Functions

template<class T >
static void SerializeShared (Parcel::ObjStream &archive, typename std::enable_if< std::is_base_of< ObjectFromFactory, T >::value, std::shared_ptr< T >>::type &obj)
 Serialize a shared pointer to a serializable object. More...
 

Static Private Member Functions

static void ThrowUnexpected (const ObjectFromFactoryId &oid)
 

Private Attributes

ObjectFromFactoryId mId
 

Detailed Description

Base class for object created with a Dll Factory.

Constructor & Destructor Documentation

HoverRace::Util::ObjectFromFactory::ObjectFromFactory ( const ObjectFromFactoryId pId)
inlinenoexcept
virtual HoverRace::Util::ObjectFromFactory::~ObjectFromFactory ( )
inlinevirtual

Member Function Documentation

const ObjectFromFactoryId& HoverRace::Util::ObjectFromFactory::GetTypeId ( ) const
inlinenoexcept
virtual void HoverRace::Util::ObjectFromFactory::Serialize ( Parcel::ObjStream archive)
pure virtual
template<class T >
static void HoverRace::Util::ObjectFromFactory::SerializeShared ( Parcel::ObjStream archive,
typename std::enable_if< std::is_base_of< ObjectFromFactory, T >::value, std::shared_ptr< T >>::type &  obj 
)
inlinestatic

Serialize a shared pointer to a serializable object.

When reading, the created object is checked against the expected type. If the created object is not the correct type, then the object pointer is set to nullptr.

Template Parameters
TThe expected shared pointer type.
Parameters
archiveThe archive.
[in,out]objThe object.
Exceptions
Parcel::ObjStreamExnThe object being read from the stream is not the expected type.
void HoverRace::Util::ObjectFromFactory::ThrowUnexpected ( const ObjectFromFactoryId oid)
staticprivate

Member Data Documentation

ObjectFromFactoryId HoverRace::Util::ObjectFromFactory::mId
private

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