[857] | 1 | #ifndef BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
---|
| 2 | #define BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
---|
| 3 |
|
---|
| 4 | // MS compatible compilers support #pragma once
|
---|
| 5 | #if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
---|
| 6 | # pragma once
|
---|
| 7 | #endif
|
---|
| 8 |
|
---|
| 9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
---|
| 10 | // basic_archive_impl.hpp:
|
---|
| 11 |
|
---|
| 12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
---|
| 13 | // Use, modification and distribution is subject to the Boost Software
|
---|
| 14 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
| 15 | // http://www.boost.org/LICENSE_1_0.txt)
|
---|
| 16 |
|
---|
| 17 | // See http://www.boost.org for updates, documentation, and revision history.
|
---|
| 18 |
|
---|
| 19 | // can't use this - much as I'd like to as borland doesn't support it
|
---|
| 20 | // #include <boost/scoped_ptr.hpp>
|
---|
| 21 |
|
---|
| 22 | #include <set>
|
---|
| 23 | #include <boost/shared_ptr.hpp>
|
---|
| 24 |
|
---|
| 25 | #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
---|
| 26 |
|
---|
| 27 | namespace boost {
|
---|
| 28 | namespace serialization {
|
---|
| 29 | class extended_type_info;
|
---|
| 30 | } // namespace serialization
|
---|
| 31 |
|
---|
| 32 | namespace archive {
|
---|
| 33 | namespace detail {
|
---|
| 34 |
|
---|
| 35 | //////////////////////////////////////////////////////////////////////
|
---|
| 36 | // class basic_iarchive - read serialized objects from a input stream
|
---|
| 37 | class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl
|
---|
| 38 | {
|
---|
| 39 | //////////////////////////////////////////////////////////////////////
|
---|
| 40 | // list of serialization helpers
|
---|
| 41 | // at least one compiler sunpro 5.3 erroneously doesn't give access to embedded structs
|
---|
| 42 | struct helper_compare;
|
---|
| 43 | friend struct helper_compare;
|
---|
| 44 |
|
---|
| 45 | struct helper_type {
|
---|
| 46 | shared_ptr<void> m_helper;
|
---|
| 47 | const boost::serialization::extended_type_info * m_eti;
|
---|
| 48 | helper_type(
|
---|
| 49 | shared_ptr<void> h,
|
---|
| 50 | const boost::serialization::extended_type_info * const eti
|
---|
| 51 | ) :
|
---|
| 52 | m_helper(h),
|
---|
| 53 | m_eti(eti)
|
---|
| 54 | {}
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | struct helper_compare {
|
---|
| 58 | bool operator()(
|
---|
| 59 | const helper_type & lhs,
|
---|
| 60 | const helper_type & rhs
|
---|
| 61 | ) const {
|
---|
| 62 | return lhs.m_eti < rhs.m_eti;
|
---|
| 63 | }
|
---|
| 64 | };
|
---|
| 65 |
|
---|
| 66 | typedef std::set<helper_type, helper_compare> collection;
|
---|
| 67 | typedef collection::iterator helper_iterator;
|
---|
| 68 | typedef collection::const_iterator helper_const_iterator;
|
---|
| 69 | collection m_helpers;
|
---|
| 70 | protected:
|
---|
| 71 | void
|
---|
| 72 | lookup_helper(
|
---|
| 73 | const boost::serialization::extended_type_info * const eti,
|
---|
| 74 | shared_ptr<void> & sph
|
---|
| 75 | );
|
---|
| 76 | void
|
---|
| 77 | insert_helper(
|
---|
| 78 | const boost::serialization::extended_type_info * const eti,
|
---|
| 79 | shared_ptr<void> & sph
|
---|
| 80 | );
|
---|
| 81 | };
|
---|
| 82 |
|
---|
| 83 | } // namespace detail
|
---|
| 84 | } // namespace serialization
|
---|
| 85 | } // namespace boost
|
---|
| 86 |
|
---|
| 87 | #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
---|
| 88 |
|
---|
| 89 | #endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
---|
| 90 |
|
---|
| 91 |
|
---|
| 92 |
|
---|