dll_base.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  2. // dll_base.cpp
  3. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  4. // Use, modification and distribution is subject to the Boost Software
  5. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // Build a dll which contains the serialization for a class A
  8. // used in testing distribution of serialization code in DLLS
  9. #include <boost/serialization/export.hpp>
  10. #define BASE_EXPORT
  11. #include "base.hpp"
  12. template<class Archive>
  13. void base::serialize(
  14. Archive &ar,
  15. const unsigned int /* file_version */){
  16. }
  17. // for some reason this is required at least by MSVC
  18. // given that its declared virtual .. = 0; This
  19. // seems wrong to me but here it is.
  20. //polymorphic_base::~polymorphic_base(){}
  21. // instantiate code for text archives
  22. #include <boost/archive/text_oarchive.hpp>
  23. #include <boost/archive/text_iarchive.hpp>
  24. // instantiate code for polymorphic archives
  25. #include <boost/archive/polymorphic_oarchive.hpp>
  26. #include <boost/archive/polymorphic_iarchive.hpp>
  27. // note: BOOST_CLASS_EXPORT cannot be used to instantiate
  28. // serialization code for an abstract base class. So use
  29. // explicit instantiation in this case.
  30. //BOOST_CLASS_EXPORT(polymorphic_base)
  31. template BOOST_SYMBOL_EXPORT void base::serialize(
  32. boost::archive::text_oarchive & ar,
  33. const unsigned int version
  34. );
  35. template BOOST_SYMBOL_EXPORT void base::serialize(
  36. boost::archive::text_iarchive & ar,
  37. const unsigned int version
  38. );
  39. template BOOST_SYMBOL_EXPORT void base::serialize(
  40. boost::archive::polymorphic_oarchive & ar,
  41. const unsigned int version
  42. );
  43. template BOOST_SYMBOL_EXPORT void base::serialize(
  44. boost::archive::polymorphic_iarchive & ar,
  45. const unsigned int version
  46. );