binary_oarchive.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
  2. #define BOOST_ARCHIVE_BINARY_OARCHIVE_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. // binary_oarchive.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. #include <ostream>
  15. #include <boost/config.hpp>
  16. #include <boost/archive/binary_oarchive_impl.hpp>
  17. #include <boost/archive/detail/register_archive.hpp>
  18. #ifdef BOOST_MSVC
  19. # pragma warning(push)
  20. # pragma warning(disable : 4511 4512)
  21. #endif
  22. namespace boost {
  23. namespace archive {
  24. // do not derive from this class. If you want to extend this functionality
  25. // via inhertance, derived from binary_oarchive_impl instead. This will
  26. // preserve correct static polymorphism.
  27. class BOOST_SYMBOL_VISIBLE binary_oarchive :
  28. public binary_oarchive_impl<
  29. binary_oarchive, std::ostream::char_type, std::ostream::traits_type
  30. >
  31. {
  32. public:
  33. binary_oarchive(std::ostream & os, unsigned int flags = 0) :
  34. binary_oarchive_impl<
  35. binary_oarchive, std::ostream::char_type, std::ostream::traits_type
  36. >(os, flags)
  37. {}
  38. binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
  39. binary_oarchive_impl<
  40. binary_oarchive, std::ostream::char_type, std::ostream::traits_type
  41. >(bsb, flags)
  42. {}
  43. };
  44. } // namespace archive
  45. } // namespace boost
  46. // required by export
  47. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive)
  48. BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive)
  49. #ifdef BOOST_MSVC
  50. #pragma warning(pop)
  51. #endif
  52. #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP