Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Unserializer.h
1 /*
2  * $Id$
3  * Copyright (c) 2006, IRIT UPS.
4  *
5  * Unserializer class.
6  */
7 #ifndef ELM_SERIAL2_UNSERIALIZER_H
8 #define ELM_SERIAL2_UNSERIALIZER_H
9 
10 #include <elm/rtti.h>
11 
12 namespace elm { namespace serial2 {
13 
14 // Unserializer class
15 class Unserializer {
16 public:
17  virtual ~Unserializer(void) { }
18  virtual void flush(void) = 0;
19 
20  // Complex type serializers
21  virtual void beginObject(const rtti::Type& clazz, void *object) = 0;
22  virtual void endObject(const rtti::Type& clazz, void *object) = 0;
23  virtual bool beginField(CString name) = 0;
24  virtual void endField(void) = 0;
25  virtual void onPointer(const rtti::Type& clazz, void **object) = 0;
26  virtual bool beginCompound(void*) = 0;
27  virtual bool nextItem(void) = 0;
28  virtual int countItems(void) = 0;
29  virtual void endCompound(void*) = 0;
30  virtual int onEnum(const rtti::Type& clazz) = 0;
31 
32  // Base value serializers
33  virtual void onValue(bool& v) = 0;
34  virtual void onValue(signed int& v) = 0;
35  virtual void onValue(unsigned int& v) = 0;
36  virtual void onValue(char& v) = 0;
37  virtual void onValue(signed char& v) = 0;
38  virtual void onValue(unsigned char& v) = 0;
39  virtual void onValue(signed short& v) = 0;
40  virtual void onValue(unsigned short& v) = 0;
41  virtual void onValue(signed long& v) = 0;
42  virtual void onValue(unsigned long& v) = 0;
43  virtual void onValue(signed long long& v) = 0;
44  virtual void onValue(unsigned long long& v) = 0;
45  virtual void onValue(float& v) = 0;
46  virtual void onValue(double& v) = 0;
47  virtual void onValue(long double& v) = 0;
48  virtual void onValue(CString& v) = 0;
49  virtual void onValue(String& v) = 0;
50 };
51 
52 } } // elm::serial2
53 
54 #endif // ELM_SERIAL2_UNSERIALIZER_H
elm::serial2::Unserializer::beginObject
virtual void beginObject(const rtti::Type &clazz, void *object)=0
elm::serial2::Unserializer::beginField
virtual bool beginField(CString name)=0
elm::serial2::Unserializer::endCompound
virtual void endCompound(void *)=0
elm::serial2::Unserializer::endObject
virtual void endObject(const rtti::Type &clazz, void *object)=0
elm::serial2::Unserializer::onEnum
virtual int onEnum(const rtti::Type &clazz)=0
elm::serial2::Unserializer::nextItem
virtual bool nextItem(void)=0
elm::serial2::Unserializer::onPointer
virtual void onPointer(const rtti::Type &clazz, void **object)=0
elm::CString
Definition: CString.h:17
elm
Definition: adapter.h:26
elm::serial2::Unserializer::onValue
virtual void onValue(bool &v)=0
elm::serial2::Unserializer
Definition: Unserializer.h:15
elm::String
Definition: String.h:30
elm::serial2::Unserializer::~Unserializer
virtual ~Unserializer(void)
Definition: Unserializer.h:17
elm::serial2::Unserializer::endField
virtual void endField(void)=0
elm::serial2::Unserializer::beginCompound
virtual bool beginCompound(void *)=0
elm::serial2::Unserializer::countItems
virtual int countItems(void)=0
elm::rtti::Type
Definition: Type.h:83
elm::serial2::Unserializer::flush
virtual void flush(void)=0