|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_SERIAL2_TYPE_H
22 #define ELM_SERIAL2_TYPE_H
26 #include <elm/type_info.h>
27 #include <elm/serial2/Serializer.h>
28 #include <elm/serial2/Unserializer.h>
31 namespace elm {
namespace serial2 {
38 inline Base(
const T *
p):
ptr(const_cast<T *>(
p)) { }
49 virtual bool isSerial(
void)
const {
return true; }
50 virtual const Serializable&
asSerial(
void)
const {
return *
this; }
55 template <
class T,
class B =
void>
62 void free(
void *obj)
const override {
delete static_cast<T *
>(obj); }
105 decltype(meta::declval<T>().__serial_complete());
179 >::unserialize(s, v);
219 string ref(
void *
object);
224 s.
onEnum(&v, v, type_of<T>());
229 v = (T)s.
onEnum(type_of<T>());
294 #endif // ELM_SERIAL2_TYPE_H
virtual bool isSerial(void) const
Definition: serial.h:49
virtual void beginObject(const rtti::Type &clazz, void *object)=0
static void serialize(Serializer &s, const T &v)
Definition: serial.h:223
void __unserialize(Unserializer &s, const ArrayField< T > &field)
Definition: ArrayField.h:62
string name(void) const
Definition: Type.h:91
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
meta::enable_if< meta::is_supported< T, supports_complete >::_ >::_ do_complete(T &v)
Definition: serial.h:107
decltype(meta::declval< T >().__serial_complete()) supports_complete
Definition: serial.h:105
virtual void onValue(const bool &v)=0
Iter values(void) const
Definition: Enum.h:62
virtual bool beginField(CString name)=0
virtual void serialize(serial2::Serializer &ser, const void *data) const
Definition: serial.h:83
static void serialize(Serializer &s, const T &v)
Definition: serial.h:112
string ref(void *object)
Definition: serial2_serial.cpp:493
Enum(const make &make)
Definition: serial.h:78
virtual void endObject(const rtti::Type &clazz, void *object)=0
virtual void beginObject(const rtti::Type &clazz, const void *object)=0
IntFormat base(int base, IntFormat fmt)
Definition: Output.h:256
static void unserialize(Unserializer &s, T &v)
Definition: serial.h:129
virtual void endObject(const rtti::Type &clazz, const void *object)=0
virtual int onEnum(const rtti::Type &clazz)=0
void __serialize(Serializer &s, const ArrayField< T > &field)
Definition: ArrayField.h:50
virtual const AbstractClass & asClass(void) const
Definition: rtti.cpp:927
V & value(void) const
Definition: rtti.h:39
virtual void onEnum(const void *address, int value, const rtti::Type &clazz)=0
virtual void endField(void)=0
Unserializer & operator>>(Unserializer &serializer, T &data)
Definition: serial.h:197
void __serialize_body(Serializer &s, const T *v)
Definition: serial.h:91
static void unserialize(Unserializer &s, T &v)
Definition: serial.h:228
static void unserialize(Unserializer &s, T &v)
Definition: serial.h:117
virtual void onPointer(const rtti::Type &clazz, void **object)=0
Serializer & operator<<(Serializer &serializer, const T &data)
Definition: serial.h:160
virtual ~ExternalSolver(void)
Definition: serial2_serial.cpp:474
virtual void unserialize(serial2::Unserializer &uns, void *data) const
Definition: serial.h:84
AutoStringStartup & _
Definition: debug_CrashHandler.cpp:232
Base(T *p)
Definition: serial.h:37
Base(const T *p)
Definition: serial.h:38
Definition: Serializer.h:36
void * instantiate() const override
Definition: serial.h:61
virtual void onValue(bool &v)=0
void __unserialize_body(Unserializer &s, T *v)
Definition: serial.h:98
virtual const rtti::Type & type(void) const
Definition: serial.h:51
static void serialize(Serializer &s, const T &v)
Definition: serial.h:128
Serializer & operator&(Serializer &s, const ArrayField< T > &field)
Definition: ArrayField.h:74
Field< T > field(CString name, T &value)
Definition: rtti.h:42
void free(void *obj) const override
Definition: serial.h:62
virtual void onPointer(const rtti::Type &clazz, const void *object)=0
const AbstractClass & base(void) const
Definition: Class.h:297
Definition: Unserializer.h:15
CString name(void) const
Definition: rtti.h:38
void * solve(string ref)
Definition: serial2_serial.cpp:482
Class(CString name, const rtti::AbstractClass &base=type_of< B >().asClass())
Definition: serial.h:58
void serialize(elm::serial2::Serializer &ser, const void *data) const override
Definition: serial.h:65
virtual void * instantiate(void) const
Definition: serial.h:82
AbstractClass(CString name, const rtti::AbstractClass &base)
Definition: serial.h:46
virtual const Serializable & asSerial(void) const
Definition: serial.h:50
virtual void endField(void)=0
void unserialize(Unserializer &uns, void *data) const override
Definition: serial.h:69
Enum(cstring name, const Value values[])
Definition: serial.h:79
T * ptr
Definition: serial.h:39
virtual void beginField(CString name)=0