Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/archive/detail/basic_archive_impl.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 2.6 KB
Line 
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
27namespace boost {
28namespace serialization {
29    class extended_type_info;
30} // namespace serialization
31
32namespace archive {
33namespace detail {
34
35//////////////////////////////////////////////////////////////////////
36class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl
37{
38    //////////////////////////////////////////////////////////////////////
39    // list of serialization helpers
40    // at least one compiler sunpro 5.3 erroneously doesn't give access to embedded structs
41    struct helper_compare;
42    friend struct helper_compare;
43
44    struct helper_type {
45        shared_ptr<void> m_helper;
46        const boost::serialization::extended_type_info * m_eti;
47        helper_type(
48            shared_ptr<void> h, 
49            const boost::serialization::extended_type_info * const eti
50        ) :
51            m_helper(h),
52            m_eti(eti)
53        {}
54    };
55
56    struct helper_compare {
57        bool operator()(
58            const helper_type & lhs, 
59            const helper_type & rhs
60        ) const {
61            return lhs.m_eti < rhs.m_eti;
62        }
63    };
64
65    typedef std::set<helper_type, helper_compare> collection;
66    typedef collection::iterator helper_iterator;
67    typedef collection::const_iterator helper_const_iterator;
68    collection m_helpers;
69protected:
70    void
71    lookup_helper(
72        const boost::serialization::extended_type_info * const eti,
73        shared_ptr<void> & sph
74    );
75    void
76    insert_helper(
77        const boost::serialization::extended_type_info * const eti,
78        shared_ptr<void> & sph
79    );
80};
81
82} // namespace detail
83} // namespace serialization
84} // namespace boost
85
86#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
87
88#endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
89
90
91
Note: See TracBrowser for help on using the repository browser.