]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | #ifndef BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP |
2 | #define BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP | |
7c673cae FG |
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 | // polymorphic_derived2.hpp simple class test | |
11 | ||
f67539c2 | 12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
7c673cae FG |
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 <boost/config.hpp> | |
20 | ||
21 | #include <boost/serialization/access.hpp> | |
22 | #include <boost/serialization/nvp.hpp> | |
23 | #include <boost/serialization/base_object.hpp> | |
24 | #include <boost/serialization/type_info_implementation.hpp> | |
25 | #include <boost/serialization/extended_type_info_typeid.hpp> | |
26 | ||
92f5a8d4 TL |
27 | #if defined(POLYMORPHIC_DERIVED2_IMPORT) |
28 | #define POLYMORPHIC_DERIVED2_DLL_DECL BOOST_SYMBOL_IMPORT | |
29 | #pragma message ("polymorphic_derived2 imported") | |
30 | #elif defined(POLYMORPHIC_DERIVED2_EXPORT) | |
31 | #define POLYMORPHIC_DERIVED2_DLL_DECL BOOST_SYMBOL_EXPORT | |
32 | #pragma message ("polymorphic_derived2 exported") | |
b32b8144 | 33 | #endif |
7c673cae | 34 | |
b32b8144 FG |
35 | #ifndef POLYMORPHIC_DERIVED2_DLL_DECL |
36 | #define POLYMORPHIC_DERIVED2_DLL_DECL | |
7c673cae FG |
37 | #endif |
38 | ||
92f5a8d4 | 39 | #define POLYMORPHIC_BASE_IMPORT |
b32b8144 FG |
40 | #include "polymorphic_base.hpp" |
41 | ||
92f5a8d4 | 42 | class BOOST_SYMBOL_VISIBLE polymorphic_derived2 : |
7c673cae FG |
43 | public polymorphic_base |
44 | { | |
45 | friend class boost::serialization::access; | |
46 | template<class Archive> | |
92f5a8d4 TL |
47 | POLYMORPHIC_DERIVED2_DLL_DECL void serialize( |
48 | Archive &ar, | |
7c673cae | 49 | const unsigned int /* file_version */ |
92f5a8d4 TL |
50 | ); |
51 | POLYMORPHIC_DERIVED2_DLL_DECL const char * get_key() const; | |
b32b8144 | 52 | public: |
92f5a8d4 TL |
53 | POLYMORPHIC_DERIVED2_DLL_DECL polymorphic_derived2(); |
54 | POLYMORPHIC_DERIVED2_DLL_DECL ~polymorphic_derived2(); | |
7c673cae FG |
55 | }; |
56 | ||
57 | // we use this because we want to assign a key to this type | |
58 | // but we don't want to explicitly instantiate code every time | |
59 | // we do so!!!. If we don't do this, we end up with the same | |
60 | // code in BOTH the DLL which implements polymorphic_derived2 | |
61 | // as well as the main program. | |
62 | BOOST_CLASS_EXPORT_KEY(polymorphic_derived2) | |
63 | ||
64 | // note the mixing of type_info systems is supported. | |
65 | BOOST_CLASS_TYPE_INFO( | |
66 | polymorphic_derived2, | |
67 | boost::serialization::extended_type_info_typeid<polymorphic_derived2> | |
68 | ) | |
69 | ||
b32b8144 | 70 | #endif // BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP |
7c673cae | 71 |