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) && (_MSC_VER >= 1020)
|
---|
6 | # pragma once
|
---|
7 | #endif
|
---|
8 |
|
---|
9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
---|
10 | // common_iarchive.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 | #include <boost/archive/detail/basic_iarchive.hpp>
|
---|
20 | #include <boost/archive/detail/interface_iarchive.hpp>
|
---|
21 |
|
---|
22 | namespace boost {
|
---|
23 | namespace archive {
|
---|
24 | namespace detail {
|
---|
25 |
|
---|
26 | // note: referred to as Curiously Recurring Template Patter (CRTP)
|
---|
27 | template<class Archive>
|
---|
28 | class common_iarchive :
|
---|
29 | public basic_iarchive,
|
---|
30 | public interface_iarchive<Archive>
|
---|
31 | {
|
---|
32 | private:
|
---|
33 | virtual void vload(version_type & t){
|
---|
34 | * this->This() >> t;
|
---|
35 | }
|
---|
36 | virtual void vload(object_id_type & t){
|
---|
37 | * this->This() >> t;
|
---|
38 | }
|
---|
39 | virtual void vload(class_id_type & t){
|
---|
40 | * this->This() >> t;
|
---|
41 | }
|
---|
42 | virtual void vload(class_id_optional_type & t){
|
---|
43 | * this->This() >> t;
|
---|
44 | }
|
---|
45 | virtual void vload(tracking_type & t){
|
---|
46 | * this->This() >> t;
|
---|
47 | }
|
---|
48 | virtual void vload(class_name_type &s){
|
---|
49 | * this->This() >> s;
|
---|
50 | }
|
---|
51 | protected:
|
---|
52 | // default implementations of functions which emit start/end tags for
|
---|
53 | // archive types that require them.
|
---|
54 | void load_start(const char *name){}
|
---|
55 | void load_end(const char *name){}
|
---|
56 | // default archive initialization
|
---|
57 | common_iarchive(unsigned int flags) :
|
---|
58 | basic_iarchive(flags),
|
---|
59 | interface_iarchive<Archive>()
|
---|
60 | {}
|
---|
61 | };
|
---|
62 |
|
---|
63 | } // namespace detail
|
---|
64 | } // namespace archive
|
---|
65 | } // namespace boost
|
---|
66 |
|
---|
67 | #endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
|
---|
68 |
|
---|