Statistics
| Revision:

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

History | View | Annotate | Download (2.9 kB)

1
#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
2
#define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_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
// binary_iarchive_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
#include <istream>
20
#include <boost/archive/basic_binary_iprimitive.hpp>
21
#include <boost/archive/basic_binary_iarchive.hpp>
22

    
23
#ifdef BOOST_MSVC
24
#  pragma warning(push)
25
#  pragma warning(disable : 4511 4512)
26
#endif
27

    
28
namespace boost { 
29
namespace archive {
30

    
31
namespace detail {
32
    template<class Archive> class interface_iarchive;
33
} // namespace detail
34

    
35
template<class Archive, class Elem, class Tr>
36
class binary_iarchive_impl : 
37
    public basic_binary_iprimitive<Archive, Elem, Tr>,
38
    public basic_binary_iarchive<Archive>
39
{
40
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
41
public:
42
#else
43
protected:
44
    #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
45
        // for some inexplicable reason insertion of "class" generates compile erro
46
        // on msvc 7.1
47
        friend detail::interface_iarchive<Archive>;
48
        friend basic_binary_iarchive<Archive>;
49
        friend load_access;
50
    #else
51
        friend class detail::interface_iarchive<Archive>;
52
        friend class basic_binary_iarchive<Archive>;
53
        friend class load_access;
54
    #endif
55
#endif
56
    template<class T>
57
    void load_override(T & t){
58
        this->basic_binary_iarchive<Archive>::load_override(t);
59
    }
60
    void init(unsigned int flags){
61
        if(0 != (flags & no_header))
62
            return;
63
        #if ! defined(__MWERKS__)
64
            this->basic_binary_iarchive<Archive>::init();
65
            this->basic_binary_iprimitive<Archive, Elem, Tr>::init();
66
        #else
67
            basic_binary_iarchive<Archive>::init();
68
            basic_binary_iprimitive<Archive, Elem, Tr>::init();
69
        #endif
70
    }
71
    binary_iarchive_impl(
72
        std::basic_streambuf<Elem, Tr> & bsb, 
73
        unsigned int flags
74
    ) :
75
        basic_binary_iprimitive<Archive, Elem, Tr>(
76
            bsb, 
77
            0 != (flags & no_codecvt)
78
        ),
79
        basic_binary_iarchive<Archive>(flags)
80
    {
81
        init(flags);
82
    }
83
    binary_iarchive_impl(
84
        std::basic_istream<Elem, Tr> & is, 
85
        unsigned int flags
86
    ) :
87
        basic_binary_iprimitive<Archive, Elem, Tr>(
88
            * is.rdbuf(), 
89
            0 != (flags & no_codecvt)
90
        ),
91
        basic_binary_iarchive<Archive>(flags)
92
    {
93
        init(flags);
94
    }
95
};
96

    
97
} // namespace archive
98
} // namespace boost
99

    
100
#ifdef BOOST_MSVC
101
#pragma warning(pop)
102
#endif
103

    
104
#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP