diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-02 12:26:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-02 12:26:05 +0200 |
commit | ee4eb695119bce96515b330f9fc83ddd67da5c62 (patch) | |
tree | 817bf37d4b0f0fb89e785004c41b4c6928228f79 /libxsd/xsd/cxx/tree/stream-extraction-map.txx | |
parent | c155e6925211747af9a13a5994c2f768c5048971 (diff) |
Implement de-registering polymorphic type information
This is required for DLL/shared library unloading.
Diffstat (limited to 'libxsd/xsd/cxx/tree/stream-extraction-map.txx')
-rw-r--r-- | libxsd/xsd/cxx/tree/stream-extraction-map.txx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/tree/stream-extraction-map.txx b/libxsd/xsd/cxx/tree/stream-extraction-map.txx index 5534da6..ca0a44e 100644 --- a/libxsd/xsd/cxx/tree/stream-extraction-map.txx +++ b/libxsd/xsd/cxx/tree/stream-extraction-map.txx @@ -226,6 +226,13 @@ namespace xsd } template <typename S, typename C> + void stream_extraction_map<S, C>:: + unregister_type (const qualified_name& name) + { + type_map_.erase (name); + } + + template <typename S, typename C> std::auto_ptr<type> stream_extraction_map<S, C>:: extract (istream<S>& s, flags f, container* c) { @@ -285,10 +292,19 @@ namespace xsd template<unsigned long id, typename S, typename C, typename T> stream_extraction_initializer<id, S, C, T>:: stream_extraction_initializer (const C* name, const C* ns) + : name_ (name), ns_ (ns) { stream_extraction_map_instance<id, S, C> ().register_type ( xml::qualified_name<C> (name, ns), &extractor_impl<S, T>); } + + template<unsigned long id, typename S, typename C, typename T> + stream_extraction_initializer<id, S, C, T>:: + ~stream_extraction_initializer () + { + stream_extraction_map_instance<id, S, C> ().unregister_type ( + xml::qualified_name<C> (name_, ns_)); + } } } } |