![]() |
XII Release 0.1.0
|
#include <TypeVersionContext.h>
Public Member Functions | |
| xiiStreamWriter & | Begin (xiiStreamWriter &ref_originalStream) |
| xiiResult | End () |
| Ends the type version collection and writes the data to the original stream. | |
| void | AddType (const xiiRTTI *pRtti) |
| Adds the given type and its parent types to the version table. | |
| void | WriteTypeVersions (xiiStreamWriter &ref_stream) const |
| xiiStreamWriter & | GetOriginalStream () |
| Returns the original stream that was passed to Begin(). | |
| Public Member Functions inherited from xiiSerializationContext< xiiTypeVersionWriteContext > | |
| void | SetActive (bool bActive) |
Protected Attributes | |
| xiiStreamWriter * | m_pOriginalStream = nullptr |
| xiiDefaultMemoryStreamStorage | m_TempStreamStorage |
| xiiMemoryStreamWriter | m_TempStreamWriter |
| xiiHashSet< const xiiRTTI * > | m_KnownTypes |
This class allows for writing type versions to a stream in a centralized place so that each object doesn't need to write its own version manually.
To use, create an object of this type on the stack, call Begin() and use the returned xiiStreamWriter for subsequent serialization operations. Call AddType to add a type and its parent types to the version table. Call End() once you want to finish writing the type versions.
| xiiStreamWriter & xiiTypeVersionWriteContext::Begin | ( | xiiStreamWriter & | ref_originalStream | ) |
Call this method to begin collecting type version info. You need to use the returned stream writer for subsequent serialization operations until End() is called.
| void xiiTypeVersionWriteContext::WriteTypeVersions | ( | xiiStreamWriter & | ref_stream | ) | const |
Manually write the version table to the given stream. Can be used instead of Begin()/End() if all necessary types are available in one place anyways.