1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // archive_serializer_map.ipp:
4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org for updates, documentation, and revision history.
11 //////////////////////////////////////////////////////////////////////
12 // implementation of basic_text_iprimitive overrides for the combination
13 // of template parameters used to implement a text_iprimitive
15 #include <boost/config.hpp>
16 #include <boost/archive/detail/archive_serializer_map.hpp>
17 #include <boost/archive/detail/basic_serializer_map.hpp>
18 #include <boost/serialization/singleton.hpp>
25 # pragma warning(push)
26 # pragma warning(disable : 4511 4512)
29 namespace extra_detail { // anon
30 template<class Archive>
31 class map : public basic_serializer_map
39 template<class Archive>
40 BOOST_ARCHIVE_OR_WARCHIVE_DECL bool
41 archive_serializer_map<Archive>::insert(const basic_serializer * bs){
42 return boost::serialization::singleton<
43 extra_detail::map<Archive>
44 >::get_mutable_instance().insert(bs);
47 template<class Archive>
48 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
49 archive_serializer_map<Archive>::erase(const basic_serializer * bs){
50 // note: previously this conditional was a runtime assertion with
51 // BOOST_ASSERT. We've changed it because we've discovered that at
52 // least one platform is not guaranteed to destroy singletons in
53 // reverse order of distruction.
54 if(boost::serialization::singleton<
55 extra_detail::map<Archive>
58 boost::serialization::singleton<
59 extra_detail::map<Archive>
60 >::get_mutable_instance().erase(bs);
63 template<class Archive>
64 BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer *
65 archive_serializer_map<Archive>::find(
66 const boost::serialization::extended_type_info & eti
68 return boost::serialization::singleton<
69 extra_detail::map<Archive>
70 >::get_const_instance().find(eti);
74 } // namespace archive