basic_iarchive.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
  2. #define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // basic_iarchive.hpp:
  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. // can't use this - much as I'd like to as borland doesn't support it
  15. // #include <boost/scoped_ptr.hpp>
  16. #include <boost/config.hpp>
  17. #include <boost/noncopyable.hpp>
  18. #include <boost/type_traits/broken_compiler_spec.hpp>
  19. #include <boost/serialization/tracking_enum.hpp>
  20. #include <boost/archive/basic_archive.hpp>
  21. #include <boost/archive/detail/decl.hpp>
  22. #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
  23. namespace boost {
  24. namespace serialization {
  25. class extended_type_info;
  26. } // namespace serialization
  27. namespace archive {
  28. namespace detail {
  29. class basic_iarchive_impl;
  30. class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
  31. class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
  32. //////////////////////////////////////////////////////////////////////
  33. // class basic_iarchive - read serialized objects from a input stream
  34. class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
  35. private boost::noncopyable
  36. {
  37. friend class basic_iarchive_impl;
  38. // hide implementation of this class to minimize header conclusion
  39. // in client code. I couldn't used scoped pointer with borland
  40. // boost::scoped_ptr<basic_iarchive_impl> pimpl;
  41. basic_iarchive_impl * pimpl;
  42. virtual void vload(version_type &t) = 0;
  43. virtual void vload(object_id_type &t) = 0;
  44. virtual void vload(class_id_type &t) = 0;
  45. virtual void vload(class_id_optional_type &t) = 0;
  46. virtual void vload(class_name_type &t) = 0;
  47. virtual void vload(tracking_type &t) = 0;
  48. protected:
  49. basic_iarchive(unsigned int flags);
  50. // account for bogus gcc warning
  51. #if defined(__GNUC__)
  52. virtual
  53. #endif
  54. ~basic_iarchive();
  55. public:
  56. // note: NOT part of the public API.
  57. void next_object_pointer(void *t);
  58. void register_basic_serializer(
  59. const basic_iserializer & bis
  60. );
  61. void load_object(
  62. void *t,
  63. const basic_iserializer & bis
  64. );
  65. const basic_pointer_iserializer *
  66. load_pointer(
  67. void * & t,
  68. const basic_pointer_iserializer * bpis_ptr,
  69. const basic_pointer_iserializer * (*finder)(
  70. const boost::serialization::extended_type_info & eti
  71. )
  72. );
  73. // real public API starts here
  74. void
  75. set_library_version(library_version_type archive_library_version);
  76. library_version_type
  77. get_library_version() const;
  78. unsigned int
  79. get_flags() const;
  80. void
  81. reset_object_address(const void * new_address, const void * old_address);
  82. void
  83. delete_created_pointers();
  84. };
  85. } // namespace detail
  86. } // namespace archive
  87. } // namespace boost
  88. // required by smart_cast for compilers not implementing
  89. // partial template specialization
  90. BOOST_TT_BROKEN_COMPILER_SPEC(
  91. boost::archive::detail::basic_iarchive
  92. )
  93. #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
  94. #endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP