1 #ifndef BOOST_SERIALIZATION_TEST_A_HPP
2 #define BOOST_SERIALIZATION_TEST_A_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // A.hpp simple class test
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)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <ostream> // for friend output operators
20 #include <cstddef> // size_t
22 #include <boost/config.hpp>
23 #if defined(BOOST_NO_STDC_NAMESPACE)
29 #include <boost/detail/workaround.hpp>
30 #include <boost/limits.hpp>
31 #include <boost/cstdint.hpp>
33 #include <boost/serialization/access.hpp>
35 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
36 #include <boost/detail/workaround.hpp>
37 #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
38 #include <boost/archive/dinkumware.hpp>
42 #include <boost/serialization/nvp.hpp>
43 #include <boost/serialization/string.hpp>
45 #include <boost/preprocessor/facilities/empty.hpp>
47 #include "test_decl.hpp"
50 #define DLL_DECL IMPORT_DECL
51 #elif defined(A_EXPORT)
52 #define DLL_DECL EXPORT_DECL
57 class DLL_DECL(BOOST_PP_EMPTY()) A
60 friend class boost::serialization::access;
61 // note: from an aesthetic perspective, I would much prefer to have this
62 // defined out of line. Unfortunately, this trips a bug in the VC 6.0
63 // compiler. So hold our nose and put it her to permit running of tests.
64 // mscvc 6.0 requires template functions to be implemented. For this
65 // reason we can't make abstract.
66 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
67 template<class Archive>
70 const unsigned int /* file_version */
72 ar & BOOST_SERIALIZATION_NVP(b);
73 #ifndef BOOST_NO_INT64_T
74 ar & BOOST_SERIALIZATION_NVP(f);
75 ar & BOOST_SERIALIZATION_NVP(g);
77 #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
79 if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
81 ar & BOOST_SERIALIZATION_NVP(i);
84 ar & BOOST_SERIALIZATION_NVP(i);
88 ar & BOOST_SERIALIZATION_NVP(l);
90 ar & BOOST_SERIALIZATION_NVP(m);
91 ar & BOOST_SERIALIZATION_NVP(n);
92 ar & BOOST_SERIALIZATION_NVP(o);
93 ar & BOOST_SERIALIZATION_NVP(p);
94 ar & BOOST_SERIALIZATION_NVP(q);
95 #ifndef BOOST_NO_CWCHAR
96 ar & BOOST_SERIALIZATION_NVP(r);
98 ar & BOOST_SERIALIZATION_NVP(c);
99 ar & BOOST_SERIALIZATION_NVP(s);
100 ar & BOOST_SERIALIZATION_NVP(t);
101 ar & BOOST_SERIALIZATION_NVP(u);
102 ar & BOOST_SERIALIZATION_NVP(v);
103 ar & BOOST_SERIALIZATION_NVP(w);
104 ar & BOOST_SERIALIZATION_NVP(x);
105 ar & BOOST_SERIALIZATION_NVP(y);
106 #ifndef BOOST_NO_STD_WSTRING
107 ar & BOOST_SERIALIZATION_NVP(z);
111 template<class Archive>
114 const unsigned int /* file_version */
118 #ifndef BOOST_NO_INT64_T
132 #ifndef BOOST_NO_CWCHAR
143 #ifndef BOOST_NO_STD_WSTRING
148 bool check_equal(const A &rhs) const;
149 bool operator==(const A &rhs) const;
150 bool operator!=(const A &rhs) const;
151 bool operator<(const A &rhs) const; // used by less
152 // hash function for class A
153 operator std::size_t () const;
154 friend std::ostream & operator<<(std::ostream & os, A const & a);
159 #endif // BOOST_SERIALIZATION_TEST_A_HPP