ezEngine  Milestone 7
ezArchiveSerializer Class Reference

Base class for custom helpers to store and restore reflected objects to and from an archive. More...

#include <Archive.h>

Public Member Functions

virtual void Serialize (ezArchiveWriter &stream, const ezRTTI *pRtti, const void *pReference)
 Called by ezArchiveWriter when a (derived) type is serialized for which this serializer is registered.
 
virtual void * Deserialize (ezArchiveReader &stream, const ezRTTI *pRtti)
 Called by ezArchiveReader when a (derived) type is deserialized for which this serializer is registered. More...
 

Detailed Description

Base class for custom helpers to store and restore reflected objects to and from an archive.

ezArchiveSerializer is used to store custom data to an archive before an instance of some type is serialized, so that upon deserialization it can read that custom data first and then decide how to allocate the instance.

Note that a serializer can also simply be used to change how an instance is allocated, it does not necessarily need to store data in the stream.

Member Function Documentation

virtual void* ezArchiveSerializer::Deserialize ( ezArchiveReader stream,
const ezRTTI pRtti 
)
inlinevirtual

Called by ezArchiveReader when a (derived) type is deserialized for which this serializer is registered.

Either this function must read exactly the data that was written to the stream AND successfully create the instance, or it mustn't read a single byte and then return nullptr. In the latter case the object will be skipped by the archive reader. Once it starts reading a byte, skipping of the object becomes impossible, so it must be fully and successfully created.


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