Added Alignment, Defaultable and Scriptable types, needed some reflection tweaks for the last two.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@17 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-12 14:07:34 +00:00
parent 156d1f6632
commit b389685fc8
23 changed files with 311 additions and 90 deletions
+14 -1
View File
@@ -12,6 +12,8 @@
#include <util/prec.hpp>
#include <wx/txtstrm.h>
template <typename T> class Defaultable;
// ----------------------------------------------------------------------------- : Reader
typedef wxInputStream InputStream;
@@ -57,6 +59,8 @@ class Reader {
template <typename T> void handle(shared_ptr<T>& pointer);
/// Reads a map from the input stream
//template <typename K, typename V> void handle(map<K,V>& map);
/// Reads a Defaultable from the input stream
template <typename T> void handle(Defaultable<T>& def);
private:
// --------------------------------------------------- : Data
@@ -130,7 +134,16 @@ void Reader::handle(shared_ptr<T>& pointer) {
/// Implement reflection as used by Reader
#define REFLECT_OBJECT_READER(Cls) \
template<> void Reader::handle<Cls>(Cls& object) { \
object.reflect(*this); \
while (indent >= expected_indent) { \
UInt l = line_number; \
object.reflect(*this); \
if (l == line_number) { \
/* error */ \
do { \
moveNext(); \
} while (indent > expected_indent); \
} \
} \
}
// ----------------------------------------------------------------------------- : Reflection for enumerations