]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
2 | // archive_serializer_map.ipp: | |
3 | ||
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) | |
8 | ||
9 | // See http://www.boost.org for updates, documentation, and revision history. | |
10 | ||
11 | ////////////////////////////////////////////////////////////////////// | |
12 | // implementation of basic_text_iprimitive overrides for the combination | |
13 | // of template parameters used to implement a text_iprimitive | |
14 | ||
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> | |
19 | ||
20 | namespace boost { | |
21 | namespace archive { | |
22 | namespace detail { | |
23 | ||
24 | #ifdef BOOST_MSVC | |
25 | # pragma warning(push) | |
26 | # pragma warning(disable : 4511 4512) | |
27 | #endif | |
28 | ||
29 | namespace extra_detail { // anon | |
30 | template<class Archive> | |
31 | class map : public basic_serializer_map | |
32 | {}; | |
33 | } | |
34 | ||
35 | #ifdef BOOST_MSVC | |
36 | # pragma warning(pop) | |
37 | #endif | |
38 | ||
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); | |
45 | } | |
46 | ||
47 | template<class Archive> | |
48 | BOOST_ARCHIVE_OR_WARCHIVE_DECL void | |
49 | archive_serializer_map<Archive>::erase(const basic_serializer * bs){ | |
50 | if(boost::serialization::singleton< | |
51 | extra_detail::map<Archive> | |
52 | >::is_destroyed()) | |
53 | return; | |
54 | boost::serialization::singleton< | |
55 | extra_detail::map<Archive> | |
56 | >::get_mutable_instance().erase(bs); | |
57 | } | |
58 | ||
59 | template<class Archive> | |
60 | BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer * | |
61 | archive_serializer_map<Archive>::find( | |
62 | const boost::serialization::extended_type_info & eti | |
63 | ) { | |
64 | return boost::serialization::singleton< | |
65 | extra_detail::map<Archive> | |
66 | >::get_const_instance().find(eti); | |
67 | } | |
68 | ||
69 | } // namespace detail | |
70 | } // namespace archive | |
71 | } // namespace boost |