aboutsummaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-12-02 12:26:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-12-02 12:26:05 +0200
commitee4eb695119bce96515b330f9fc83ddd67da5c62 (patch)
tree817bf37d4b0f0fb89e785004c41b4c6928228f79 /libxsd/xsd/cxx/parser
parentc155e6925211747af9a13a5994c2f768c5048971 (diff)
Implement de-registering polymorphic type information
This is required for DLL/shared library unloading.
Diffstat (limited to 'libxsd/xsd/cxx/parser')
-rw-r--r--libxsd/xsd/cxx/parser/substitution-map.hxx13
-rw-r--r--libxsd/xsd/cxx/parser/substitution-map.txx8
-rw-r--r--libxsd/xsd/cxx/parser/validating/inheritance-map.hxx11
-rw-r--r--libxsd/xsd/cxx/parser/validating/inheritance-map.txx8
4 files changed, 38 insertions, 2 deletions
diff --git a/libxsd/xsd/cxx/parser/substitution-map.hxx b/libxsd/xsd/cxx/parser/substitution-map.hxx
index 60c0ec8..0379164 100644
--- a/libxsd/xsd/cxx/parser/substitution-map.hxx
+++ b/libxsd/xsd/cxx/parser/substitution-map.hxx
@@ -137,6 +137,12 @@ namespace xsd
map_.insert (std::pair<key, value> (k, v));
}
+ void
+ erase (const C* member_ns, const C* member_name)
+ {
+ map_.erase (key (member_ns, member_name));
+ }
+
// Check and get the type set if found.
//
bool
@@ -219,6 +225,12 @@ namespace xsd
const C* root_ns,
const C* root_name,
const C* member_type);
+
+ ~substitution_map_entry ();
+
+ private:
+ const C* member_ns_;
+ const C* member_name_;
};
}
}
@@ -227,4 +239,3 @@ namespace xsd
#include <xsd/cxx/parser/substitution-map.txx>
#endif // XSD_CXX_PARSER_SUBSTITUTION_MAP_HXX
-
diff --git a/libxsd/xsd/cxx/parser/substitution-map.txx b/libxsd/xsd/cxx/parser/substitution-map.txx
index c9d4cb1..63d88b9 100644
--- a/libxsd/xsd/cxx/parser/substitution-map.txx
+++ b/libxsd/xsd/cxx/parser/substitution-map.txx
@@ -67,10 +67,18 @@ namespace xsd
const C* root_ns,
const C* root_name,
const C* member_type)
+ : member_ns_ (member_ns), member_name_ (member_name)
{
substitution_map_instance<C> ().insert (
member_ns, member_name, root_ns, root_name, member_type);
}
+
+ template<typename C>
+ substitution_map_entry<C>::
+ ~substitution_map_entry ()
+ {
+ substitution_map_instance<C> ().erase (member_ns_, member_name_);
+ }
}
}
}
diff --git a/libxsd/xsd/cxx/parser/validating/inheritance-map.hxx b/libxsd/xsd/cxx/parser/validating/inheritance-map.hxx
index ebd1d03..b3fc35a 100644
--- a/libxsd/xsd/cxx/parser/validating/inheritance-map.hxx
+++ b/libxsd/xsd/cxx/parser/validating/inheritance-map.hxx
@@ -39,6 +39,12 @@ namespace xsd
map_[derived] = base;
}
+ void
+ erase (const C* derived)
+ {
+ map_.erase (derived);
+ }
+
bool
check (const C* derived, const ro_string<C>& base) const;
@@ -80,6 +86,10 @@ namespace xsd
struct inheritance_map_entry
{
inheritance_map_entry (const C* derived, const C* base);
+ ~inheritance_map_entry ();
+
+ private:
+ const C* derived_;
};
}
}
@@ -89,4 +99,3 @@ namespace xsd
#include <xsd/cxx/parser/validating/inheritance-map.txx>
#endif // XSD_CXX_PARSER_VALIDATING_INHERITANCE_MAP_HXX
-
diff --git a/libxsd/xsd/cxx/parser/validating/inheritance-map.txx b/libxsd/xsd/cxx/parser/validating/inheritance-map.txx
index 5e70409..7982011 100644
--- a/libxsd/xsd/cxx/parser/validating/inheritance-map.txx
+++ b/libxsd/xsd/cxx/parser/validating/inheritance-map.txx
@@ -56,9 +56,17 @@ namespace xsd
template<typename C>
inheritance_map_entry<C>::
inheritance_map_entry (const C* derived, const C* base)
+ : derived_ (derived)
{
inheritance_map_instance<C> ().insert (derived, base);
}
+
+ template<typename C>
+ inheritance_map_entry<C>::
+ ~inheritance_map_entry ()
+ {
+ inheritance_map_instance<C> ().erase (derived_);
+ }
}
}
}