Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / archive / detail / interface_oarchive.hpp @ 2486

History | View | Annotate | Download (2.4 kB)

1 2486 sjacqu01
#ifndef BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP
2 2486 sjacqu01
#define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP
3 2486 sjacqu01
4 2486 sjacqu01
// MS compatible compilers support #pragma once
5 2486 sjacqu01
#if defined(_MSC_VER)
6 2486 sjacqu01
# pragma once
7 2486 sjacqu01
#endif
8 2486 sjacqu01
9 2486 sjacqu01
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 2486 sjacqu01
// interface_oarchive.hpp
11 2486 sjacqu01
12 2486 sjacqu01
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 2486 sjacqu01
// Use, modification and distribution is subject to the Boost Software
14 2486 sjacqu01
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 2486 sjacqu01
// http://www.boost.org/LICENSE_1_0.txt)
16 2486 sjacqu01
17 2486 sjacqu01
//  See http://www.boost.org for updates, documentation, and revision history.
18 2486 sjacqu01
#include <cstddef> // NULL
19 2486 sjacqu01
#include <boost/cstdint.hpp>
20 2486 sjacqu01
#include <boost/mpl/bool.hpp>
21 2486 sjacqu01
22 2486 sjacqu01
#include <boost/archive/detail/auto_link_archive.hpp>
23 2486 sjacqu01
#include <boost/archive/detail/oserializer.hpp>
24 2486 sjacqu01
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
25 2486 sjacqu01
26 2486 sjacqu01
#include <boost/serialization/singleton.hpp>
27 2486 sjacqu01
28 2486 sjacqu01
namespace boost {
29 2486 sjacqu01
namespace archive {
30 2486 sjacqu01
namespace detail {
31 2486 sjacqu01
32 2486 sjacqu01
class basic_pointer_oserializer;
33 2486 sjacqu01
34 2486 sjacqu01
template<class Archive>
35 2486 sjacqu01
class interface_oarchive
36 2486 sjacqu01
{
37 2486 sjacqu01
protected:
38 2486 sjacqu01
    interface_oarchive(){};
39 2486 sjacqu01
public:
40 2486 sjacqu01
    /////////////////////////////////////////////////////////
41 2486 sjacqu01
    // archive public interface
42 2486 sjacqu01
    typedef mpl::bool_<false> is_loading;
43 2486 sjacqu01
    typedef mpl::bool_<true> is_saving;
44 2486 sjacqu01
45 2486 sjacqu01
    // return a pointer to the most derived class
46 2486 sjacqu01
    Archive * This(){
47 2486 sjacqu01
        return static_cast<Archive *>(this);
48 2486 sjacqu01
    }
49 2486 sjacqu01
50 2486 sjacqu01
    template<class T>
51 2486 sjacqu01
    const basic_pointer_oserializer *
52 2486 sjacqu01
    register_type(const T * = NULL){
53 2486 sjacqu01
        const basic_pointer_oserializer & bpos =
54 2486 sjacqu01
            boost::serialization::singleton<
55 2486 sjacqu01
                pointer_oserializer<Archive, T>
56 2486 sjacqu01
            >::get_const_instance();
57 2486 sjacqu01
        this->This()->register_basic_serializer(bpos.get_basic_serializer());
58 2486 sjacqu01
        return & bpos;
59 2486 sjacqu01
    }
60 2486 sjacqu01
61 2486 sjacqu01
    template<class Helper>
62 2486 sjacqu01
    Helper &
63 2486 sjacqu01
    get_helper(void * const id = 0){
64 2486 sjacqu01
        helper_collection & hc = this->This()->get_helper_collection();
65 2486 sjacqu01
        return hc.template find_helper<Helper>(id);
66 2486 sjacqu01
    }
67 2486 sjacqu01
68 2486 sjacqu01
    template<class T>
69 2486 sjacqu01
    Archive & operator<<(const T & t){
70 2486 sjacqu01
        this->This()->save_override(t);
71 2486 sjacqu01
        return * this->This();
72 2486 sjacqu01
    }
73 2486 sjacqu01
74 2486 sjacqu01
    // the & operator
75 2486 sjacqu01
    template<class T>
76 2486 sjacqu01
    Archive & operator&(const T & t){
77 2486 sjacqu01
        return * this ->This() << t;
78 2486 sjacqu01
    }
79 2486 sjacqu01
};
80 2486 sjacqu01
81 2486 sjacqu01
} // namespace detail
82 2486 sjacqu01
} // namespace archive
83 2486 sjacqu01
} // namespace boost
84 2486 sjacqu01
85 2486 sjacqu01
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
86 2486 sjacqu01
87 2486 sjacqu01
#endif // BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP