]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #ifndef BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP |
2 | #define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP | |
3 | ||
4 | // MS compatible compilers support #pragma once | |
5 | #if defined(_MSC_VER) | |
6 | # pragma once | |
7 | #endif | |
8 | ||
9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 | |
10 | // common_iarchive.hpp | |
11 | ||
f67539c2 | 12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
7c673cae FG |
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 | #include <boost/config.hpp> | |
20 | ||
21 | #include <boost/archive/detail/basic_iarchive.hpp> | |
22 | #include <boost/archive/detail/basic_pointer_iserializer.hpp> | |
23 | #include <boost/archive/detail/interface_iarchive.hpp> | |
24 | ||
25 | #ifdef BOOST_MSVC | |
26 | # pragma warning(push) | |
27 | # pragma warning(disable : 4511 4512) | |
28 | #endif | |
29 | ||
30 | namespace boost { | |
31 | namespace archive { | |
32 | namespace detail { | |
33 | ||
34 | class extended_type_info; | |
35 | ||
36 | // note: referred to as Curiously Recurring Template Patter (CRTP) | |
37 | template<class Archive> | |
b32b8144 | 38 | class BOOST_SYMBOL_VISIBLE common_iarchive : |
7c673cae FG |
39 | public basic_iarchive, |
40 | public interface_iarchive<Archive> | |
41 | { | |
42 | friend class interface_iarchive<Archive>; | |
b32b8144 | 43 | friend class basic_iarchive; |
7c673cae | 44 | private: |
20effc67 | 45 | void vload(version_type & t) BOOST_OVERRIDE { |
f67539c2 | 46 | * this->This() >> t; |
7c673cae | 47 | } |
20effc67 | 48 | void vload(object_id_type & t) BOOST_OVERRIDE { |
7c673cae FG |
49 | * this->This() >> t; |
50 | } | |
20effc67 | 51 | void vload(class_id_type & t) BOOST_OVERRIDE { |
7c673cae FG |
52 | * this->This() >> t; |
53 | } | |
20effc67 | 54 | void vload(class_id_optional_type & t) BOOST_OVERRIDE { |
7c673cae FG |
55 | * this->This() >> t; |
56 | } | |
20effc67 | 57 | void vload(tracking_type & t) BOOST_OVERRIDE { |
7c673cae FG |
58 | * this->This() >> t; |
59 | } | |
20effc67 | 60 | void vload(class_name_type &s) BOOST_OVERRIDE { |
7c673cae FG |
61 | * this->This() >> s; |
62 | } | |
63 | protected: | |
64 | // default processing - invoke serialization library | |
65 | template<class T> | |
66 | void load_override(T & t){ | |
67 | archive::load(* this->This(), t); | |
68 | } | |
69 | // default implementations of functions which emit start/end tags for | |
70 | // archive types that require them. | |
71 | void load_start(const char * /*name*/){} | |
72 | void load_end(const char * /*name*/){} | |
73 | // default archive initialization | |
f67539c2 | 74 | common_iarchive(unsigned int flags = 0) : |
7c673cae FG |
75 | basic_iarchive(flags), |
76 | interface_iarchive<Archive>() | |
77 | {} | |
78 | }; | |
79 | ||
80 | } // namespace detail | |
81 | } // namespace archive | |
82 | } // namespace boost | |
83 | ||
84 | #ifdef BOOST_MSVC | |
85 | #pragma warning(pop) | |
86 | #endif | |
87 | ||
88 | #endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP |