basic_iarchive.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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)
  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/config.hpp>
  16. #include <boost/noncopyable.hpp>
  17. #include <boost/scoped_ptr.hpp>
  18. #include <boost/serialization/tracking_enum.hpp>
  19. #include <boost/archive/basic_archive.hpp>
  20. #include <boost/archive/detail/decl.hpp>
  21. #include <boost/archive/detail/helper_collection.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 basic_iserializer;
  31. class basic_pointer_iserializer;
  32. //////////////////////////////////////////////////////////////////////
  33. // class basic_iarchive - read serialized objects from a input stream
  34. class BOOST_SYMBOL_VISIBLE basic_iarchive :
  35. private boost::noncopyable,
  36. public boost::archive::detail::helper_collection
  37. {
  38. friend class basic_iarchive_impl;
  39. // hide implementation of this class to minimize header conclusion
  40. boost::scoped_ptr<basic_iarchive_impl> pimpl;
  41. virtual void vload(version_type &t) = 0;
  42. virtual void vload(object_id_type &t) = 0;
  43. virtual void vload(class_id_type &t) = 0;
  44. virtual void vload(class_id_optional_type &t) = 0;
  45. virtual void vload(class_name_type &t) = 0;
  46. virtual void vload(tracking_type &t) = 0;
  47. protected:
  48. BOOST_ARCHIVE_DECL basic_iarchive(unsigned int flags);
  49. boost::archive::detail::helper_collection &
  50. get_helper_collection(){
  51. return *this;
  52. }
  53. public:
  54. // some msvc versions require that the following function be public
  55. // otherwise it should really protected.
  56. virtual BOOST_ARCHIVE_DECL ~basic_iarchive();
  57. // note: NOT part of the public API.
  58. BOOST_ARCHIVE_DECL void next_object_pointer(void *t);
  59. BOOST_ARCHIVE_DECL void register_basic_serializer(
  60. const basic_iserializer & bis
  61. );
  62. BOOST_ARCHIVE_DECL void load_object(
  63. void *t,
  64. const basic_iserializer & bis
  65. );
  66. BOOST_ARCHIVE_DECL const basic_pointer_iserializer *
  67. load_pointer(
  68. void * & t,
  69. const basic_pointer_iserializer * bpis_ptr,
  70. const basic_pointer_iserializer * (*finder)(
  71. const boost::serialization::extended_type_info & eti
  72. )
  73. );
  74. // real public API starts here
  75. BOOST_ARCHIVE_DECL void
  76. set_library_version(boost::serialization::library_version_type archive_library_version);
  77. BOOST_ARCHIVE_DECL boost::serialization::library_version_type
  78. get_library_version() const;
  79. BOOST_ARCHIVE_DECL unsigned int
  80. get_flags() const;
  81. BOOST_ARCHIVE_DECL void
  82. reset_object_address(const void * new_address, const void * old_address);
  83. BOOST_ARCHIVE_DECL void
  84. delete_created_pointers();
  85. };
  86. } // namespace detail
  87. } // namespace archive
  88. } // namespace boost
  89. #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
  90. #endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP