binary_oarchive.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. init(flags);
  39. }
  40. binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
  41. binary_oarchive_impl<
  42. binary_oarchive, std::ostream::char_type, std::ostream::traits_type
  43. >(bsb, flags)
  44. {
  45. init(flags);
  46. }
  47. };
  48. } // namespace archive
  49. } // namespace boost
  50. // required by export
  51. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive)
  52. BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive)
  53. #ifdef BOOST_MSVC
  54. #pragma warning(pop)
  55. #endif
  56. #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP