polymorphic_derived1.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef POLYMORPHIC_DERIVED1_HPP
  2. #define POLYMORPHIC_DERIVED1_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // polymorphic_derived1.hpp simple class test
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <boost/serialization/access.hpp>
  15. #include <boost/serialization/nvp.hpp>
  16. #include <boost/serialization/base_object.hpp>
  17. #include <boost/serialization/type_info_implementation.hpp>
  18. #include <boost/serialization/extended_type_info_no_rtti.hpp>
  19. #include "polymorphic_base.hpp"
  20. class polymorphic_derived1 : public polymorphic_base
  21. {
  22. friend class boost::serialization::access;
  23. template<class Archive>
  24. void serialize(Archive &ar, const unsigned int /* file_version */){
  25. ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base);
  26. }
  27. public:
  28. virtual const char * get_key() const ;
  29. };
  30. BOOST_CLASS_EXPORT_KEY(polymorphic_derived1)
  31. BOOST_CLASS_TYPE_INFO(
  32. polymorphic_derived1,
  33. extended_type_info_no_rtti<polymorphic_derived1>
  34. )
  35. #endif // POLYMORPHIC_DERIVED1_HPP