File indexing completed on 2025-01-18 09:28:29
0001 #ifndef BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
0002 #define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_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
0020
0021
0022
0023
0024
0025
0026 #include <boost/config.hpp>
0027 #include <boost/detail/workaround.hpp>
0028
0029 #include <boost/archive/basic_archive.hpp>
0030 #include <boost/archive/detail/common_iarchive.hpp>
0031 #include <boost/serialization/collection_size_type.hpp>
0032 #include <boost/serialization/string.hpp>
0033 #include <boost/serialization/library_version_type.hpp>
0034 #include <boost/serialization/item_version_type.hpp>
0035 #include <boost/integer_traits.hpp>
0036
0037 #ifdef BOOST_MSVC
0038 # pragma warning(push)
0039 # pragma warning(disable : 4511 4512)
0040 #endif
0041
0042 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0043
0044 namespace boost {
0045 namespace archive {
0046
0047 namespace detail {
0048 template<class Archive> class interface_iarchive;
0049 }
0050
0051
0052
0053 template<class Archive>
0054 class BOOST_SYMBOL_VISIBLE basic_binary_iarchive :
0055 public detail::common_iarchive<Archive>
0056 {
0057 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0058 public:
0059 #else
0060 protected:
0061 #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
0062
0063
0064 friend detail::interface_iarchive<Archive>;
0065 #else
0066 friend class detail::interface_iarchive<Archive>;
0067 #endif
0068 #endif
0069
0070
0071
0072
0073 typedef detail::common_iarchive<Archive> detail_common_iarchive;
0074 template<class T>
0075 void load_override(T & t){
0076 this->detail_common_iarchive::load_override(t);
0077 }
0078
0079
0080
0081
0082 BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
0083 BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
0084
0085 BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
0086 BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
0087
0088
0089 void load_override(class_id_optional_type & ){}
0090
0091 void load_override(tracking_type & t, int ){
0092 boost::serialization::library_version_type lv = this->get_library_version();
0093 if(boost::serialization::library_version_type(6) < lv){
0094 int_least8_t x=0;
0095 * this->This() >> x;
0096 t = boost::archive::tracking_type(x);
0097 }
0098 else{
0099 bool x=0;
0100 * this->This() >> x;
0101 t = boost::archive::tracking_type(x);
0102 }
0103 }
0104 void load_override(class_id_type & t){
0105 boost::serialization::library_version_type lv = this->get_library_version();
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124 if(boost::serialization::library_version_type (7) < lv){
0125 this->detail_common_iarchive::load_override(t);
0126 }
0127 else{
0128 int_least16_t x=0;
0129 * this->This() >> x;
0130 t = boost::archive::class_id_type(x);
0131 }
0132 }
0133 void load_override(class_id_reference_type & t){
0134 load_override(static_cast<class_id_type &>(t));
0135 }
0136
0137 void load_override(version_type & t){
0138 boost::serialization::library_version_type lv = this->get_library_version();
0139 if(boost::serialization::library_version_type(7) < lv){
0140 this->detail_common_iarchive::load_override(t);
0141 }
0142 else
0143 if(boost::serialization::library_version_type(6) < lv){
0144 uint_least8_t x=0;
0145 * this->This() >> x;
0146 t = boost::archive::version_type(x);
0147 }
0148 else
0149 if(boost::serialization::library_version_type(5) < lv){
0150 uint_least16_t x=0;
0151 * this->This() >> x;
0152 t = boost::archive::version_type(x);
0153 }
0154 else
0155 if(boost::serialization::library_version_type(2) < lv){
0156
0157 unsigned char x=0;
0158 * this->This() >> x;
0159 t = version_type(x);
0160 }
0161 else{
0162 unsigned int x=0;
0163 * this->This() >> x;
0164 t = boost::archive::version_type(x);
0165 }
0166 }
0167
0168 void load_override(boost::serialization::item_version_type & t){
0169 boost::serialization::library_version_type lv = this->get_library_version();
0170
0171 if(boost::serialization::library_version_type(6) < lv){
0172 this->detail_common_iarchive::load_override(t);
0173 }
0174 else
0175 if(boost::serialization::library_version_type(6) < lv){
0176 uint_least16_t x=0;
0177 * this->This() >> x;
0178 t = boost::serialization::item_version_type(x);
0179 }
0180 else{
0181 unsigned int x=0;
0182 * this->This() >> x;
0183 t = boost::serialization::item_version_type(x);
0184 }
0185 }
0186
0187 void load_override(serialization::collection_size_type & t){
0188 if(boost::serialization::library_version_type(5) < this->get_library_version()){
0189 this->detail_common_iarchive::load_override(t);
0190 }
0191 else{
0192 unsigned int x=0;
0193 * this->This() >> x;
0194 t = serialization::collection_size_type(x);
0195 }
0196 }
0197
0198 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0199 load_override(class_name_type & t);
0200 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0201 init();
0202
0203 basic_binary_iarchive(unsigned int flags) :
0204 detail::common_iarchive<Archive>(flags)
0205 {}
0206 };
0207
0208 }
0209 }
0210
0211 #ifdef BOOST_MSVC
0212 #pragma warning(pop)
0213 #endif
0214
0215 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0216
0217 #endif