basic_serializer_map.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef BOOST_SERIALIZER_MAP_HPP
  2. #define BOOST_SERIALIZER_MAP_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_serializer_map.hpp: extenstion of type_info required for serialization.
  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 <set>
  15. #include <boost/config.hpp>
  16. #include <boost/noncopyable.hpp>
  17. #include <boost/archive/detail/auto_link_archive.hpp>
  18. #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
  19. namespace boost {
  20. namespace serialization {
  21. class extended_type_info;
  22. }
  23. namespace archive {
  24. namespace detail {
  25. class basic_serializer;
  26. class BOOST_SYMBOL_VISIBLE
  27. basic_serializer_map : public
  28. boost::noncopyable
  29. {
  30. struct type_info_pointer_compare
  31. {
  32. bool operator()(
  33. const basic_serializer * lhs, const basic_serializer * rhs
  34. ) const ;
  35. };
  36. typedef std::set<
  37. const basic_serializer *,
  38. type_info_pointer_compare
  39. > map_type;
  40. map_type m_map;
  41. public:
  42. BOOST_ARCHIVE_DECL bool insert(const basic_serializer * bs);
  43. BOOST_ARCHIVE_DECL void erase(const basic_serializer * bs);
  44. BOOST_ARCHIVE_DECL const basic_serializer * find(
  45. const boost::serialization::extended_type_info & type_
  46. ) const;
  47. private:
  48. // cw 8.3 requires this
  49. basic_serializer_map& operator=(basic_serializer_map const&);
  50. };
  51. } // namespace detail
  52. } // namespace archive
  53. } // namespace boost
  54. #include <boost/archive/detail/abi_suffix.hpp> // must be the last header
  55. #endif // BOOST_SERIALIZER_MAP_HPP