1 #ifndef BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP
2 #define BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // polymorphic_derived2.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 <boost/config.hpp>
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>
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")
35 #ifndef POLYMORPHIC_DERIVED2_DLL_DECL
36 #define POLYMORPHIC_DERIVED2_DLL_DECL
39 #define POLYMORPHIC_BASE_IMPORT
40 #include "polymorphic_base.hpp"
42 class BOOST_SYMBOL_VISIBLE polymorphic_derived2 :
43 public polymorphic_base
45 friend class boost::serialization::access;
46 template<class Archive>
47 POLYMORPHIC_DERIVED2_DLL_DECL void serialize(
49 const unsigned int /* file_version */
51 POLYMORPHIC_DERIVED2_DLL_DECL const char * get_key() const;
53 POLYMORPHIC_DERIVED2_DLL_DECL polymorphic_derived2();
54 POLYMORPHIC_DERIVED2_DLL_DECL ~polymorphic_derived2();
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)
64 // note the mixing of type_info systems is supported.
65 BOOST_CLASS_TYPE_INFO(
67 boost::serialization::extended_type_info_typeid<polymorphic_derived2>
70 #endif // BOOST_SERIALIZATION_TEST_POLYMORPHIC_DERIVED2_HPP