comparison DEPENDENCIES/generic/include/boost/archive/detail/basic_oarchive.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_BASIC_OARCHIVE_HPP
2 #define BOOST_ARCHIVE_BASIC_OARCHIVE_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 // basic_oarchive.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 <cstddef> // NULL
20 #include <boost/config.hpp>
21 #include <boost/noncopyable.hpp>
22
23 #include <boost/type_traits/broken_compiler_spec.hpp>
24
25 // can't use this - much as I'd like to as borland doesn't support it
26 // #include <boost/scoped_ptr.hpp>
27
28 #include <boost/archive/basic_archive.hpp>
29 #include <boost/serialization/tracking_enum.hpp>
30
31 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
32
33 namespace boost {
34 namespace serialization {
35 class extended_type_info;
36 } // namespace serialization
37
38 namespace archive {
39 namespace detail {
40
41 class basic_oarchive_impl;
42 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
43 class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
44 //////////////////////////////////////////////////////////////////////
45 // class basic_oarchive - write serialized objects to an output stream
46 class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
47 private boost::noncopyable
48 {
49 friend class basic_oarchive_impl;
50 // hide implementation of this class to minimize header conclusion
51 // in client code. note: borland can't use scoped_ptr
52 //boost::scoped_ptr<basic_oarchive_impl> pimpl;
53 basic_oarchive_impl * pimpl;
54
55 // overload these to bracket object attributes. Used to implement
56 // xml archives
57 virtual void vsave(const version_type t) = 0;
58 virtual void vsave(const object_id_type t) = 0;
59 virtual void vsave(const object_reference_type t) = 0;
60 virtual void vsave(const class_id_type t) = 0;
61 virtual void vsave(const class_id_optional_type t) = 0;
62 virtual void vsave(const class_id_reference_type t) = 0;
63 virtual void vsave(const class_name_type & t) = 0;
64 virtual void vsave(const tracking_type t) = 0;
65 protected:
66 basic_oarchive(unsigned int flags = 0);
67 // account for bogus gcc warning
68 #if defined(__GNUC__)
69 virtual
70 #endif
71 ~basic_oarchive();
72 public:
73 // note: NOT part of the public interface
74 void register_basic_serializer(
75 const basic_oserializer & bos
76 );
77 void save_object(
78 const void *x,
79 const basic_oserializer & bos
80 );
81 void save_pointer(
82 const void * t,
83 const basic_pointer_oserializer * bpos_ptr
84 );
85 void save_null_pointer(){
86 vsave(NULL_POINTER_TAG);
87 }
88 // real public interface starts here
89 void end_preamble(); // default implementation does nothing
90 library_version_type get_library_version() const;
91 unsigned int get_flags() const;
92 };
93
94 } // namespace detail
95 } // namespace archive
96 } // namespace boost
97
98 // required by smart_cast for compilers not implementing
99 // partial template specialization
100 BOOST_TT_BROKEN_COMPILER_SPEC(
101 boost::archive::detail::basic_oarchive
102 )
103
104 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
105
106 #endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP