added FieldP to values and styles, implemented reflection for IndexMap

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@36 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-19 18:44:27 +00:00
parent 46a6ed39dc
commit ff96f1522a
30 changed files with 290 additions and 122 deletions
+13 -2
View File
@@ -65,7 +65,9 @@ class Reader {
/// Reads a shared_ptr from the input stream
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);
template <typename K, typename V> void handle(map<K,V>& m);
/// Reads an IndexMap from the input stream, reads only keys that already exist in the map
template <typename K, typename V> void handle(IndexMap<K,V>& m);
/// Reads a Defaultable from the input stream
template <typename T> void handle(Defaultable<T>&);
/// Reads a Scriptable from the input stream
@@ -150,10 +152,19 @@ void Reader::handle(shared_ptr<T>& pointer) {
}
template <typename K, typename V>
void Reader::handle(map<K,V>& map) {
void Reader::handle(map<K,V>& m) {
// TODO
}
template <typename K, typename V>
void Reader::handle(IndexMap<K,V>& m) {
while (indent >= expected_indent) {
for (typename IndexMap<K,V>::iterator it = m.begin() ; it != m.end() ; ++it) {
handle(get_key_name(*it).c_str(), *it);
}
}
}
// ----------------------------------------------------------------------------- : Reflection
/// Implement reflection as used by Reader