Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_DETAIL_COMMON_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 // common_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 <boost/config.hpp>
0020 
0021 #include <boost/archive/detail/basic_oarchive.hpp>
0022 #include <boost/archive/detail/interface_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 namespace detail {
0032 
0033 // note: referred to as Curiously Recurring Template Patter (CRTP)
0034 template<class Archive>
0035 
0036 class BOOST_SYMBOL_VISIBLE common_oarchive :
0037     public basic_oarchive,
0038     public interface_oarchive<Archive>
0039 {
0040     friend class interface_oarchive<Archive>;
0041     friend class basic_oarchive;
0042 private:
0043     void vsave(const version_type t) BOOST_OVERRIDE {
0044         * this->This() << t;
0045     }
0046     void vsave(const object_id_type t) BOOST_OVERRIDE {
0047         * this->This() << t;
0048     }
0049     void vsave(const object_reference_type t) BOOST_OVERRIDE {
0050         * this->This() << t;
0051     }
0052     void vsave(const class_id_type t) BOOST_OVERRIDE {
0053         * this->This() << t;
0054     }
0055     void vsave(const class_id_reference_type t) BOOST_OVERRIDE {
0056         * this->This() << t;
0057     }
0058     void vsave(const class_id_optional_type t) BOOST_OVERRIDE {
0059         * this->This() << t;
0060     }
0061     void vsave(const class_name_type & t) BOOST_OVERRIDE {
0062         * this->This() << t;
0063     }
0064     void vsave(const tracking_type t) BOOST_OVERRIDE {
0065         * this->This() << t;
0066     }
0067 protected:
0068     // default processing - invoke serialization library
0069     template<class T>
0070     void save_override(T & t){
0071         archive::save(* this->This(), t);
0072     }
0073     void save_start(const char * /*name*/){}
0074     void save_end(const char * /*name*/){}
0075     common_oarchive(unsigned int flags = 0) :
0076         basic_oarchive(flags),
0077         interface_oarchive<Archive>()
0078     {}
0079 };
0080 
0081 } // namespace detail
0082 } // namespace archive
0083 } // namespace boost
0084 
0085 #ifdef BOOST_MSVC
0086 #pragma warning(pop)
0087 #endif
0088 
0089 #endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP