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

A tool for serializing classes with specific issues serializing. More...

#include <serialization.h>

Public Member Functions

virtual void ProtoSerialize (const Serializable &Target, XML::Node &CurrentRoot)=0
 Get all the serialized data about one class instance in an XML::Node. More...
 
virtual void ProtoSerializeAll (XML::Node &CurrentRoot) const =0
 Get all of the data from the serializable class instance. More...
 
virtual std::ostream & Serialize (std::ostream &Stream, const Serializable &Target)
 Output the specified member to a stream. More...
 
virtual std::ostream & SerializeAll (std::ostream &Stream) const
 Output the complete serialized data to a stream. More...
 

Detailed Description

template<class Serializable>
class Mezzanine::Serializer< Serializable >

A tool for serializing classes with specific issues serializing.

Some classes have private members and it is impractical to change the class to expose this data. In this case a serializer could be made that to work around this limitation.

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::DeSerializer. The type of this template is expected to match what this is serializing.

Definition at line 290 of file serialization.h.

Member Function Documentation

template<class Serializable >
virtual void Mezzanine::Serializer< Serializable >::ProtoSerialize ( const Serializable &  Target,
XML::Node CurrentRoot 
)
pure virtual

Get all the serialized data about one class instance in an XML::Node.

Parameters
TargetA reference to class instance to be deserialized.

This is not implemented by default.

Parameters
CurrentRootThe point in the XML hierarchy that all this vector3 should be appended to.
template<class Serializable >
virtual void Mezzanine::Serializer< Serializable >::ProtoSerializeAll ( XML::Node CurrentRoot) const
pure virtual

Get all of the data from the serializable class instance.

This is to be implemented in individual serializer with logic specific to the required tasks. It is expected to produce an XML::Node containing the entirety of the data required to reconstitute the serialized class.

This is expected to gets it's knowledge about what to serialize some other than being passed as an argument. It could query a manager or be passed a series pointers that is needs to work with.

This is not implemented by default.

Parameters
CurrentRootThe point in the XML hierarchy that all the items deserialized should be appended to.
template<class Serializable >
virtual std::ostream& Mezzanine::Serializer< Serializable >::Serialize ( std::ostream &  Stream,
const Serializable &  Target 
)
inlinevirtual

Output the specified member to a stream.

Parameters
TargetA reference to class instance to be deserialized.
StreamThe std::ostream to send the data into.

The default implementation of this uses ProtoSerialize(const String&)

Returns
The std::ostream that was passed in.

Definition at line 328 of file serialization.h.

template<class Serializable >
virtual std::ostream& Mezzanine::Serializer< Serializable >::SerializeAll ( std::ostream &  Stream) const
inlinevirtual

Output the complete serialized data to a stream.

Parameters
StreamThe std::ostream to send the data into.

By default this is implemented in using ProtoSerializeAll().

Returns
The populated ostream.

Definition at line 309 of file serialization.h.


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