Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
Mezzanine::DeSerializer< DeSerializable > Class Template Referenceabstract

A tool for deserializing classes with specific issues deserializing them. More...

#include <serialization.h>

Public Member Functions

virtual String ContainerName () const =0
 This will return the Name of the element that Contains multiple of the items to be DeSerialized. More...
 
virtual std::istream & DeSerialize (std::istream &Stream)
 Get the serialized version of all the live data from the stream. More...
 
virtual std::istream & DeSerializeAll (std::istream &Stream)
 Get One node that has several of the appropriate kinds of nodes as children and deserialize all of them. More...
 
virtual DeSerializable * ProtoDeSerialize (const XML::Node &OneNode)=0
 Convert An XML Node into a complete live data structure. More...
 
virtual void ProtoDeSerializeAll (const XML::Node &OneNode)
 Convert An XML Node into a complete series of live class instances. More...
 

Detailed Description

template<class DeSerializable>
class Mezzanine::DeSerializer< DeSerializable >

A tool for deserializing classes with specific issues deserializing them.

Some classes Must have certain values available at the time of construction. This make deserializing them by overwriting an existing class instance impractical.

This is expected to work with classes that have implemented the required DeSerializable functions. Specifically This makes use of "static String GetSerializableName()", and it is expected that functions that must be implemented would call on "void ProtoDeSerialize(const XML::Node&)". The type of this template is expected to match what this is deserializing.

This was designed with the idea that a manager could inherit from this or have a separate class that implements this as a member. There should also be no reason why something could not inherit from this and Mezzanine::Serializer.

Definition at line 351 of file serialization.h.

Member Function Documentation

template<class DeSerializable>
virtual String Mezzanine::DeSerializer< DeSerializable >::ContainerName ( ) const
pure virtual

This will return the Name of the element that Contains multiple of the items to be DeSerialized.

Returns
A String that correctly indicates the name of an xml tag.

Implemented in Mezzanine::Physics::CollisionShapeDeSerializer.

template<class DeSerializable>
virtual std::istream& Mezzanine::DeSerializer< DeSerializable >::DeSerialize ( std::istream &  Stream)
inlinevirtual

Get the serialized version of all the live data from the stream.

Parameters
StreamThe std::istream to get the data from.

The default implementation of this uses ProtoDeSerializeAll(XML::Node*) to accept The complete XML to serialise and assemble it in memory.

Returns
This returns the input stream after the xml document has been extracted from it.

Reimplemented in Mezzanine::Physics::CollisionShapeDeSerializer.

Definition at line 392 of file serialization.h.

template<class DeSerializable>
virtual std::istream& Mezzanine::DeSerializer< DeSerializable >::DeSerializeAll ( std::istream &  Stream)
inlinevirtual

Get One node that has several of the appropriate kinds of nodes as children and deserialize all of them.

Parameters
StreamThe std::istream to get the data from.

The default implementation of this uses ProtoDeSerializeAll(XML::Node&) to accept11 The complete XML to serialise and assemble it in memory.

Returns
This returns the input stream after the xml document has been extracted from it.

Definition at line 374 of file serialization.h.

template<class DeSerializable>
virtual DeSerializable* Mezzanine::DeSerializer< DeSerializable >::ProtoDeSerialize ( const XML::Node OneNode)
pure virtual

Convert An XML Node into a complete live data structure.

Parameters
OneNodeA reference to the XML node to reconstitute into a live class instance.

Not implemented in default serializer.

Returns
A pointer to the freshly deserialized class instance.

Implemented in Mezzanine::Physics::CollisionShapeDeSerializer.

template<class DeSerializable>
virtual void Mezzanine::DeSerializer< DeSerializable >::ProtoDeSerializeAll ( const XML::Node OneNode)
inlinevirtual

Convert An XML Node into a complete series of live class instances.

Parameters
OneNodeA reference to the XML node to reconstitute into multiple Live classes.

This is expected to put the deserialized items somewhere they can be accessed by the calling, but provides no facility for working them itself.

Not implemented in default DeSerializer.

Definition at line 359 of file serialization.h.


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