aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/serializer/substitution-map.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/serializer/substitution-map.hxx')
-rw-r--r--libxsde/xsde/cxx/serializer/substitution-map.hxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/libxsde/xsde/cxx/serializer/substitution-map.hxx b/libxsde/xsde/cxx/serializer/substitution-map.hxx
index ae16f4c..e36c481 100644
--- a/libxsde/xsde/cxx/serializer/substitution-map.hxx
+++ b/libxsde/xsde/cxx/serializer/substitution-map.hxx
@@ -30,21 +30,34 @@ namespace xsde
const char* member_name,
const char* member_type);
+ typedef bool (*callback_func) (
+ const char* type,
+ const void* obj,
+ const char*& ns,
+ const char*& name);
+
+ void
+ callback (callback_func);
+
// Check whether there is a substitution available for this
// root element with the specified type. If so, return true
// and override namespace and name (ns is 0 if there is no
- // namespace).
+ // namespace). The obj argument is an opaque pointer to the
+ // instance being serialized or 0 if there is none.
//
bool
check (const char*& ns,
const char*& name,
- const char* type) const;
+ const char* type,
+ const void* obj) const;
private:
bool
check_ (const char*& ns,
const char*& name,
- const char* type) const;
+ const char* type,
+ const void* obj,
+ bool top) const;
private:
struct value
@@ -52,6 +65,9 @@ namespace xsde
const char* ns_;
const char* name_;
};
+
+ private:
+ callback_func callback_;
};
@@ -85,4 +101,3 @@ namespace xsde
#include <xsde/cxx/serializer/substitution-map.ixx>
#endif // XSDE_CXX_SERIALIZER_SUBSTITUTION_MAP_HXX
-