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_IARCHIVE_HPP
0002 #define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_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_iarchive.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_iarchive.hpp>
0022 #include <boost/archive/detail/basic_pointer_iserializer.hpp>
0023 #include <boost/archive/detail/interface_iarchive.hpp>
0024 
0025 #ifdef BOOST_MSVC
0026 #  pragma warning(push)
0027 #  pragma warning(disable : 4511 4512)
0028 #endif
0029 
0030 namespace boost {
0031 namespace archive {
0032 namespace detail {
0033 
0034 class extended_type_info;
0035 
0036 // note: referred to as Curiously Recurring Template Patter (CRTP)
0037 template<class Archive>
0038 class BOOST_SYMBOL_VISIBLE common_iarchive :
0039     public basic_iarchive,
0040     public interface_iarchive<Archive>
0041 {
0042     friend class interface_iarchive<Archive>;
0043     friend class basic_iarchive;
0044 private:
0045     void vload(version_type & t) BOOST_OVERRIDE {
0046         * this->This() >> t;
0047     }
0048     void vload(object_id_type & t) BOOST_OVERRIDE {
0049         * this->This() >> t;
0050     }
0051     void vload(class_id_type & t) BOOST_OVERRIDE {
0052         * this->This() >> t;
0053     }
0054     void vload(class_id_optional_type & t) BOOST_OVERRIDE {
0055         * this->This() >> t;
0056     }
0057     void vload(tracking_type & t) BOOST_OVERRIDE {
0058         * this->This() >> t;
0059     }
0060     void vload(class_name_type &s) BOOST_OVERRIDE {
0061         * this->This() >> s;
0062     }
0063 protected:
0064     // default processing - invoke serialization library
0065     template<class T>
0066     void load_override(T & t){
0067         archive::load(* this->This(), t);
0068     }
0069     // default implementations of functions which emit start/end tags for
0070     // archive types that require them.
0071     void load_start(const char * /*name*/){}
0072     void load_end(const char * /*name*/){}
0073     // default archive initialization
0074     common_iarchive(unsigned int flags = 0) :
0075         basic_iarchive(flags),
0076         interface_iarchive<Archive>()
0077     {}
0078 };
0079 
0080 } // namespace detail
0081 } // namespace archive
0082 } // namespace boost
0083 
0084 #ifdef BOOST_MSVC
0085 #pragma warning(pop)
0086 #endif
0087 
0088 #endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP