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... | |
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.
|
pure virtual |
|
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.
CurrentRoot | The point in the XML hierarchy that all the items deserialized should be appended to. |
|
inlinevirtual |
Output the specified member to a stream.
Target | A reference to class instance to be deserialized. |
Stream | The std::ostream to send the data into. |
The default implementation of this uses ProtoSerialize(const String&)
Definition at line 328 of file serialization.h.
|
inlinevirtual |
Output the complete serialized data to a stream.
Stream | The std::ostream to send the data into. |
By default this is implemented in using ProtoSerializeAll().
Definition at line 309 of file serialization.h.