diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-18 11:17:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-18 11:17:51 +0200 |
commit | d80d096ee8743fd6f7382d274272b0b6d7faf9bf (patch) | |
tree | d0f0bee1e645cb2b86b6837ac0db8a7d2821e533 /libxsde/xsde/cxx/parser/substitution-map.ixx | |
parent | 0e4637025fa8d1b4234b0512561d31f0dd023843 (diff) |
Support for schema evolution using substitution groups
New examples: hybrid/evolution/ignore and hybrid/evolution/passthrough.
Diffstat (limited to 'libxsde/xsde/cxx/parser/substitution-map.ixx')
-rw-r--r-- | libxsde/xsde/cxx/parser/substitution-map.ixx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/libxsde/xsde/cxx/parser/substitution-map.ixx b/libxsde/xsde/cxx/parser/substitution-map.ixx index ddd0b4d..995da4e 100644 --- a/libxsde/xsde/cxx/parser/substitution-map.ixx +++ b/libxsde/xsde/cxx/parser/substitution-map.ixx @@ -11,7 +11,7 @@ namespace xsde { inline substitution_map:: substitution_map (size_t buckets) - : hashmap (buckets, sizeof (value)) + : hashmap (buckets, sizeof (value)), callback_ (0) { } @@ -26,6 +26,12 @@ namespace xsde hashmap::insert (member, &v); } + inline void substitution_map:: + callback (callback_func c) + { + callback_ = c; + } + inline bool substitution_map:: check (const ro_string& member_ns, const ro_string& member_name, @@ -33,9 +39,9 @@ namespace xsde const char*& type) const { - return empty () - ? false - : check_ (member_ns, member_name, root, &type); + return !empty () || callback_ != 0 + ? check_ (member_ns, member_name, root, &type) + : false; } inline bool substitution_map:: @@ -45,9 +51,9 @@ namespace xsde const char* root_name, const char*& type) const { - return empty () - ? false - : check_ (member_ns, member_name, root_ns, root_name, &type); + return !empty () || callback_ != 0 + ? check_ (member_ns, member_name, root_ns, root_name, &type) + : false; } inline bool substitution_map:: @@ -56,9 +62,9 @@ namespace xsde const char* root) const { - return empty () - ? false - : check_ (member_ns, member_name, root, 0); + return !empty () || callback_ != 0 + ? check_ (member_ns, member_name, root, 0) + : false; } inline substitution_map& |