Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Static Public Member Functions | List of all members
Serialization Class Reference

#include <Serialization.h>

Public Member Functions

template<>
void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 Template specialization for classes derived from EngineObject. More...
 
template<>
void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 Specjalizacja dla wszystkich obiektów, które nie dziedziczą po EngineObject. More...
 
template<>
void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 Specialization for deserializing generic objects inheriting EngineObject. More...
 
template<>
void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 Specialization for deserializing non generic structures.. More...
 

Static Public Member Functions

static std::vector< rttr::property > & GetTypeFilteredProperties (rttr::type objType, EngineSerializationContext *context)
 Zwraca wektor propertiesów dla danego typu. More...
 
static bool ShouldSave (const rttr::property &prop, MetaDataType saveFlag)
 Sprawdza czy właściwość powinna zostać zapisana. More...
 
static void DefaultSerialize (ISerializer *ser, const EngineObject *object)
 Domyślny tryb serialziacji obiektów. More...
 
static void DefaultDeserialize (IDeserializer *deser, EngineObject *object)
 Domyślny tryb deserialziacji obiektów. More...
 
static void DefaultSerializeImpl (ISerializer *ser, const rttr::instance &object, rttr::type dynamicType)
 
static void DefaultDeserializeImpl (IDeserializer *deser, const rttr::instance &object, rttr::type dynamicType)
 
static bool SerializeBasicTypes (ISerializer *ser, const rttr::instance &object, rttr::property &prop)
 Serializuje podstawowe typy. More...
 
static bool SerializeVectorTypes (ISerializer *ser, const rttr::instance &object, rttr::property &prop)
 Serializuje typy DirectXMath. More...
 
static bool SerializeStringTypes (ISerializer *ser, const rttr::instance &object, rttr::property &prop)
 Serializes string types. More...
 
static bool SerializeEnumTypes (ISerializer *ser, const rttr::instance &object, rttr::property &prop)
 Serializes enum types to string representation. More...
 
static bool SerializeArrayTypes (ISerializer *ser, const rttr::instance &object, rttr::property &prop)
 Serializes static or dynamic array. More...
 
static void SerializePropertiesVec (ISerializer *ser, const rttr::instance &object, std::vector< rttr::property > &properties)
 
static bool DeserializeBasicTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializuje podstawowe typy. More...
 
static bool DeserializeVectorTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializuje typy DirectXMath. More...
 
static bool DeserializeStringTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializuje std::string i std::wstring. More...
 
static bool DeserializeEnumTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializes enum properties from string. More...
 
static bool DeserializeArrayTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializes arrays. More...
 
static bool DeserializeObjectTypes (IDeserializer *deser, const rttr::instance &object, rttr::property &prop)
 Deserializes structures and generic objects. More...
 
static std::string WstringToUTF (const std::wstring &str)
 
static std::wstring UTFToWstring (const std::string &str)
 
template<typename PropertyType >
static PropertyType GetPropertyValue (rttr::property prop, const rttr::instance &object)
 Returns typed property value. More...
 
template<typename PropertyType >
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 Serializuje właściwość podanego typu. More...
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<>
static void SerializeProperty (ISerializer *ser, rttr::property prop, const rttr::instance &object)
 
template<typename PropertyType >
static void SetPropertyValue (rttr::property prop, const rttr::instance &object, PropertyType value)
 Ustawia wartość podanej właściwości. More...
 
template<typename PropertyType >
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 Deserializuje właściwość podanego typu. More...
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 
template<>
static void DeserializeProperty (IDeserializer *deser, rttr::property prop, const rttr::instance &object)
 

Member Function Documentation

void Serialization::DefaultDeserialize ( IDeserializer deser,
EngineObject object 
)
static

Domyślny tryb deserialziacji obiektów.

Deserializowane są wszystkie typy podstawowe.

void Serialization::DefaultDeserializeImpl ( IDeserializer deser,
const rttr::instance &  object,
rttr::type  dynamicType 
)
static
void Serialization::DefaultSerialize ( ISerializer ser,
const EngineObject object 
)
static

Domyślny tryb serialziacji obiektów.

Serializowane są wszystkie właściwości, które nie zostały w metadanych oznaczone jako nieserializowalne.

void Serialization::DefaultSerializeImpl ( ISerializer ser,
const rttr::instance &  object,
rttr::type  dynamicType 
)
static
bool Serialization::DeserializeArrayTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializes arrays.

Returns
Returns true when object have been deserialized. Otherwise you should try with functions deserializing other types.
Todo:
Error handling.
bool Serialization::DeserializeBasicTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializuje podstawowe typy.

Funkcja sprawdza typ własciwości i deserializuje go tylko jeżeli jest jednym z obsługiwanych przez nią typów. W przeciwnym razie nie robi nic.

Returns
Funkcja zwraca true, jeżeli udało jej się obsłużyć podany typ.
bool Serialization::DeserializeEnumTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializes enum properties from string.

Returns
Returns true when object have been deserialized. Otherwise you should try with functions deserializing other types.

Type haven't been registered.

bool Serialization::DeserializeObjectTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializes structures and generic objects.

Returns
Returns true when object have been deserialized. Otherwise you should try with functions deserializing other types.
template<typename PropertyType >
void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static

Deserializuje właściwość podanego typu.

Todo:
Można zoptymalizować pobieranie nazwy z właściwości i ograniczyć alokację stringów.
template<>
static void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
template void Serialization::DeserializeProperty< uint64 > ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)

Specialization for deserializing generic objects inheriting EngineObject.

template<>
void Serialization::DeserializeProperty ( IDeserializer deser,
rttr::property  prop,
const rttr::instance &  object 
)

Specialization for deserializing non generic structures..

bool Serialization::DeserializeStringTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializuje std::string i std::wstring.

Returns
Returns true when object have been deserialized. Otherwise you should try with functions deserializing other types.
bool Serialization::DeserializeVectorTypes ( IDeserializer deser,
const rttr::instance &  object,
rttr::property prop 
)
static

Deserializuje typy DirectXMath.

Returns
Returns true when object have been deserialized. Otherwise you should try with functions deserializing other types.
template<typename PropertyType >
PropertyType Serialization::GetPropertyValue ( rttr::property  prop,
const rttr::instance &  object 
)
static

Returns typed property value.

std::vector< rttr::property > & Serialization::GetTypeFilteredProperties ( rttr::type  objType,
EngineSerializationContext context 
)
static

Zwraca wektor propertiesów dla danego typu.

Propertisy są pobierane z contextu, jeżeli już tam istnieją. Jeżeli nie to są rejestrowane. W ten sposób unikamy filtrowania właściwości przy każdym obiekcie.

bool Serialization::SerializeArrayTypes ( ISerializer ser,
const rttr::instance &  object,
rttr::property prop 
)
static

Serializes static or dynamic array.

Only one dimensional arrays are supported. If this condition is not met, function returns true in Release mode and asserts in Debug mode. In both cases nothing will be serialized.

bool Serialization::SerializeBasicTypes ( ISerializer ser,
const rttr::instance &  object,
rttr::property prop 
)
static

Serializuje podstawowe typy.

Funkcja sprawdza typ własciwości i serializuje go tylko jeżeli jest jednym z obsługiwanych przez nią typów. W przeciwnym razie nie robi nic.

Returns
Funkcja zwraca true, jeżeli udało jej się obsłużyć podany typ.
bool Serialization::SerializeEnumTypes ( ISerializer ser,
const rttr::instance &  object,
rttr::property prop 
)
static

Serializes enum types to string representation.

Type haven't been registered.

void Serialization::SerializePropertiesVec ( ISerializer ser,
const rttr::instance &  object,
std::vector< rttr::property > &  properties 
)
static
template<typename PropertyType >
void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static

Serializuje właściwość podanego typu.

Todo:
Można zoptymalizować pobieranie nazwy z właściwości i ograniczyć alokację stringów.
template<>
static void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
static void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
template void Serialization::SerializeProperty< uint64 > ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)
static
template<>
void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)

Template specialization for classes derived from EngineObject.

Function serializes property name as first. Then EngineObject::Serialize method is invoked.

template<>
void Serialization::SerializeProperty ( ISerializer ser,
rttr::property  prop,
const rttr::instance &  object 
)

Specjalizacja dla wszystkich obiektów, które nie dziedziczą po EngineObject.

Muszą to być struktury bez hierarchii dziedziczenia, ponieważ nie można ustalić ich dynamicznego typu.

bool Serialization::SerializeStringTypes ( ISerializer ser,
const rttr::instance &  object,
rttr::property prop 
)
static

Serializes string types.

bool Serialization::SerializeVectorTypes ( ISerializer ser,
const rttr::instance &  object,
rttr::property prop 
)
static

Serializuje typy DirectXMath.

template<typename PropertyType >
void Serialization::SetPropertyValue ( rttr::property  prop,
const rttr::instance &  object,
PropertyType  value 
)
static

Ustawia wartość podanej właściwości.

bool Serialization::ShouldSave ( const rttr::property prop,
MetaDataType  saveFlag 
)
static

Sprawdza czy właściwość powinna zostać zapisana.

Domyślnie: Jeżeli nie zarejestrowano metadanych, to domyślnie właściwość jest serializowana.

std::wstring Serialization::UTFToWstring ( const std::string &  str)
static
std::string Serialization::WstringToUTF ( const std::wstring &  str)
static

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