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
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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 }
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
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
0049 boost::scoped_ptr<basic_oarchive_impl> pimpl;
0050
0051
0052
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
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
0083 BOOST_ARCHIVE_DECL void end_preamble();
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 }
0089 }
0090 }
0091
0092 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0093
0094 #endif