~ubuntu-branches/ubuntu/saucy/deal.ii/saucy

« back to all changes in this revision

Viewing changes to contrib/boost/include/boost/archive/detail/polymorphic_oarchive_route.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV, Adam C. Powell, IV, Denis Barbier
  • Date: 2010-07-29 13:47:01 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100729134701-akb8jb3stwge8tcm
Tags: 6.3.1-1
[ Adam C. Powell, IV ]
* Changed to source format 3.0 (quilt).
* Changed maintainer to debian-science with Adam Powell as uploader.
* Added source lintian overrides about Adam Powell's name.
* Added Vcs info on git repository.
* Bumped Standards-Version.
* Changed stamp-patch to patch target and fixed its application criterion.
* Moved make_dependencies and expand_instantiations to a versioned directory
  to avoid shlib package conflicts.

[ Denis Barbier ]
* New upstream release (closes: #562332).
  + Added libtbb support.
  + Forward-ported all patches.
* Updates for new PETSc version, including workaround for different versions
  of petsc and slepc.
* Add debian/watch.
* Update to debhelper 7.
* Added pdebuild patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_ROUTE_HPP
 
2
#define BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_ROUTE_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
// polymorphic_oarchive_route.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 <string>
 
20
#include <ostream>
 
21
#include <boost/noncopyable.hpp>
 
22
#include <boost/cstdint.hpp>
 
23
#include <cstddef> // size_t
 
24
 
 
25
#include <boost/config.hpp>
 
26
#if defined(BOOST_NO_STDC_NAMESPACE)
 
27
namespace std{
 
28
    using ::size_t;
 
29
} // namespace std
 
30
#endif
 
31
 
 
32
#include <boost/archive/polymorphic_oarchive.hpp>
 
33
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
34
 
 
35
namespace boost {
 
36
namespace serialization {
 
37
    class extended_type_info;
 
38
} // namespace serialization
 
39
namespace archive {
 
40
namespace detail{
 
41
 
 
42
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
 
43
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
 
44
 
 
45
template<class ArchiveImplementation>
 
46
class polymorphic_oarchive_route :
 
47
    public polymorphic_oarchive,
 
48
    // note: gcc dynamic cross cast fails if the the derivation below is
 
49
    // not public.  I think this is a mistake.
 
50
    public /*protected*/ ArchiveImplementation,
 
51
    private boost::noncopyable
 
52
{
 
53
private:
 
54
    // these are used by the serialization library.
 
55
    virtual void save_object(
 
56
        const void *x,
 
57
        const detail::basic_oserializer & bos
 
58
    ){
 
59
        ArchiveImplementation::save_object(x, bos);
 
60
    }
 
61
    virtual void save_pointer(
 
62
        const void * t,
 
63
        const detail::basic_pointer_oserializer * bpos_ptr
 
64
    ){
 
65
        ArchiveImplementation::save_pointer(t, bpos_ptr);
 
66
    }
 
67
    virtual void save_null_pointer(){
 
68
        ArchiveImplementation::save_null_pointer();
 
69
    }
 
70
    // primitive types the only ones permitted by polymorphic archives
 
71
    virtual void save(const bool t){
 
72
        ArchiveImplementation::save(t);
 
73
    }
 
74
    virtual void save(const char t){
 
75
        ArchiveImplementation::save(t);
 
76
    }
 
77
    virtual void save(const signed char t){
 
78
        ArchiveImplementation::save(t);
 
79
    }
 
80
    virtual void save(const unsigned char t){
 
81
        ArchiveImplementation::save(t);
 
82
    }
 
83
    #ifndef BOOST_NO_CWCHAR
 
84
    #ifndef BOOST_NO_INTRINSIC_WCHAR_T
 
85
    virtual void save(const wchar_t t){
 
86
        ArchiveImplementation::save(t);
 
87
    }
 
88
    #endif
 
89
    #endif
 
90
    virtual void save(const short t){
 
91
        ArchiveImplementation::save(t);
 
92
    }
 
93
    virtual void save(const unsigned short t){
 
94
        ArchiveImplementation::save(t);
 
95
    }
 
96
    virtual void save(const int t){
 
97
        ArchiveImplementation::save(t);
 
98
    }
 
99
    virtual void save(const unsigned int t){
 
100
        ArchiveImplementation::save(t);
 
101
    }
 
102
    virtual void save(const long t){
 
103
        ArchiveImplementation::save(t);
 
104
    }
 
105
    virtual void save(const unsigned long t){
 
106
        ArchiveImplementation::save(t);
 
107
    }
 
108
    #if !defined(BOOST_NO_INTRINSIC_INT64_T)
 
109
    virtual void save(const boost::int64_t t){
 
110
        ArchiveImplementation::save(t);
 
111
    }
 
112
    virtual void save(const boost::uint64_t t){
 
113
        ArchiveImplementation::save(t);
 
114
    }
 
115
    #endif
 
116
    virtual void save(const float t){
 
117
        ArchiveImplementation::save(t);
 
118
    }
 
119
    virtual void save(const double t){
 
120
        ArchiveImplementation::save(t);
 
121
    }
 
122
    virtual void save(const std::string & t){
 
123
        ArchiveImplementation::save(t);
 
124
    }
 
125
    #ifndef BOOST_NO_STD_WSTRING
 
126
    virtual void save(const std::wstring & t){
 
127
        ArchiveImplementation::save(t);
 
128
    }
 
129
    #endif
 
130
    virtual unsigned int get_library_version() const{
 
131
        return ArchiveImplementation::get_library_version();
 
132
    }
 
133
    virtual unsigned int get_flags() const {
 
134
        return ArchiveImplementation::get_flags();
 
135
    }
 
136
    virtual void save_binary(const void * t, std::size_t size){
 
137
        ArchiveImplementation::save_binary(t, size);
 
138
    }
 
139
    // used for xml and other tagged formats default does nothing
 
140
    virtual void save_start(const char * name){
 
141
        ArchiveImplementation::save_start(name);
 
142
    }
 
143
    virtual void save_end(const char * name){
 
144
        ArchiveImplementation::save_end(name);
 
145
    }
 
146
    virtual void end_preamble(){
 
147
        ArchiveImplementation::end_preamble();
 
148
    }
 
149
    virtual void register_basic_serializer(const detail::basic_oserializer & bos){
 
150
        ArchiveImplementation::register_basic_serializer(bos);
 
151
    }
 
152
public:
 
153
    // this can't be inheriteded because they appear in mulitple
 
154
    // parents
 
155
    typedef mpl::bool_<false> is_loading;
 
156
    typedef mpl::bool_<true> is_saving;
 
157
    // the << operator
 
158
    template<class T>
 
159
    polymorphic_oarchive & operator<<(T & t){
 
160
        return polymorphic_oarchive::operator<<(t);
 
161
    }
 
162
    // the & operator
 
163
    template<class T>
 
164
    polymorphic_oarchive & operator&(T & t){
 
165
        return polymorphic_oarchive::operator&(t);
 
166
    }
 
167
    // all current archives take a stream as constructor argument
 
168
    template <class _Elem, class _Tr>
 
169
    polymorphic_oarchive_route(
 
170
        std::basic_ostream<_Elem, _Tr> & os,
 
171
        unsigned int flags = 0
 
172
    ) :
 
173
        ArchiveImplementation(os, flags)
 
174
    {}
 
175
    virtual ~polymorphic_oarchive_route(){};
 
176
};
 
177
 
 
178
} // namespace detail
 
179
} // namespace archive
 
180
} // namespace boost
 
181
 
 
182
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
 
183
 
 
184
#endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_DISPATCH_HPP