Nebula
|
#include <componentserialization.h>
Component serialization functions.
Implements various serialization functions for different types of components
Classes | |
struct | Serializer |
Public Types | |
using | DeserializeJsonFunc = Util::Delegate<void(Ptr<IO::JsonReader> const&, const char* name, void*)> |
using | SerializeJsonFunc = Util::Delegate<void(Ptr<IO::JsonWriter> const&, const char* name, void*)> |
Static Public Member Functions | |
static ComponentSerialization * | Instance () |
The registry's constructor is called by the Instance() method, and nobody else. | |
static void | Destroy () |
This static method is used to destroy the registry object and should be called right before the main function exits. | |
template<typename TYPE > | |
static void | Register (ComponentId component) |
static void | Deserialize (Ptr< IO::JsonReader > const &reader, ComponentId component, void *ptr) |
ptr points to the location where the value should be stored. Make sure you have room for it! | |
static void | Serialize (Ptr< IO::JsonWriter > const &writer, ComponentId component, void *ptr) |
ptr points to the value that should be stored | |
Private Member Functions | |
ComponentSerialization () | |
~ComponentSerialization () | |
bool | ValidateTypeSize (ComponentId component, uint32_t size) |
validate that the size of MemDb::AttributeRegistry's component named 'name' has typesize of 'size' | |
Private Attributes | |
Util::Array< Serializer > | serializers |
Static Private Attributes | |
static ComponentSerialization * | Singleton = nullptr |
using Game::ComponentSerialization::DeserializeJsonFunc = Util::Delegate<void(Ptr<IO::JsonReader> const&, const char* name, void*)> |
using Game::ComponentSerialization::SerializeJsonFunc = Util::Delegate<void(Ptr<IO::JsonWriter> const&, const char* name, void*)> |
|
private |
|
private |
|
static |
ptr points to the location where the value should be stored. Make sure you have room for it!
|
static |
This static method is used to destroy the registry object and should be called right before the main function exits.
It will make sure that no accidential memory leaks are reported by the debug heap.
|
static |
The registry's constructor is called by the Instance() method, and nobody else.
|
inlinestatic |
|
static |
ptr points to the value that should be stored
|
private |
validate that the size of MemDb::AttributeRegistry's component named 'name' has typesize of 'size'
|
private |
|
staticprivate |