Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:28

0001 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0002 // archive_serializer_map.ipp:
0003 
0004 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0005 // Distributed under the Boost Software License, Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 //  See http://www.boost.org for updates, documentation, and revision history.
0010 
0011 //////////////////////////////////////////////////////////////////////
0012 // implementation of basic_text_iprimitive overrides for the combination
0013 // of template parameters used to implement a text_iprimitive
0014 
0015 #include <boost/config.hpp>
0016 #include <boost/archive/detail/archive_serializer_map.hpp>
0017 #include <boost/archive/detail/basic_serializer_map.hpp>
0018 #include <boost/serialization/singleton.hpp>
0019 
0020 namespace boost {
0021 namespace archive {
0022 namespace detail {
0023 
0024 #ifdef BOOST_MSVC
0025 #  pragma warning(push)
0026 #  pragma warning(disable : 4511 4512)
0027 #endif
0028 
0029 namespace extra_detail { // anon
0030     template<class Archive>
0031     class map : public basic_serializer_map 
0032     {};
0033 }
0034 
0035 #ifdef BOOST_MSVC
0036 #  pragma warning(pop)
0037 #endif
0038 
0039 template<class Archive>
0040 BOOST_ARCHIVE_OR_WARCHIVE_DECL bool
0041 archive_serializer_map<Archive>::insert(const basic_serializer * bs){
0042     return boost::serialization::singleton<
0043         extra_detail::map<Archive>
0044     >::get_mutable_instance().insert(bs);
0045 }
0046 
0047 template<class Archive>
0048 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0049 archive_serializer_map<Archive>::erase(const basic_serializer * bs){
0050     // note: previously this conditional was a runtime assertion with
0051     // BOOST_ASSERT.  We've changed it because we've discovered that at
0052     // least one platform is not guaranteed to destroy singletons in
0053     // reverse order of distruction.
0054     if(boost::serialization::singleton<
0055         extra_detail::map<Archive>
0056     >::is_destroyed())
0057         return;
0058     boost::serialization::singleton<
0059         extra_detail::map<Archive>
0060     >::get_mutable_instance().erase(bs);
0061 }
0062 
0063 template<class Archive>
0064 BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer *
0065 archive_serializer_map<Archive>::find(
0066     const boost::serialization::extended_type_info & eti
0067 ) {
0068     return boost::serialization::singleton<
0069         extra_detail::map<Archive>
0070     >::get_const_instance().find(eti);
0071 }
0072 
0073 } // namespace detail
0074 } // namespace archive
0075 } // namespace boost