Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:30

0001 #ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
0002 #define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // binary_oarchive_impl.hpp
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 #include <ostream>
0020 #include <boost/config.hpp>
0021 #include <boost/archive/basic_binary_oprimitive.hpp>
0022 #include <boost/archive/basic_binary_oarchive.hpp>
0023 
0024 #ifdef BOOST_MSVC
0025 #  pragma warning(push)
0026 #  pragma warning(disable : 4511 4512)
0027 #endif
0028 
0029 namespace boost {
0030 namespace archive {
0031 
0032 namespace detail {
0033     template<class Archive> class interface_oarchive;
0034 } // namespace detail
0035 
0036 template<class Archive, class Elem, class Tr>
0037 class BOOST_SYMBOL_VISIBLE binary_oarchive_impl :
0038     public basic_binary_oprimitive<Archive, Elem, Tr>,
0039     public basic_binary_oarchive<Archive>
0040 {
0041 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0042 public:
0043 #else
0044 protected:
0045     #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
0046         // for some inexplicable reason insertion of "class" generates compile erro
0047         // on msvc 7.1
0048         friend detail::interface_oarchive<Archive>;
0049         friend basic_binary_oarchive<Archive>;
0050         friend save_access;
0051     #else
0052         friend class detail::interface_oarchive<Archive>;
0053         friend class basic_binary_oarchive<Archive>;
0054         friend class save_access;
0055     #endif
0056 #endif
0057     template<class T>
0058     void save_override(T & t){
0059         this->basic_binary_oarchive<Archive>::save_override(t);
0060     }
0061     void init(unsigned int flags) {
0062         if(0 != (flags & no_header)){
0063             return;
0064         }
0065         #if ! defined(__MWERKS__)
0066             this->basic_binary_oarchive<Archive>::init();
0067             this->basic_binary_oprimitive<Archive, Elem, Tr>::init();
0068         #else
0069             basic_binary_oarchive<Archive>::init();
0070             basic_binary_oprimitive<Archive, Elem, Tr>::init();
0071         #endif
0072     }
0073     binary_oarchive_impl(
0074         std::basic_streambuf<Elem, Tr> & bsb,
0075         unsigned int flags
0076     ) :
0077         basic_binary_oprimitive<Archive, Elem, Tr>(
0078             bsb,
0079             0 != (flags & no_codecvt)
0080         ),
0081         basic_binary_oarchive<Archive>(flags)
0082     {}
0083     binary_oarchive_impl(
0084         std::basic_ostream<Elem, Tr> & os,
0085         unsigned int flags
0086     ) :
0087         basic_binary_oprimitive<Archive, Elem, Tr>(
0088             * os.rdbuf(),
0089             0 != (flags & no_codecvt)
0090         ),
0091         basic_binary_oarchive<Archive>(flags)
0092     {}
0093 };
0094 
0095 } // namespace archive
0096 } // namespace boost
0097 
0098 #ifdef BOOST_MSVC
0099 #pragma warning(pop)
0100 #endif
0101 
0102 #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP