Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/archive/binary_oarchive_impl.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 #ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP | |
2 #define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_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 // binary_oarchive_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 <ostream> | |
20 #include <boost/config.hpp> | |
21 #include <boost/serialization/pfto.hpp> | |
22 #include <boost/archive/basic_binary_oprimitive.hpp> | |
23 #include <boost/archive/basic_binary_oarchive.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 | |
33 template<class Archive, class Elem, class Tr> | |
34 class binary_oarchive_impl : | |
35 public basic_binary_oprimitive<Archive, Elem, Tr>, | |
36 public basic_binary_oarchive<Archive> | |
37 { | |
38 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS | |
39 public: | |
40 #else | |
41 friend class detail::interface_oarchive<Archive>; | |
42 friend class basic_binary_oarchive<Archive>; | |
43 friend class save_access; | |
44 protected: | |
45 #endif | |
46 // note: the following should not needed - but one compiler (vc 7.1) | |
47 // fails to compile one test (test_shared_ptr) without it !!! | |
48 // make this protected so it can be called from a derived archive | |
49 template<class T> | |
50 void save_override(T & t, BOOST_PFTO int){ | |
51 this->basic_binary_oarchive<Archive>::save_override(t, 0L); | |
52 } | |
53 void init(unsigned int flags) { | |
54 if(0 != (flags & no_header)) | |
55 return; | |
56 #if ! defined(__MWERKS__) | |
57 this->basic_binary_oarchive<Archive>::init(); | |
58 this->basic_binary_oprimitive<Archive, Elem, Tr>::init(); | |
59 #else | |
60 basic_binary_oarchive<Archive>::init(); | |
61 basic_binary_oprimitive<Archive, Elem, Tr>::init(); | |
62 #endif | |
63 } | |
64 binary_oarchive_impl( | |
65 std::basic_streambuf<Elem, Tr> & bsb, | |
66 unsigned int flags | |
67 ) : | |
68 basic_binary_oprimitive<Archive, Elem, Tr>( | |
69 bsb, | |
70 0 != (flags & no_codecvt) | |
71 ), | |
72 basic_binary_oarchive<Archive>(flags) | |
73 { | |
74 init(flags); | |
75 } | |
76 binary_oarchive_impl( | |
77 std::basic_ostream<Elem, Tr> & os, | |
78 unsigned int flags | |
79 ) : | |
80 basic_binary_oprimitive<Archive, Elem, Tr>( | |
81 * os.rdbuf(), | |
82 0 != (flags & no_codecvt) | |
83 ), | |
84 basic_binary_oarchive<Archive>(flags) | |
85 { | |
86 init(flags); | |
87 } | |
88 }; | |
89 | |
90 } // namespace archive | |
91 } // namespace boost | |
92 | |
93 #ifdef BOOST_MSVC | |
94 #pragma warning(pop) | |
95 #endif | |
96 | |
97 #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP |