Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_ARCHIVE_BASIC_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_BASIC_OARCHIVE_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 // basic_oarchive.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 <cstddef> // NULL
0020 #include <boost/config.hpp>
0021 #include <boost/noncopyable.hpp>
0022 #include <boost/scoped_ptr.hpp>
0023 
0024 #include <boost/archive/basic_archive.hpp>
0025 #include <boost/serialization/tracking_enum.hpp>
0026 #include <boost/archive/detail/helper_collection.hpp>
0027 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0028 
0029 namespace boost {
0030 namespace serialization {
0031     class extended_type_info;
0032 } // namespace serialization
0033 
0034 namespace archive {
0035 namespace detail {
0036 
0037 class basic_oarchive_impl;
0038 class basic_oserializer;
0039 class basic_pointer_oserializer;
0040 
0041 //////////////////////////////////////////////////////////////////////
0042 // class basic_oarchive - write serialized objects to an output stream
0043 class BOOST_SYMBOL_VISIBLE basic_oarchive :
0044     private boost::noncopyable,
0045     public boost::archive::detail::helper_collection
0046 {
0047     friend class basic_oarchive_impl;
0048     // hide implementation of this class to minimize header conclusion
0049     boost::scoped_ptr<basic_oarchive_impl> pimpl;
0050 
0051     // overload these to bracket object attributes. Used to implement
0052     // xml archives
0053     virtual void vsave(const version_type t) =  0;
0054     virtual void vsave(const object_id_type t) =  0;
0055     virtual void vsave(const object_reference_type t) =  0;
0056     virtual void vsave(const class_id_type t) =  0;
0057     virtual void vsave(const class_id_optional_type t) = 0;
0058     virtual void vsave(const class_id_reference_type t) =  0;
0059     virtual void vsave(const class_name_type & t) = 0;
0060     virtual void vsave(const tracking_type t) = 0;
0061 protected:
0062     BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0);
0063     BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection &
0064     get_helper_collection();
0065     virtual BOOST_ARCHIVE_DECL ~basic_oarchive();
0066 public:
0067     // note: NOT part of the public interface
0068     BOOST_ARCHIVE_DECL void register_basic_serializer(
0069         const basic_oserializer & bos
0070     );
0071     BOOST_ARCHIVE_DECL void save_object(
0072         const void *x,
0073         const basic_oserializer & bos
0074     );
0075     BOOST_ARCHIVE_DECL void save_pointer(
0076         const void * t,
0077         const basic_pointer_oserializer * bpos_ptr
0078     );
0079     void save_null_pointer(){
0080         vsave(BOOST_SERIALIZATION_NULL_POINTER_TAG);
0081     }
0082     // real public interface starts here
0083     BOOST_ARCHIVE_DECL void end_preamble(); // default implementation does nothing
0084     BOOST_ARCHIVE_DECL boost::serialization::library_version_type get_library_version() const;
0085     BOOST_ARCHIVE_DECL unsigned int get_flags() const;
0086 };
0087 
0088 } // namespace detail
0089 } // namespace archive
0090 } // namespace boost
0091 
0092 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0093 
0094 #endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP