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-insertion-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-insertion-map.txx')
-rw-r--r-- | libxsd/xsd/cxx/tree/stream-insertion-map.txx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/tree/stream-insertion-map.txx b/libxsd/xsd/cxx/tree/stream-insertion-map.txx index c3cf9b5..f9d5745 100644 --- a/libxsd/xsd/cxx/tree/stream-insertion-map.txx +++ b/libxsd/xsd/cxx/tree/stream-insertion-map.txx @@ -256,6 +256,13 @@ namespace xsd template <typename S, typename C> void stream_insertion_map<S, C>:: + unregister_type (const type_id& tid) + { + type_map_.erase (&tid); + } + + template <typename S, typename C> + void stream_insertion_map<S, C>:: insert (ostream<S>& s, const type& x) { if (const type_info* ti = find (typeid (x))) @@ -320,6 +327,14 @@ namespace xsd xml::qualified_name<C> (name, ns), &inserter_impl<S, T>); } + + template<unsigned long id, typename S, typename C, typename T> + stream_insertion_initializer<id, S, C, T>:: + ~stream_insertion_initializer (const C* name, const C* ns) + { + stream_insertion_map_instance<id, S, C> ().unregister_type ( + typeid (T)); + } } } } |