mirror of
https://github.com/boostorg/serialization.git
synced 2026-07-21 13:33:32 +00:00
Compare commits
119 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 07de314975 | |||
| ed44fcd268 | |||
| 17fb465af1 | |||
| 753c157497 | |||
| 0eec916ab2 | |||
| 88094d44b6 | |||
| 53047f6356 | |||
| 7e0708ea5d | |||
| d0509483ed | |||
| d95a1df37a | |||
| eac306d8a6 | |||
| 998e6c3d59 | |||
| b22ffc63da | |||
| 489eef0e17 | |||
| 443dea34ab | |||
| 76df6df23f | |||
| 643cce2a9c | |||
| 098019d074 | |||
| ece3187e24 | |||
| c813db7ad7 | |||
| f04a8cbe90 | |||
| 0f0409a2ad | |||
| 6bd667a5bb | |||
| 5dd938f4f1 | |||
| 4ed898b1d3 | |||
| 7300ff02b9 | |||
| fd8186018b | |||
| c32a663c99 | |||
| 48f0844fda | |||
| 84e9ab57a7 | |||
| 0034b070bd | |||
| 1b11637b1c | |||
| 7d79dc7146 | |||
| 8d4b2136d2 | |||
| 7adafcbf01 | |||
| 669d266ec7 | |||
| 361ed95f4c | |||
| b6d26f9a58 | |||
| cd8a989be4 | |||
| ee50f8c911 | |||
| d526c0f80e | |||
| a61f5d2563 | |||
| 03c6d23ce8 | |||
| 9c770604dc | |||
| b78cd872ec | |||
| 6e3d1a89f7 | |||
| 854dd12473 | |||
| f01148e421 | |||
| cc2a996384 | |||
| 9e98df0a0d | |||
| feb53726e1 | |||
| b97bcdfeb3 | |||
| 723bd44abd | |||
| f297d80d6e | |||
| efcd46eb1b | |||
| 5778b99fd2 | |||
| c5549b2d6b | |||
| 237ff81ac6 | |||
| 65f05dc209 | |||
| 86996d0637 | |||
| 5c19264436 | |||
| af46ac2da3 | |||
| e1893dd28c | |||
| da9c3059f2 | |||
| 28c333ce65 | |||
| 5edc5acf27 | |||
| c5120dfd11 | |||
| 87c50e75fa | |||
| 738695b707 | |||
| 08455abe23 | |||
| 90e22bb58b | |||
| 449e659de3 | |||
| 4986fc2097 | |||
| 52cbea8c16 | |||
| ed435d5a31 | |||
| a362331b93 | |||
| b430b6d674 | |||
| 2792359662 | |||
| 7a078733a1 | |||
| 75c224103d | |||
| 297b7c3b52 | |||
| 8ca532a4d5 | |||
| 226af45461 | |||
| b4b8cbab00 | |||
| 3c438dfddb | |||
| 2b61be1285 | |||
| d3bb8d0e50 | |||
| 89dc4a26b1 | |||
| 6477759341 | |||
| 69d1b26937 | |||
| bc0279429b | |||
| b73329fe45 | |||
| 63b6ffa765 | |||
| 24024425f1 | |||
| 4ee479a03e | |||
| 8378c75f32 | |||
| 7d216b4761 | |||
| f94da2c724 | |||
| fea1826e06 | |||
| 8eb388fe39 | |||
| 8bbcca5341 | |||
| 0676016ce3 | |||
| be2846e2d1 | |||
| b87dc62e69 | |||
| 2c2a4a53d0 | |||
| eb35302b76 | |||
| a2a8890dfb | |||
| f4be906175 | |||
| 2e8e91a5cc | |||
| 089d57b855 | |||
| 0ba417dd1c | |||
| 9e90f233a1 | |||
| 9e7cd200e7 | |||
| d327f90bd8 | |||
| 8d0b0db5de | |||
| daf20da064 | |||
| 71851223c3 | |||
| 64dc620992 | |||
| 40314f94df |
+78
-47
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016 Peter Dimov
|
||||
# Copyright 2016, 2017 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -6,66 +6,97 @@ language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
cache:
|
||||
ccache: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc LINK=static,shared
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc LINK=static,shared
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-6
|
||||
env: TOOLSET=gcc LINK=static,shared
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc LINK=static,shared
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang LINK=static,shared
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-libc++
|
||||
env: TOOLSET=clang LINK=static,shared
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc++-dev
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang LINK=static,shared
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang LINK=static,shared
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule init libs/align
|
||||
- git submodule init libs/array
|
||||
- git submodule init libs/assert
|
||||
- git submodule init libs/bind
|
||||
- git submodule init libs/compatibility
|
||||
- git submodule init libs/concept_check
|
||||
- git submodule init libs/config
|
||||
- git submodule init libs/container
|
||||
- git submodule init libs/core
|
||||
- git submodule init libs/detail
|
||||
- git submodule init libs/filesystem
|
||||
- git submodule init libs/function
|
||||
- git submodule init libs/functional
|
||||
- git submodule init libs/integer
|
||||
- git submodule init libs/intrusive
|
||||
- git submodule init libs/io
|
||||
- git submodule init libs/iterator
|
||||
- git submodule init libs/lexical_cast
|
||||
- git submodule init libs/math
|
||||
- git submodule init libs/move
|
||||
- git submodule init libs/mpl
|
||||
- git submodule init libs/numeric/conversion
|
||||
- git submodule init libs/optional
|
||||
- git submodule init libs/predef
|
||||
- git submodule init libs/preprocessor
|
||||
- git submodule init libs/range
|
||||
- git submodule init libs/smart_ptr
|
||||
- git submodule init libs/spirit
|
||||
- git submodule init libs/static_assert
|
||||
- git submodule init libs/system
|
||||
- git submodule init libs/throw_exception
|
||||
- git submodule init libs/tuple
|
||||
- git submodule init libs/type_index
|
||||
- git submodule init libs/type_traits
|
||||
- git submodule init libs/unordered
|
||||
- git submodule init libs/utility
|
||||
- git submodule init libs/variant
|
||||
- git submodule init tools/build
|
||||
- git submodule update --depth 1
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/serialization
|
||||
- python tools/boostdep/depinst/depinst.py serialization
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- TOOLSET=gcc,clang
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
|
||||
- ./b2 libs/serialization/test toolset=$TOOLSET
|
||||
- |-
|
||||
echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 -j 3 libs/serialization/test toolset=$TOOLSET link=${LINK:-shared}
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
+127
-140
@@ -10,11 +10,7 @@ if (POLICY CMP0063)
|
||||
cmake_policy (SET CMP0063 NEW)
|
||||
endif (POLICY CMP0063)
|
||||
|
||||
if(Boost_USE_STATIC_LIBS)
|
||||
project("Serialization-Static")
|
||||
else()
|
||||
project("Serialization-Shared")
|
||||
endif()
|
||||
project("serialization")
|
||||
|
||||
#
|
||||
# Compiler settings
|
||||
@@ -24,7 +20,7 @@ message(STATUS "compiler is ${CMAKE_CXX_COMPILER_ID}" )
|
||||
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
|
||||
|
||||
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
|
||||
add_definitions( -ftemplate-depth=300 )
|
||||
add_definitions( -ftemplate-depth=255 )
|
||||
# we use gcc to test for C++03 compatibility
|
||||
add_definitions( -std=c++03 )
|
||||
message(STATUS "compiler is g++ c++03")
|
||||
@@ -35,29 +31,12 @@ elseif( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
|
||||
set(COMPILER_SUPPORTS_CXX11 TRUE)
|
||||
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=300")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3" )
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -dead_strip")
|
||||
set(COMPILER_SUPPORTS_CXX11 TRUE)
|
||||
endif()
|
||||
|
||||
#
|
||||
# IDE settings
|
||||
#
|
||||
|
||||
if( CMAKE_HOST_APPLE )
|
||||
# note: it seems that bjam builds both address models in any case
|
||||
# so we can defer this decision to the IDE just as we do for debug/release
|
||||
# so we'll not use this now
|
||||
# set(Boost_ADDRESS_MODEL 64 CACHE INTEGER "32/64 bits")
|
||||
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link to Boost static libraries")
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
else()
|
||||
set(Boost_ADDRESS_MODEL 64 CACHE INTEGER "32/64 bits")
|
||||
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link to Boost static libraries")
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
set(COMPILER_SUPPORTS_CXX11 FALSE)
|
||||
endif()
|
||||
|
||||
#
|
||||
@@ -67,86 +46,37 @@ endif()
|
||||
# Boost
|
||||
|
||||
# note: we're assuming that boost has been built with:
|
||||
# ./b2 —-layout=versioned toolset=clang-darwin link=static,shared variant=debug,release stage
|
||||
# ./b2 toolset=clang-darwin link=static,shared variant=debug,release stage
|
||||
|
||||
###########################
|
||||
# special notes for Xcode.
|
||||
|
||||
# these three should result in CMake setting the variables
|
||||
# Boost_SERIALIZATION_LIBRARY_DEBUG … to the correct values.
|
||||
|
||||
# But my current version of CMake doesn't automatically set the library names
|
||||
# to point to the the libraries to be used. The variables are created
|
||||
# but they are not initialized. So be prepared to set these variables by hand.
|
||||
# If you want to use the static libraries - point to the boost libraries ending
|
||||
# in ".a". If you want to use the shared boost libraries - point to the libraries
|
||||
# ending in ".dylib".
|
||||
|
||||
# But wait - there's more.
|
||||
# if both lib.a and lib.dylib both exist in the library directory, Xcode will
|
||||
# automatically chose the *.dylib one - and there's nothing you can do to fix this.
|
||||
# So my recommendation is
|
||||
# a) to place the compiled libraries in two different directories
|
||||
# - e.g. stage/lib-static/*.a and stage/lib-shared/*.dylib
|
||||
# and set the CMake variable Boost_LIBRARY_DIR to point to one or the other
|
||||
# b) create two different CMake build directories - build-static and build-shared
|
||||
# and switch between projects as desired. I like to test both since
|
||||
# there are things like dead code elimination and visibility which vary
|
||||
# between the two environments.
|
||||
#
|
||||
# caveat - as I write this, I've been unable to get the tests on the shared
|
||||
# library to function. Problem is that one needs to either put the shared
|
||||
# libraries in a special known place or set an environmental
|
||||
# variable which points to the shared library directory. I prefer the latter
|
||||
# but I've been unable to figure out how to get Xcode to do on a global basis
|
||||
# and it's not practical to do this for 247 test targets one at a time.
|
||||
# Project settings
|
||||
#
|
||||
option(BUILD_SHARED_LIBS "Build Shared Libraries" true)
|
||||
|
||||
# c) The targets in the project will by default be built as universal 32/64 binaries
|
||||
# I have yet to experiment with these yet so I just set the target to 64 bit.
|
||||
find_package(Boost 1.74 REQUIRED COMPONENTS system filesystem)
|
||||
|
||||
# end special note for Xcode
|
||||
############################
|
||||
if(NOT Boost_FOUND)
|
||||
message("Boost NOT Found!")
|
||||
else()
|
||||
message(STATUS "Boost Found!")
|
||||
endif()
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(VISIBILITY_INLINES_HIDDEN YES)
|
||||
|
||||
set(Boost_DEBUG true)
|
||||
set(Boost_DETAILED_FAILURE_MSG true)
|
||||
set(Boost_FOUND true)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS system filesystem)
|
||||
# enable usage of CHECK_INCLUDE_FILE_CXX
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
message(STATUS "Boost_FOUND is ${Boost_FOUND}")
|
||||
# list of archive names for which tests should be generated
|
||||
set(archive_list text_archive text_warchive binary_archive xml_archive xml_warchive)
|
||||
# set(archive_list xml_warchive)
|
||||
|
||||
if(Boost_FOUND)
|
||||
message(STATUS "Boost Found!")
|
||||
message(STATUS "Boost is ${BOOST_ROOT}")
|
||||
message(STATUS "Boost directories found at ${Boost_INCLUDE_DIRS}")
|
||||
message(STATUS "Boost libraries found at ${Boost_LIBRARY_DIRS}")
|
||||
message(STATUS "Boost libraries prefix is ${Boost_LIB_PREFIX}")
|
||||
message(STATUS "Boost component libraries to be linked are ${Boost_LIBRARIES}")
|
||||
message(STATUS "Boost version found is ${Boost_VERSION}")
|
||||
#include_directories("../include" "${Boost_INCLUDE_DIRS}")
|
||||
#link_directories("${Boost_LIBRARY_DIRS}")
|
||||
else()
|
||||
message(STATUS "Boost NOT Found!")
|
||||
endif()
|
||||
|
||||
if(Boost_USE_STATIC_LIBS)
|
||||
message(STATUS "Use static libraries")
|
||||
set(LINK_TYPE "STATIC")
|
||||
else()
|
||||
message(STATUS "Building shared libraries")
|
||||
set(LINK_TYPE "SHARED")
|
||||
add_definitions( "-DBOOST_ALL_DYN_LINK=1")
|
||||
add_definitions( "-DBOOST_ALL_NO_LIB=1")
|
||||
add_definitions( "-DBOOST_LIB_DIAGNOSTICS=1")
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(VISIBILITY_INLINES_HIDDEN)
|
||||
endif()
|
||||
# list of tests generated by each function call
|
||||
set(test_list)
|
||||
|
||||
###########################
|
||||
# library builds
|
||||
|
||||
add_library(serialization ${LINK_TYPE}
|
||||
add_library(serialization
|
||||
../src/archive_exception.cpp
|
||||
../src/basic_archive.cpp
|
||||
../src/basic_iarchive.cpp
|
||||
@@ -161,35 +91,47 @@ add_library(serialization ${LINK_TYPE}
|
||||
../src/basic_xml_archive.cpp
|
||||
../src/binary_iarchive.cpp
|
||||
../src/binary_oarchive.cpp
|
||||
../src/extended_type_info_no_rtti.cpp
|
||||
../src/extended_type_info_typeid.cpp
|
||||
../src/extended_type_info.cpp
|
||||
../src/polymorphic_iarchive.cpp
|
||||
../src/polymorphic_oarchive.cpp
|
||||
../src/singleton.cpp
|
||||
../src/extended_type_info_typeid.cpp
|
||||
../src/extended_type_info_no_rtti.cpp
|
||||
../src/stl_port.cpp
|
||||
../src/text_iarchive.cpp
|
||||
../src/text_oarchive.cpp
|
||||
../src/polymorphic_iarchive.cpp
|
||||
../src/polymorphic_oarchive.cpp
|
||||
../src/polymorphic_text_iarchive.cpp
|
||||
../src/polymorphic_text_oarchive.cpp
|
||||
../src/polymorphic_binary_iarchive.cpp
|
||||
../src/polymorphic_binary_oarchive.cpp
|
||||
../src/polymorphic_xml_iarchive.cpp
|
||||
../src/polymorphic_xml_oarchive.cpp
|
||||
../src/void_cast.cpp
|
||||
../src/xml_archive_exception.cpp
|
||||
../src/xml_grammar.cpp
|
||||
../src/xml_iarchive.cpp
|
||||
../src/xml_oarchive.cpp
|
||||
../src/xml_grammar.cpp
|
||||
../src/xml_archive_exception.cpp
|
||||
../src/codecvt_null.cpp
|
||||
../src/utf8_codecvt_facet.cpp
|
||||
../src/basic_xml_grammar.ipp # doesn't show up in "Source Files" in Xcode"'
|
||||
)
|
||||
target_include_directories(serialization PUBLIC ${Boost_INCLUDE_DIR})
|
||||
|
||||
add_library(wserialization ${LINK_TYPE}
|
||||
../src/codecvt_null.cpp
|
||||
add_library(wserialization
|
||||
../src/basic_text_wiprimitive.cpp
|
||||
../src/basic_text_woprimitive.cpp
|
||||
../src/text_wiarchive.cpp
|
||||
../src/text_woarchive.cpp
|
||||
../src/polymorphic_text_wiarchive.cpp
|
||||
../src/polymorphic_text_woarchive.cpp
|
||||
../src/xml_wiarchive.cpp
|
||||
../src/xml_woarchive.cpp
|
||||
../src/polymorphic_xml_wiarchive.cpp
|
||||
../src/polymorphic_xml_woarchive.cpp
|
||||
../src/xml_wgrammar.cpp
|
||||
../src/basic_xml_grammar.ipp # doesn't show up in "Source Files" in Xcode"'
|
||||
)
|
||||
target_include_directories(wserialization PUBLIC ${Boost_INCLUDE_DIR})
|
||||
target_link_libraries(wserialization PUBLIC serialization)
|
||||
|
||||
# end library build
|
||||
###########################
|
||||
@@ -204,61 +146,91 @@ function( serialization_test test_name)
|
||||
endforeach()
|
||||
message(STATUS ${test_name})
|
||||
add_executable( ${test_name} ../test/${test_name}.cpp ${arglist} )
|
||||
target_link_libraries(${test_name} serialization wserialization ${Boost_LIBRARIES})
|
||||
target_include_directories(${test_name} PUBLIC ${Boost_INCLUDE_DIR})
|
||||
target_link_libraries(${test_name} serialization wserialization Boost::filesystem)
|
||||
add_test( ${test_name} ${test_name} )
|
||||
endfunction(serialization_test)
|
||||
|
||||
function(archive_test test_name)
|
||||
set(test_listx)
|
||||
set(arglist)
|
||||
foreach(a IN ITEMS ${ARGN} )
|
||||
set(arglist ${arglist} ../test/${a}.cpp)
|
||||
endforeach()
|
||||
foreach(
|
||||
archive-name
|
||||
IN ITEMS text_archive text_warchive binary_archive xml_archive xml_warchive
|
||||
IN ITEMS ${archive_list}
|
||||
)
|
||||
set(amended_test_name ${test_name}_${archive-name})
|
||||
message(STATUS ${amended_test_name})
|
||||
add_executable(${amended_test_name} ../test/${test_name}.cpp ${arglist})
|
||||
set_property(
|
||||
TARGET ${amended_test_name}
|
||||
PROPERTY COMPILE_DEFINITIONS BOOST_ARCHIVE_TEST=${archive-name}.hpp
|
||||
)
|
||||
target_link_libraries(${amended_test_name} serialization wserialization ${Boost_LIBRARIES})
|
||||
target_include_directories(${amended_test_name} PUBLIC ${Boost_INCLUDE_DIR})
|
||||
target_link_libraries(${amended_test_name} serialization wserialization Boost::filesystem)
|
||||
add_test(${amended_test_name} ${amended_test_name})
|
||||
set(test_listx ${test_listx} ${amended_test_name})
|
||||
endforeach()
|
||||
set(test_list ${test_listx} PARENT_SCOPE)
|
||||
endfunction(archive_test)
|
||||
|
||||
function(polymorphic_archive_test test_name)
|
||||
set(test_listx)
|
||||
set(arglist)
|
||||
foreach(a IN ITEMS ${ARGN} )
|
||||
set(arglist ${arglist} ../test/${a}.cpp)
|
||||
endforeach()
|
||||
foreach(
|
||||
archive-name
|
||||
IN ITEMS text_archive text_warchive binary_archive xml_archive xml_warchive
|
||||
IN ITEMS ${archive_list}
|
||||
)
|
||||
set(amended_test_name ${test_name}_polymorphic_${archive-name})
|
||||
message(STATUS ${amended_test_name})
|
||||
set(amended_archive_name polymorphic_${archive-name})
|
||||
set(amended_test_name ${test_name}_${amended_archive_name})
|
||||
add_executable(${amended_test_name} ../test/${test_name}.cpp ${arglist})
|
||||
set_property(
|
||||
TARGET ${amended_test_name}
|
||||
PROPERTY COMPILE_DEFINITIONS BOOST_ARCHIVE_TEST=polymorphic_${archive-name}.hpp
|
||||
PROPERTY COMPILE_DEFINITIONS BOOST_ARCHIVE_TEST=${amended_archive_name}.hpp
|
||||
)
|
||||
target_link_libraries(${amended_test_name} serialization wserialization ${Boost_LIBRARIES})
|
||||
message(STATUS ${amended_test_name} " " ${arglist} " " ${amended_archive_name})
|
||||
target_include_directories(${amended_test_name} PUBLIC ${Boost_INCLUDE_DIR})
|
||||
target_link_libraries(${amended_test_name} serialization wserialization Boost::filesystem)
|
||||
add_test(${amended_test_name} ${amended_test_name})
|
||||
endforeach()
|
||||
set(test_listx ${test_listx} ${amended_test_name})
|
||||
endforeach()
|
||||
set(test_list ${test_listx} PARENT_SCOPE)
|
||||
endfunction(polymorphic_archive_test)
|
||||
|
||||
enable_testing()
|
||||
|
||||
# serialization(test_dll_exported dll_polymorphic_derived2_lib)
|
||||
# serialization(test_dll_simple dll_a_lib)
|
||||
message(STATUS dll_a)
|
||||
add_library(dll_a SHARED ../test/dll_a.cpp)
|
||||
target_link_libraries(dll_a serialization)
|
||||
|
||||
message(STATUS dll_polymorphic_base)
|
||||
add_library(dll_polymorphic_base SHARED ../test/dll_polymorphic_base.cpp)
|
||||
target_link_libraries(dll_polymorphic_base serialization)
|
||||
|
||||
message(STATUS dll_polymorphic_derived2)
|
||||
add_library(dll_polymorphic_derived2 SHARED ../test/dll_polymorphic_derived2.cpp)
|
||||
target_link_libraries(dll_polymorphic_derived2 dll_polymorphic_base serialization)
|
||||
|
||||
# compile test_dll_plugin.cpp
|
||||
# Running the following test requires that the test know the directory
|
||||
# in which the dll is stored. I don't know how to extract this from bjam
|
||||
# serialization(test_dll_plugin : : dll_polymorphic_derived2_lib)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# this test can only be made to work if we're linking with shared
|
||||
# libraries. Basically the build systems like to have all shared
|
||||
# or all static so if we're building with static C++ libraries
|
||||
# then linking with a shared one - we need multiple C++ libraries
|
||||
# and things get complex. So just run this test when we're
|
||||
# building with shared libraries (dll in windows speak)
|
||||
serialization_test(test_dll_simple)
|
||||
target_link_libraries(test_dll_simple dll_a serialization)
|
||||
endif()
|
||||
|
||||
serialization_test(test_private_ctor)
|
||||
serialization_test(test_reset_object_address A)
|
||||
serialization_test(test_void_cast)
|
||||
@@ -266,9 +238,13 @@ serialization_test(test_mult_archive_types)
|
||||
serialization_test(test_iterators)
|
||||
serialization_test(test_iterators_base64)
|
||||
serialization_test(test_inclusion)
|
||||
serialization_test(test_inclusion2)
|
||||
serialization_test(test_smart_cast)
|
||||
serialization_test(test_codecvt_null ../src/codecvt_null)
|
||||
serialization_test(test_codecvt_null)
|
||||
serialization_test(test_strong_typedef)
|
||||
serialization_test(test_singleton)
|
||||
serialization_test(test_singleton_inherited)
|
||||
serialization_test(test_singleton_plain)
|
||||
|
||||
archive_test(test_native_array A)
|
||||
archive_test(test_boost_array A)
|
||||
@@ -288,19 +264,31 @@ archive_test(test_derived)
|
||||
archive_test(test_derived_class A)
|
||||
archive_test(test_diamond)
|
||||
archive_test(test_diamond_complex)
|
||||
archive_test(test_exported polymorphic_base)
|
||||
archive_test(test_forward_list A)
|
||||
archive_test(test_forward_list_ptrs A)
|
||||
CHECK_INCLUDE_FILE_CXX(forward_list FORWARD_LIST_FOUND)
|
||||
if(FORWARD_LIST_FOUND)
|
||||
message(STATUS "forward_list header found")
|
||||
archive_test(test_forward_list A)
|
||||
archive_test(test_forward_list_ptrs A)
|
||||
else()
|
||||
message(STATUS "forward_list header NOT found")
|
||||
endif()
|
||||
archive_test(test_helper_support)
|
||||
archive_test(test_interrupts)
|
||||
archive_test(test_list A)
|
||||
archive_test(test_list_ptrs A)
|
||||
archive_test(test_map A)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
archive_test(test_map_unordered A)
|
||||
else()
|
||||
CHECK_INCLUDE_FILE_CXX(hash_map HASH_MAP_FOUND)
|
||||
if(HASH_MAP_FOUND)
|
||||
archive_test(test_map_hashed A)
|
||||
endif()
|
||||
endif()
|
||||
archive_test(test_map_boost_unordered A)
|
||||
archive_test(test_mi)
|
||||
archive_test(test_multiple_ptrs A)
|
||||
archive_test(test_multiple_inheritance)
|
||||
archive_test(test_no_rtti polymorphic_base polymorphic_derived1)
|
||||
archive_test(test_new_operator A)
|
||||
archive_test(test_non_intrusive)
|
||||
archive_test(test_non_default_ctor)
|
||||
@@ -316,6 +304,16 @@ archive_test(test_private_base2)
|
||||
archive_test(test_queue A)
|
||||
archive_test(test_recursion A)
|
||||
archive_test(test_registered)
|
||||
archive_test(test_set A)
|
||||
archive_test(test_set_boost_unordered A)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
archive_test(test_set_unordered A)
|
||||
else()
|
||||
CHECK_INCLUDE_FILE_CXX(hash_set HASH_SET_FOUND)
|
||||
if(HASH_SET_FOUND)
|
||||
archive_test(test_set_hashed A)
|
||||
endif()
|
||||
endif()
|
||||
archive_test(test_shared_ptr)
|
||||
archive_test(test_shared_ptr_multi_base)
|
||||
archive_test(test_shared_ptr_132)
|
||||
@@ -337,28 +335,17 @@ archive_test(test_unique_ptr)
|
||||
archive_test(test_valarray)
|
||||
archive_test(test_variant A)
|
||||
archive_test(test_vector A)
|
||||
archive_test(test_set A)
|
||||
archive_test(test_set_boost_unordered A)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
archive_test(test_set_unordered A)
|
||||
else()
|
||||
CHECK_INCLUDE_FILE_CXX(hash_set HASH_SET_FOUND)
|
||||
if(HASH_SET_FOUND)
|
||||
archive_test(test_set_hashed A)
|
||||
endif()
|
||||
endif()
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
archive_test(test_map_unordered A)
|
||||
else()
|
||||
CHECK_INCLUDE_FILE_CXX(hash_map HASH_MAP_FOUND)
|
||||
if(HASH_MAP_FOUND)
|
||||
archive_test(test_map_hashed A)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
polymorphic_archive_test(test_dll_exported polymorphic_derived1)
|
||||
foreach(test_name IN ITEMS ${test_list} )
|
||||
target_link_libraries(${test_name} dll_polymorphic_derived2 dll_polymorphic_base serialization wserialization)
|
||||
endforeach()
|
||||
|
||||
polymorphic_archive_test(test_no_rtti polymorphic_base polymorphic_derived1 polymorphic_derived2)
|
||||
polymorphic_archive_test(test_exported polymorphic_base polymorphic_derived1 polymorphic_derived2)
|
||||
polymorphic_archive_test(test_polymorphic test_polymorphic_A A)
|
||||
polymorphic_archive_test(test_polymorphic2 test_polymorphic2imp)
|
||||
polymorphic_archive_test(test_polymorphic_helper)
|
||||
polymorphic_archive_test(test_p_helper)
|
||||
|
||||
# end test targets
|
||||
####################
|
||||
@@ -366,7 +353,7 @@ polymorphic_archive_test(test_polymorphic_helper)
|
||||
####################
|
||||
# add headers in IDE
|
||||
|
||||
# for serialisation
|
||||
# for serialization
|
||||
|
||||
file(GLOB x
|
||||
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
|
||||
+17
-1
@@ -12,6 +12,17 @@ branches:
|
||||
- develop
|
||||
# - master
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- BUILD_TOOLSET: gcc
|
||||
BUILD_LINK: static
|
||||
- BUILD_TOOLSET: gcc
|
||||
BUILD_LINK: shared
|
||||
- BUILD_TOOLSET: msvc-14.0
|
||||
BUILD_LINK: static
|
||||
- BUILD_TOOLSET: msvc-14.0
|
||||
BUILD_LINK: shared
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root
|
||||
@@ -24,6 +35,7 @@ install:
|
||||
- git submodule init libs/concept_check
|
||||
- git submodule init libs/config
|
||||
- git submodule init libs/container
|
||||
- git submodule init libs/container_hash
|
||||
- git submodule init libs/core
|
||||
- git submodule init libs/detail
|
||||
- git submodule init libs/filesystem
|
||||
@@ -53,6 +65,10 @@ install:
|
||||
- git submodule init libs/unordered
|
||||
- git submodule init libs/utility
|
||||
- git submodule init libs/variant
|
||||
- git submodule init libs/winapi
|
||||
- git submodule init tools/boost_install
|
||||
- git submodule init libs/headers
|
||||
|
||||
- git submodule init tools/build
|
||||
- git submodule update
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\serialization
|
||||
@@ -64,4 +80,4 @@ build: off
|
||||
|
||||
test_script:
|
||||
- cd libs/serialization/test
|
||||
- b2 toolset=gcc link=static,shared
|
||||
- b2 -j2 toolset=%BUILD_TOOLSET% link=%BUILD_LINK%
|
||||
|
||||
+14
-3
@@ -53,6 +53,7 @@ rule include-spirit ( properties * )
|
||||
}
|
||||
|
||||
SOURCES =
|
||||
archive_exception
|
||||
basic_archive
|
||||
basic_iarchive
|
||||
basic_iserializer
|
||||
@@ -74,25 +75,33 @@ SOURCES =
|
||||
stl_port
|
||||
text_iarchive
|
||||
text_oarchive
|
||||
polymorphic_text_iarchive
|
||||
polymorphic_text_oarchive
|
||||
polymorphic_binary_iarchive
|
||||
polymorphic_binary_oarchive
|
||||
polymorphic_xml_iarchive
|
||||
polymorphic_xml_oarchive
|
||||
void_cast
|
||||
archive_exception
|
||||
xml_grammar
|
||||
xml_iarchive
|
||||
xml_oarchive
|
||||
xml_archive_exception
|
||||
codecvt_null
|
||||
utf8_codecvt_facet
|
||||
singleton
|
||||
;
|
||||
;
|
||||
|
||||
WSOURCES =
|
||||
basic_text_wiprimitive
|
||||
basic_text_woprimitive
|
||||
text_wiarchive
|
||||
text_woarchive
|
||||
polymorphic_text_wiarchive
|
||||
polymorphic_text_woarchive
|
||||
xml_wgrammar
|
||||
xml_wiarchive
|
||||
xml_woarchive
|
||||
polymorphic_xml_wiarchive
|
||||
polymorphic_xml_woarchive
|
||||
;
|
||||
|
||||
lib boost_serialization
|
||||
@@ -100,6 +109,7 @@ lib boost_serialization
|
||||
:
|
||||
<toolset>msvc:<cxxflags>/Gy
|
||||
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
|
||||
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
|
||||
<toolset>clang:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
<toolset>gcc:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
<toolset>darwin:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
@@ -114,6 +124,7 @@ lib boost_wserialization
|
||||
:
|
||||
<toolset>msvc:<cxxflags>/Gy
|
||||
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
|
||||
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
|
||||
<toolset>clang:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
<toolset>gcc:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
<toolset>darwin:<cxxflags>"-fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
|
||||
@@ -182,11 +182,6 @@ to the archive in some special way. For example, XML archives implement special
|
||||
name-value pairs by overriding this function template for name-value pairs.
|
||||
This replaces the default name-value pair handling, which is just to throw away the name,
|
||||
with one appropriate for XML which writes out the start of an XML tag with the correct object name.
|
||||
<p>
|
||||
The second argument must be part of the function signature even though it is not used.
|
||||
Its purpose is to be sure that code is portable to compilers which fail to correctly
|
||||
implement partial function template ordering. For more information see
|
||||
<a href="implementation.html#functiontemplateordering">this</a>.
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
@@ -231,11 +226,6 @@ explicitly provided for these types. For an example see
|
||||
In real practice, we probably won't be quite done.
|
||||
One or more of the following issues may need to be addressed:
|
||||
<ul>
|
||||
<li>Many compilers fail to implement correct partial ordering of
|
||||
function templates. The archives included with this library work around
|
||||
this using argument overloading. This technique is described in
|
||||
<a target="detail" href="implementation.html#functiontemplateordering">
|
||||
another section of this manual</a>
|
||||
<li>Even if we are using a conforming compiler, we might want our new archive class
|
||||
to be portable to non-conforming compilers.
|
||||
<li>Our archive format might require extra information inserted into it. For
|
||||
@@ -267,7 +257,7 @@ EXCEPT for one special case.
|
||||
To make this work, the following should be included after the archive
|
||||
class definition.
|
||||
<pre><code>
|
||||
#define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive)
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive)
|
||||
</code></pre>
|
||||
Failure to do this will not inhibit the program from compiling, linking
|
||||
and executing properly - except in one case. If an instance of a derived
|
||||
|
||||
+7
-3
@@ -101,7 +101,10 @@ function initialize() {
|
||||
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#stl">STL Collections</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#versioning">Class Versioning</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#splitting">Splitting <code>serialize</code> into <code>save/load</code></a>
|
||||
<dt><img style="display:none" src="dot.gif">
|
||||
<a target="detail" href="tutorial.html#splitting">
|
||||
Splitting <code>serialize</code> into <code>save/load</code>
|
||||
</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#archives">Archives</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#examples">List of Examples</a>
|
||||
</dl></div></dd>
|
||||
@@ -133,7 +136,9 @@ function initialize() {
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="serialization.html#templates">Templates</a>
|
||||
</dl></div></dd>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="serialization.html#versioning">Versioning</a>
|
||||
<dt><img style="display:none" s'c="dot.gif"><a target="detail" href="serialization.html#splitting">Splitting <code>serialize</code> into <code>save/load</code></a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="tutorial.html#splitting">
|
||||
Splitting <code>serialize</code> into <code>save/load</code>
|
||||
</a>
|
||||
</dl></div></dd>
|
||||
<dt><img style="display:none" src="plus.gif" id="pointers"><a target="detail" href="serialization.html#pointeroperators">Pointers</a>
|
||||
<dd><div id="pointers_detail"><dl class="page-index">
|
||||
@@ -227,7 +232,6 @@ function initialize() {
|
||||
</dl></div></dd>
|
||||
<dt><img style="display:none" src="plus.gif" id="implementation"><a target="detail" href="implementation.html">Implementation Notes</a>
|
||||
<dd><div id="implementation_detail"><dl class="page-index">
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="implementation.html#functiontemplateordering">Partial Function Template Ordering</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="implementation.html#charencoding">Character Encoding</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="implementation.html#tempatesyntax">Template Invocation syntax</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="implementation.html#partialtemplatespecialization">Partial Template Specialization</a>
|
||||
|
||||
@@ -112,20 +112,6 @@ constructor <code style="white-space: normal">base64_text(const char *)</code>
|
||||
Iterator Adaptors include a <code style="white-space: normal">make_xxx_iterator</code> to fulfill this function.
|
||||
However, I believe these are unwieldy to use compared to the above solution using
|
||||
Templated constructors.
|
||||
<p>
|
||||
Unfortunately, some systems which fail to properly support partial function template
|
||||
ordering cannot support the concept of a templated constructor as implemented above.
|
||||
A special "wrapper" macro has been created to work around this problem. With this "wrapper"
|
||||
the above example is modified to:
|
||||
<pre><code>
|
||||
std::copy(
|
||||
base64_text(BOOST_MAKE_PFTO_WRAPPER(address)),
|
||||
base64_text(BOOST_MAKE_PFTO_WRAPPER(address + count)),
|
||||
ostream_iterator<char>(os)
|
||||
);
|
||||
</code></pre>
|
||||
This macro is defined in <a target="pfto" href="../../../boost/serialization/pfto.hpp"><boost/serialization/pfto.hpp></a>.
|
||||
For more information about this topic, check the source.
|
||||
|
||||
<h4>Dereferencing</h4>
|
||||
Dereferencing some iterators can cause problems. For example, a natural
|
||||
|
||||
@@ -83,12 +83,6 @@ the base classes.
|
||||
|
||||
<li><i></i>Reread <a target="detail" href="headers.html#archiveinternals">Archive Internals</a>.
|
||||
This describes the class hierarchy so that you know what to override.
|
||||
<li><i>Note the usage of PFTO.</i> Some compilers fail to provide support for
|
||||
partial function template ordering. The serialization library works around this by
|
||||
using <a target="detail" href="implementation.html#functiontemplateordering">
|
||||
<b>P</b>artial <b>F</b>unction <b>T</b>emplate <b>O</b>rdering</a> in several places.
|
||||
This is done
|
||||
in several places, including the archive classes themselves.
|
||||
<li><i>Base class functions will usually need to be explicitly invoked.</i>
|
||||
We commonly specialize the function name <code style="white-space: normal">save_override</code>
|
||||
for saving primitives. Usage of a function name in a derived class
|
||||
|
||||
+7
-7
@@ -26,11 +26,11 @@
|
||||
/////////////////////////////////////////////////////////////
|
||||
// The intent of this program is to serve as a tutorial for
|
||||
// users of the serialization package. An attempt has been made
|
||||
// to illustrate most of the facilities of the package.
|
||||
// to illustrate most of the facilities of the package.
|
||||
//
|
||||
// The intent is to create an example suffciently complete to
|
||||
// illustrate the usage and utility of the package while
|
||||
// including a minimum of other code.
|
||||
// including a minimum of other code.
|
||||
//
|
||||
// This illustration models the bus system of a small city.
|
||||
// This includes, multiple bus stops, bus routes and schedules.
|
||||
@@ -57,7 +57,7 @@ class gps_position
|
||||
public:
|
||||
// every serializable class needs a constructor
|
||||
gps_position(){};
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
degrees(_d), minutes(_m), seconds(_s)
|
||||
{}
|
||||
};
|
||||
@@ -147,7 +147,7 @@ class bus_stop_destination : public bus_stop
|
||||
ar & boost::serialization::base_object<bus_stop>(*this) & name;
|
||||
}
|
||||
public:
|
||||
|
||||
|
||||
bus_stop_destination(){}
|
||||
bus_stop_destination(
|
||||
const gps_position & _lat, const gps_position & _long, const std::string & _name
|
||||
@@ -213,7 +213,7 @@ std::ostream & operator<<(std::ostream &os, const bus_route &br)
|
||||
// Illustrates serialization of STL objects(pair) in a non-intrusive way.
|
||||
// See definition of operator<< <pair<F, S> >(ar, pair) and others in
|
||||
// serialization.hpp
|
||||
//
|
||||
//
|
||||
// illustrates nesting of serializable classes
|
||||
//
|
||||
// illustrates use of version number to automatically grandfather older
|
||||
@@ -299,7 +299,7 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
@@ -351,7 +351,7 @@ int main(int argc, char *argv[])
|
||||
// display the complete schedule
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demofile.txt";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_auto_ptr.cpp
|
||||
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <cstdio> // remove, std::autoptr inteface wrong in dinkumware
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@ namespace std{
|
||||
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
+10
-10
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// A.hpp simple class test
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::rand;
|
||||
using ::rand;
|
||||
using ::fabs;
|
||||
using ::size_t;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
ar & BOOST_SERIALIZATION_NVP(f);
|
||||
ar & BOOST_SERIALIZATION_NVP(g);
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x551 )
|
||||
int i;
|
||||
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
|
||||
i = l;
|
||||
@@ -229,12 +229,12 @@ inline bool A::operator==(const A &rhs) const
|
||||
if(o != rhs.o)
|
||||
return false;
|
||||
if(p != rhs.p)
|
||||
return false;
|
||||
return false;
|
||||
if(q != rhs.q)
|
||||
return false;
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
if(r != rhs.r)
|
||||
return false;
|
||||
return false;
|
||||
#endif
|
||||
if(c != rhs.c)
|
||||
return false;
|
||||
@@ -243,9 +243,9 @@ inline bool A::operator==(const A &rhs) const
|
||||
if(t != rhs.t)
|
||||
return false;
|
||||
if(u != rhs.u)
|
||||
return false;
|
||||
return false;
|
||||
if(v != rhs.v)
|
||||
return false;
|
||||
return false;
|
||||
if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
|
||||
return false;
|
||||
if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
|
||||
@@ -255,7 +255,7 @@ inline bool A::operator==(const A &rhs) const
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
if(0 != z.compare(rhs.z))
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -297,11 +297,11 @@ inline bool A::operator<(const A &rhs) const
|
||||
if(t != rhs.t )
|
||||
return t < rhs.t;
|
||||
if(u != rhs.u )
|
||||
return u < rhs.u;
|
||||
return u < rhs.u;
|
||||
if(v != rhs.v )
|
||||
return v < rhs.v;
|
||||
if(w != rhs.w )
|
||||
return w < rhs.w;
|
||||
return w < rhs.w;
|
||||
if(x != rhs.x )
|
||||
return x < rhs.x;
|
||||
int i = y.compare(rhs.y);
|
||||
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
ar & BOOST_SERIALIZATION_NVP(f);
|
||||
ar & BOOST_SERIALIZATION_NVP(g);
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x551 )
|
||||
int i;
|
||||
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
|
||||
i = l;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// B.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::rand;
|
||||
using ::rand;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -101,10 +101,10 @@ inline bool B::operator==(const B &rhs) const
|
||||
{
|
||||
return
|
||||
A::operator==(rhs)
|
||||
&& s == rhs.s
|
||||
&& t == rhs.t
|
||||
&& u == rhs.u
|
||||
&& v == rhs.v
|
||||
&& s == rhs.s
|
||||
&& t == rhs.t
|
||||
&& u == rhs.u
|
||||
&& v == rhs.v
|
||||
&& std::abs( boost::math::float_distance(w, rhs.w)) < 2
|
||||
&& std::abs( boost::math::float_distance(x, rhs.x)) < 2
|
||||
;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_exception.cpp
|
||||
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Example of safe exception handling for pointer de-serialization
|
||||
//
|
||||
// This example was prepared by Robert Ramey to demonstrate and test
|
||||
//
|
||||
// This example was prepared by Robert Ramey to demonstrate and test
|
||||
// safe exception handling during the de-serialization of pointers in
|
||||
// a non-trivial example.
|
||||
//
|
||||
// Hopefully, this addresses exception issues raised by
|
||||
// Vahan Margaryan who spent considerable time and effort
|
||||
// in the analysis and testing of issues of exception safety
|
||||
// in the analysis and testing of issues of exception safety
|
||||
// of the serialization library.
|
||||
|
||||
#include <algorithm>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_fast_binary_archive.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -27,19 +27,19 @@
|
||||
using namespace boost::archive;
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// "Fast" output binary archive. This is a variation of the native binary
|
||||
// "Fast" output binary archive. This is a variation of the native binary
|
||||
class fast_binary_oarchive :
|
||||
// don't derive from binary_oarchive !!!
|
||||
public binary_oarchive_impl<
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>
|
||||
{
|
||||
typedef fast_binary_oarchive derived_t;
|
||||
typedef binary_oarchive_impl<
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
> base_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -48,15 +48,15 @@ public:
|
||||
friend class boost::archive::detail::interface_oarchive<derived_t>;
|
||||
friend class basic_binary_oarchive<derived_t>;
|
||||
friend class basic_binary_oprimitive<
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>;
|
||||
friend class boost::archive::save_access;
|
||||
#endif
|
||||
// add base class to the places considered when matching
|
||||
// save function to a specific set of arguments. Note, this didn't
|
||||
// work on my MSVC 7.0 system using
|
||||
// work on my MSVC 7.0 system using
|
||||
// binary_oarchive_impl<derived_t>::load_override;
|
||||
// so we use the sure-fire method below. This failed to work as well
|
||||
template<class T>
|
||||
@@ -95,19 +95,19 @@ public:
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(fast_binary_oarchive)
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// "Fast" input binary archive. This is a variation of the native binary
|
||||
// "Fast" input binary archive. This is a variation of the native binary
|
||||
class fast_binary_iarchive :
|
||||
// don't derive from binary_oarchive !!!
|
||||
public binary_iarchive_impl<
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>
|
||||
{
|
||||
typedef fast_binary_iarchive derived_t;
|
||||
typedef binary_iarchive_impl<
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
> base_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -116,15 +116,15 @@ public:
|
||||
friend class boost::archive::detail::interface_iarchive<derived_t>;
|
||||
friend class basic_binary_iarchive<derived_t>;
|
||||
friend class basic_binary_iprimitive<
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>;
|
||||
friend class boost::archive::load_access;
|
||||
#endif
|
||||
// add base class to the places considered when matching
|
||||
// save function to a specific set of arguments. Note, this didn't
|
||||
// work on my MSVC 7.0 system using
|
||||
// work on my MSVC 7.0 system using
|
||||
// binary_oarchive_impl<derived_t>::load_override;
|
||||
// so we use the sure-fire method below. This failed to work as well
|
||||
template<class T>
|
||||
@@ -166,7 +166,7 @@ int main( int argc, char* argv[] )
|
||||
int a1[3] = {4, 5, 6};
|
||||
|
||||
std::stringstream ss;
|
||||
{
|
||||
{
|
||||
fast_binary_oarchive pboa(ss);
|
||||
pboa << a;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class gps_position
|
||||
public:
|
||||
// every serializable class needs a constructor
|
||||
gps_position(){};
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
degrees(_d), minutes(_m), seconds(_s)
|
||||
{}
|
||||
};
|
||||
@@ -209,7 +209,7 @@ std::ostream & operator<<(std::ostream &os, const bus_route &br)
|
||||
//
|
||||
// Illustrates serialization of STL objects(pair) in a non-intrusive way.
|
||||
// See definition of operator<< <pair<F, S> >(ar, pair)
|
||||
//
|
||||
//
|
||||
// illustrates nesting of serializable classes
|
||||
//
|
||||
// illustrates use of version number to automatically grandfather older
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_pimpl.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_pimpl_A.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -31,15 +31,15 @@ template<class Archive>
|
||||
void A::serialize(Archive & ar, const unsigned int /* file_version */){
|
||||
ar & pimpl;
|
||||
}
|
||||
|
||||
|
||||
// without the explicit instantiations below, the program will
|
||||
// fail to link for lack of instantiantiation of the above function
|
||||
// note: the following failed to fix link errors for vc 7.0 !
|
||||
template void A::serialize<boost::archive::text_iarchive>(
|
||||
boost::archive::text_iarchive & ar,
|
||||
boost::archive::text_iarchive & ar,
|
||||
const unsigned int file_version
|
||||
);
|
||||
template void A::serialize<boost::archive::text_oarchive>(
|
||||
boost::archive::text_oarchive & ar,
|
||||
boost::archive::text_oarchive & ar,
|
||||
const unsigned int file_version
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_pimpl_A.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_polymorphic.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -29,7 +29,7 @@ int main(int argc, char* argv[])
|
||||
// instantiate archive which inhertis polymorphic interface
|
||||
// and the normal text archive implementation
|
||||
boost::archive::polymorphic_text_oarchive oa(ss);
|
||||
boost::archive::polymorphic_oarchive & oa_interface = oa;
|
||||
boost::archive::polymorphic_oarchive & oa_interface = oa;
|
||||
// we can just just the interface for saving
|
||||
oa_interface << a;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
// see above
|
||||
boost::archive::polymorphic_binary_iarchive ia(ss);
|
||||
boost::archive::polymorphic_iarchive & ia_interface = ia;
|
||||
boost::archive::polymorphic_iarchive & ia_interface = ia;
|
||||
// use just the polymorphic interface for loading.
|
||||
ia_interface >> a1;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_polymorphic_A.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -16,11 +16,11 @@
|
||||
// used by this demo.
|
||||
template
|
||||
void A::serialize<boost::archive::polymorphic_iarchive>(
|
||||
boost::archive::polymorphic_iarchive &,
|
||||
boost::archive::polymorphic_iarchive &,
|
||||
const unsigned int
|
||||
);
|
||||
template
|
||||
void A::serialize<boost::archive::polymorphic_oarchive>(
|
||||
boost::archive::polymorphic_oarchive &,
|
||||
boost::archive::polymorphic_oarchive &,
|
||||
const unsigned int
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_polymorphic_A.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -22,7 +22,7 @@ struct A {
|
||||
// class a contains a pointer to a "hidden" declaration
|
||||
template<class Archive>
|
||||
void serialize(
|
||||
Archive & ar,
|
||||
Archive & ar,
|
||||
const unsigned int file_version
|
||||
){
|
||||
ar & data;
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
c == rhs.c
|
||||
&& i == rhs.i
|
||||
&& i2 == rhs.i2
|
||||
&& ui == rhs.ui
|
||||
&& l == rhs.l
|
||||
&& ui == rhs.ui
|
||||
&& l == rhs.l
|
||||
&& ul == rhs.ul
|
||||
;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ int main( int /* argc */, char* /* argv */[] )
|
||||
A a1;
|
||||
|
||||
std::stringstream ss;
|
||||
{
|
||||
{
|
||||
portable_binary_oarchive pboa(ss);
|
||||
pboa << a;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ int main( int /* argc */, char* /* argv */[] )
|
||||
return 1;
|
||||
|
||||
ss.clear();
|
||||
{
|
||||
{
|
||||
portable_binary_oarchive pboa(ss, endian_big);
|
||||
pboa << a;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ int main( int /* argc */, char* /* argv */[] )
|
||||
return 1;
|
||||
|
||||
ss.clear();
|
||||
{
|
||||
{
|
||||
portable_binary_oarchive pboa(ss, endian_big);
|
||||
pboa << a;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "simple_log_archive.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make the schedule
|
||||
bus_schedule schedule;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
//////////////////////////////////////////////////////////
|
||||
// public interface used by programs that use the
|
||||
// serialization library
|
||||
typedef boost::mpl::bool_<true> is_saving;
|
||||
typedef boost::mpl::bool_<true> is_saving;
|
||||
typedef boost::mpl::bool_<false> is_loading;
|
||||
template<class T> void register_type(){}
|
||||
template<class T> trivial_oarchive & operator<<(const T & t){
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
#include "demo_gps.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make the schedule
|
||||
bus_schedule schedule;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
@@ -47,7 +47,7 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
|
||||
// display the complete schedule
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo.xml";
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class gps_position
|
||||
public:
|
||||
// every serializable class needs a constructor
|
||||
gps_position(){};
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
gps_position(int _d, int _m, float _s) :
|
||||
degrees(_d), minutes(_m), seconds(_s)
|
||||
{}
|
||||
};
|
||||
@@ -209,7 +209,7 @@ std::ostream & operator<<(std::ostream &os, const bus_route &br)
|
||||
//
|
||||
// Illustrates serialization of STL objects(pair) in a non-intrusive way.
|
||||
// See definition of operator<< <pair<F, S> >(ar, pair)
|
||||
//
|
||||
//
|
||||
// illustrates nesting of serializable classes
|
||||
//
|
||||
// illustrates use of version number to automatically grandfather older
|
||||
|
||||
@@ -28,7 +28,7 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make a new schedule
|
||||
bus_schedule new_schedule;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ void save_schedule(const bus_schedule &s, const char * filename){
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
// display the complete schedule
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ int main(int argc, char *argv[]){
|
||||
}
|
||||
std::filebuf fb;
|
||||
fb.open(
|
||||
argv[1],
|
||||
argv[1],
|
||||
std::ios_base::binary | std::ios_base::in | std::ios_base::out
|
||||
);
|
||||
if(!fb.is_open()){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// log_archive.cpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// log_archive.hpp
|
||||
|
||||
// (C) Copyright 2010 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2010 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -31,7 +31,7 @@ namespace boost {
|
||||
// of text output which is useful for getting a formatted display of
|
||||
// any serializable class. Intended to be useful as a debugging aid.
|
||||
class log_archive :
|
||||
/* protected ? */
|
||||
/* protected ? */
|
||||
public boost::archive::xml_oarchive_impl<log_archive>
|
||||
{
|
||||
typedef boost::archive::xml_oarchive_impl<log_archive> base;
|
||||
@@ -72,7 +72,7 @@ class log_archive :
|
||||
public:
|
||||
log_archive(std::ostream & os, unsigned int flags = 0) :
|
||||
boost::archive::xml_oarchive_impl<log_archive>(
|
||||
os,
|
||||
os,
|
||||
flags | boost::archive::no_header
|
||||
)
|
||||
{}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// polymorphic_portable_binary_iarchive.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -22,8 +22,8 @@ namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class binary_iarchive_impl<
|
||||
polymorphic_portable_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
polymorphic_portable_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>;
|
||||
template class detail::archive_pointer_iserializer<
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// polymorphic_portable_binary_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// polymorphic_portable_binary_oarchive.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -23,8 +23,8 @@ namespace archive {
|
||||
|
||||
// explicitly instantiate for this type of binary stream
|
||||
template class binary_oarchive_impl<
|
||||
polymorphic_portable_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
polymorphic_portable_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>;
|
||||
template class detail::archive_pointer_oserializer<
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// polymorphic_portable_binary_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef PORTABLE_BINARY_ARCHIVE_HPP
|
||||
#define PORTABLE_BINARY_ARCHIVE_HPP
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/archive/basic_archive.hpp>
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
|
||||
enum portable_binary_archive_flags {
|
||||
endian_big = 0x4000,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// portable_binary_iarchive.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,13 +11,13 @@
|
||||
#include <istream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
#include "portable_binary_iarchive.hpp"
|
||||
|
||||
void
|
||||
void
|
||||
portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
|
||||
char size;
|
||||
l = 0;
|
||||
@@ -37,18 +37,18 @@ portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
|
||||
);
|
||||
|
||||
char * cptr = reinterpret_cast<char *>(& l);
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
cptr += (sizeof(boost::intmax_t) - size);
|
||||
#endif
|
||||
this->primitive_base_t::load_binary(cptr, size);
|
||||
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
if(m_flags & endian_little)
|
||||
#else
|
||||
if(m_flags & endian_big)
|
||||
#endif
|
||||
reverse_bytes(size, cptr);
|
||||
|
||||
|
||||
if(negative)
|
||||
l = -l;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ portable_binary_iarchive::load_override(
|
||||
t.t[cn.size()] = '\0';
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
portable_binary_iarchive::init(unsigned int flags){
|
||||
if(0 == (flags & boost::archive::no_header)){
|
||||
// read signature in an archive version independent manner
|
||||
@@ -94,7 +94,7 @@ portable_binary_iarchive::init(unsigned int flags){
|
||||
boost::archive::archive_exception::unsupported_version
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
this->set_library_version(input_library_version);
|
||||
//#else
|
||||
@@ -123,7 +123,7 @@ namespace detail {
|
||||
|
||||
template class basic_binary_iprimitive<
|
||||
portable_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
> ;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// portable_binary_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -34,7 +34,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// exception to be thrown if integer read from archive doesn't fit
|
||||
// variable being loaded
|
||||
class portable_binary_iarchive_exception :
|
||||
class portable_binary_iarchive_exception :
|
||||
public boost::archive::archive_exception
|
||||
{
|
||||
public:
|
||||
@@ -62,13 +62,13 @@ public:
|
||||
};
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// "Portable" input binary archive. It addresses integer size and endienness so
|
||||
// "Portable" input binary archive. It addresses integer size and endienness so
|
||||
// that binary archives can be passed across systems. Note:floating point types
|
||||
// not addressed here
|
||||
class portable_binary_iarchive :
|
||||
public boost::archive::basic_binary_iprimitive<
|
||||
portable_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>,
|
||||
public boost::archive::detail::common_iarchive<
|
||||
@@ -77,7 +77,7 @@ class portable_binary_iarchive :
|
||||
{
|
||||
typedef boost::archive::basic_binary_iprimitive<
|
||||
portable_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
> primitive_base_t;
|
||||
typedef boost::archive::detail::common_iarchive<
|
||||
@@ -148,21 +148,21 @@ protected:
|
||||
void load(unsigned char & t){
|
||||
this->primitive_base_t::load(t);
|
||||
}
|
||||
typedef boost::archive::detail::common_iarchive<portable_binary_iarchive>
|
||||
typedef boost::archive::detail::common_iarchive<portable_binary_iarchive>
|
||||
detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
void load_override(boost::archive::class_name_type & t);
|
||||
// binary files don't include the optional information
|
||||
// binary files don't include the optional information
|
||||
void load_override(boost::archive::class_id_optional_type &){}
|
||||
|
||||
void init(unsigned int flags);
|
||||
public:
|
||||
portable_binary_iarchive(std::istream & is, unsigned flags = 0) :
|
||||
primitive_base_t(
|
||||
* is.rdbuf(),
|
||||
* is.rdbuf(),
|
||||
0 != (flags & boost::archive::no_codecvt)
|
||||
),
|
||||
archive_base_t(flags),
|
||||
@@ -173,13 +173,13 @@ public:
|
||||
|
||||
portable_binary_iarchive(
|
||||
std::basic_streambuf<
|
||||
std::istream::char_type,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
> & bsb,
|
||||
> & bsb,
|
||||
unsigned int flags
|
||||
) :
|
||||
primitive_base_t(
|
||||
bsb,
|
||||
bsb,
|
||||
0 != (flags & boost::archive::no_codecvt)
|
||||
),
|
||||
archive_base_t(flags),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// portable_binary_oarchive.cpp
|
||||
|
||||
// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -9,10 +9,10 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <ostream>
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
#include "portable_binary_oarchive.hpp"
|
||||
|
||||
void
|
||||
void
|
||||
portable_binary_oarchive::save_impl(
|
||||
const boost::intmax_t l,
|
||||
const char maxsize
|
||||
@@ -45,7 +45,7 @@ portable_binary_oarchive::save_impl(
|
||||
else
|
||||
ll = l;
|
||||
char * cptr = reinterpret_cast<char *>(& ll);
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
cptr += (sizeof(boost::intmax_t) - size);
|
||||
if(m_flags & endian_little)
|
||||
reverse_bytes(size, cptr);
|
||||
@@ -56,7 +56,7 @@ portable_binary_oarchive::save_impl(
|
||||
this->primitive_base_t::save_binary(cptr, size);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
portable_binary_oarchive::init(unsigned int flags) {
|
||||
if(m_flags == (endian_big | endian_little)){
|
||||
boost::serialization::throw_exception(
|
||||
@@ -90,7 +90,7 @@ namespace detail {
|
||||
|
||||
template class basic_binary_oprimitive<
|
||||
portable_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
> ;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// portable_binary_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -33,12 +33,12 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// exception to be thrown if integer read from archive doesn't fit
|
||||
// variable being loaded
|
||||
class portable_binary_oarchive_exception :
|
||||
class portable_binary_oarchive_exception :
|
||||
public boost::archive::archive_exception
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
invalid_flags
|
||||
invalid_flags
|
||||
} exception_code;
|
||||
portable_binary_oarchive_exception(exception_code c = invalid_flags )
|
||||
{}
|
||||
@@ -56,14 +56,14 @@ public:
|
||||
};
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// "Portable" output binary archive. This is a variation of the native binary
|
||||
// "Portable" output binary archive. This is a variation of the native binary
|
||||
// archive. it addresses integer size and endienness so that binary archives can
|
||||
// be passed across systems. Note:floating point types not addressed here
|
||||
|
||||
class portable_binary_oarchive :
|
||||
public boost::archive::basic_binary_oprimitive<
|
||||
portable_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>,
|
||||
public boost::archive::detail::common_oarchive<
|
||||
@@ -72,7 +72,7 @@ class portable_binary_oarchive :
|
||||
{
|
||||
typedef boost::archive::basic_binary_oprimitive<
|
||||
portable_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
> primitive_base_t;
|
||||
typedef boost::archive::detail::common_oarchive<
|
||||
@@ -128,7 +128,7 @@ protected:
|
||||
|
||||
// default processing - kick back to base class. Note the
|
||||
// extra stuff to get it passed borland compilers
|
||||
typedef boost::archive::detail::common_oarchive<portable_binary_oarchive>
|
||||
typedef boost::archive::detail::common_oarchive<portable_binary_oarchive>
|
||||
detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(T & t){
|
||||
@@ -139,7 +139,7 @@ protected:
|
||||
const std::string s(t);
|
||||
* this << s;
|
||||
}
|
||||
// binary files don't include the optional information
|
||||
// binary files don't include the optional information
|
||||
void save_override(
|
||||
const boost::archive::class_id_optional_type & /* t */
|
||||
){}
|
||||
@@ -159,13 +159,13 @@ public:
|
||||
|
||||
portable_binary_oarchive(
|
||||
std::basic_streambuf<
|
||||
std::ostream::char_type,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
> & bsb,
|
||||
> & bsb,
|
||||
unsigned int flags
|
||||
) :
|
||||
primitive_base_t(
|
||||
bsb,
|
||||
bsb,
|
||||
0 != (flags & boost::archive::no_codecvt)
|
||||
),
|
||||
archive_base_t(flags),
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// simple_log_archive.hpp
|
||||
|
||||
// (C) Copyright 2010 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2010 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
@@ -65,15 +65,15 @@ class simple_log_archive {
|
||||
// make sure call is routed through the highest interface that might
|
||||
// be specialized by the user.
|
||||
boost::serialization::serialize_adl(
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
::boost::serialization::version< T >::value
|
||||
);
|
||||
}
|
||||
};
|
||||
template<class T>
|
||||
void save(const T &t){
|
||||
typedef
|
||||
typedef
|
||||
BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<boost::is_enum< T >,
|
||||
boost::mpl::identity<save_enum_type<simple_log_archive> >,
|
||||
//else
|
||||
@@ -88,7 +88,7 @@ class simple_log_archive {
|
||||
boost::mpl::identity<save_only<simple_log_archive> >
|
||||
> >::type typex;
|
||||
typex::invoke(*this, t);
|
||||
}
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
void save(const std::wstring &ws){
|
||||
m_os << "wide string types not suported in log archive";
|
||||
@@ -110,12 +110,12 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
save_binary(const void *address, std::size_t count){
|
||||
m_os << "save_binary not implemented";
|
||||
}
|
||||
|
||||
// the << operators
|
||||
// the << operators
|
||||
template<class T>
|
||||
simple_log_archive & operator<<(T const & t){
|
||||
m_os << ' ';
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
return * this;
|
||||
}
|
||||
|
||||
// the & operator
|
||||
// the & operator
|
||||
template<class T>
|
||||
simple_log_archive & operator&(const T & t){
|
||||
return * this << t;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// archive/archive_exception.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -20,16 +20,16 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <string>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
|
||||
// note: the only reason this is in here is that windows header
|
||||
// includes #define exception_code _exception_code (arrrgghhhh!).
|
||||
// the most expedient way to address this is be sure that this
|
||||
// header is always included whenever this header file is included.
|
||||
#if defined(BOOST_WINDOWS)
|
||||
#include <excpt.h>
|
||||
#endif
|
||||
#if defined(BOOST_WINDOWS)
|
||||
#include <excpt.h>
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace archive {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// exceptions thrown by archives
|
||||
//
|
||||
class BOOST_SYMBOL_VISIBLE archive_exception :
|
||||
class BOOST_SYMBOL_VISIBLE archive_exception :
|
||||
public virtual std::exception
|
||||
{
|
||||
private:
|
||||
@@ -52,7 +52,7 @@ protected:
|
||||
public:
|
||||
typedef enum {
|
||||
no_exception, // initialized without code
|
||||
other_exception, // any excepton not listed below
|
||||
other_exception, // any exception not listed below
|
||||
unregistered_class, // attempt to serialize a pointer of
|
||||
// an unregistered class
|
||||
invalid_signature, // first line of archive does not contain
|
||||
@@ -61,9 +61,9 @@ public:
|
||||
// subsequent to this one
|
||||
pointer_conflict, // an attempt has been made to directly
|
||||
// serialize an object which has
|
||||
// already been serialized through a pointer.
|
||||
// Were this permitted, the archive load would result
|
||||
// in the creation of an extra copy of the obect.
|
||||
// already been serialized through a pointer.
|
||||
// Were this permitted, the archive load would result
|
||||
// in the creation of an extra copy of the object.
|
||||
incompatible_native_format, // attempt to read native binary format
|
||||
// on incompatible platform
|
||||
array_size_too_short,// array being loaded doesn't fit in array allocated
|
||||
@@ -71,9 +71,9 @@ public:
|
||||
invalid_class_name, // class name greater than the maximum permitted.
|
||||
// most likely a corrupted archive or an attempt
|
||||
// to insert virus via buffer overrun method.
|
||||
unregistered_cast, // base - derived relationship not registered with
|
||||
unregistered_cast, // base - derived relationship not registered with
|
||||
// void_cast_register
|
||||
unsupported_class_version, // type saved with a version # greater than the
|
||||
unsupported_class_version, // type saved with a version # greater than the
|
||||
// one used by the program. This indicates that the program
|
||||
// needs to be rebuilt.
|
||||
multiple_code_instantiation, // code for implementing serialization for some
|
||||
@@ -83,13 +83,13 @@ public:
|
||||
exception_code code;
|
||||
|
||||
BOOST_ARCHIVE_DECL archive_exception(
|
||||
exception_code c,
|
||||
exception_code c,
|
||||
const char * e1 = NULL,
|
||||
const char * e2 = NULL
|
||||
) BOOST_NOEXCEPT;
|
||||
BOOST_ARCHIVE_DECL archive_exception(archive_exception const &) BOOST_NOEXCEPT ;
|
||||
virtual BOOST_ARCHIVE_DECL ~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ;
|
||||
virtual BOOST_ARCHIVE_DECL const char * what() const BOOST_NOEXCEPT_OR_NOTHROW ;
|
||||
BOOST_ARCHIVE_DECL archive_exception(archive_exception const &) BOOST_NOEXCEPT;
|
||||
BOOST_ARCHIVE_DECL ~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE;
|
||||
BOOST_ARCHIVE_DECL const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE;
|
||||
};
|
||||
|
||||
}// namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_archive.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -18,9 +18,9 @@
|
||||
#include <cstring> // count
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp> // size_t
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/serialization/library_version_type.hpp>
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
@@ -33,76 +33,43 @@ namespace archive {
|
||||
#pragma warning( disable : 4244 4267 )
|
||||
#endif
|
||||
|
||||
/* NOTE : Warning : Warning : Warning : Warning : Warning
|
||||
* Don't ever changes this. If you do, they previously created
|
||||
* binary archives won't be readable !!!
|
||||
*/
|
||||
class library_version_type {
|
||||
private:
|
||||
typedef uint_least16_t base_type;
|
||||
base_type t;
|
||||
public:
|
||||
library_version_type(): t(0) {};
|
||||
explicit library_version_type(const unsigned int & t_) : t(t_){
|
||||
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
|
||||
}
|
||||
library_version_type(const library_version_type & t_) :
|
||||
t(t_.t)
|
||||
{}
|
||||
library_version_type & operator=(const library_version_type & rhs){
|
||||
t = rhs.t;
|
||||
return *this;
|
||||
}
|
||||
// used for text output
|
||||
operator base_type () const {
|
||||
return t;
|
||||
}
|
||||
// used for text input
|
||||
operator base_type & (){
|
||||
return t;
|
||||
}
|
||||
bool operator==(const library_version_type & rhs) const {
|
||||
return t == rhs.t;
|
||||
}
|
||||
bool operator<(const library_version_type & rhs) const {
|
||||
return t < rhs.t;
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_ARCHIVE_DECL library_version_type
|
||||
BOOST_ARCHIVE_DECL boost::serialization::library_version_type
|
||||
BOOST_ARCHIVE_VERSION();
|
||||
|
||||
// create alias in boost::archive for older user code.
|
||||
typedef boost::serialization::library_version_type library_version_type;
|
||||
|
||||
class version_type {
|
||||
private:
|
||||
typedef uint_least32_t base_type;
|
||||
base_type t;
|
||||
public:
|
||||
// should be private - but MPI fails if it's not!!!
|
||||
version_type(): t(0) {};
|
||||
version_type(): t(0) {}
|
||||
explicit version_type(const unsigned int & t_) : t(t_){
|
||||
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
|
||||
}
|
||||
version_type(const version_type & t_) :
|
||||
version_type(const version_type & t_) :
|
||||
t(t_.t)
|
||||
{}
|
||||
version_type & operator=(const version_type & rhs){
|
||||
t = rhs.t;
|
||||
t = rhs.t;
|
||||
return *this;
|
||||
}
|
||||
// used for text output
|
||||
operator base_type () const {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
// used for text intput
|
||||
operator base_type & (){
|
||||
return t;
|
||||
}
|
||||
}
|
||||
bool operator==(const version_type & rhs) const {
|
||||
return t == rhs.t;
|
||||
}
|
||||
}
|
||||
bool operator<(const version_type & rhs) const {
|
||||
return t < rhs.t;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class class_id_type {
|
||||
@@ -111,70 +78,73 @@ private:
|
||||
base_type t;
|
||||
public:
|
||||
// should be private - but then can't use BOOST_STRONG_TYPE below
|
||||
class_id_type() : t(0) {};
|
||||
class_id_type() : t(0) {}
|
||||
explicit class_id_type(const int t_) : t(t_){
|
||||
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
|
||||
}
|
||||
explicit class_id_type(const std::size_t t_) : t(t_){
|
||||
// BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
|
||||
}
|
||||
class_id_type(const class_id_type & t_) :
|
||||
class_id_type(const class_id_type & t_) :
|
||||
t(t_.t)
|
||||
{}
|
||||
class_id_type & operator=(const class_id_type & rhs){
|
||||
t = rhs.t;
|
||||
t = rhs.t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// used for text output
|
||||
operator base_type () const {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
// used for text input
|
||||
operator base_type &() {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
bool operator==(const class_id_type & rhs) const {
|
||||
return t == rhs.t;
|
||||
}
|
||||
}
|
||||
bool operator<(const class_id_type & rhs) const {
|
||||
return t < rhs.t;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#define NULL_POINTER_TAG boost::archive::class_id_type(-1)
|
||||
#define BOOST_SERIALIZATION_NULL_POINTER_TAG boost::archive::class_id_type(-1)
|
||||
|
||||
class object_id_type {
|
||||
private:
|
||||
typedef uint_least32_t base_type;
|
||||
base_type t;
|
||||
public:
|
||||
object_id_type(): t(0) {};
|
||||
object_id_type(): t(0) {}
|
||||
// note: presumes that size_t >= unsigned int.
|
||||
explicit object_id_type(const std::size_t & t_) : t(t_){
|
||||
// use explicit cast to silence useless warning
|
||||
explicit object_id_type(const std::size_t & t_) : t(static_cast<base_type>(t_)){
|
||||
// make quadruple sure that we haven't lost any real integer
|
||||
// precision
|
||||
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
|
||||
}
|
||||
object_id_type(const object_id_type & t_) :
|
||||
object_id_type(const object_id_type & t_) :
|
||||
t(t_.t)
|
||||
{}
|
||||
object_id_type & operator=(const object_id_type & rhs){
|
||||
t = rhs.t;
|
||||
t = rhs.t;
|
||||
return *this;
|
||||
}
|
||||
// used for text output
|
||||
operator base_type () const {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
// used for text input
|
||||
operator base_type & () {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
bool operator==(const object_id_type & rhs) const {
|
||||
return t == rhs.t;
|
||||
}
|
||||
}
|
||||
bool operator<(const object_id_type & rhs) const {
|
||||
return t < rhs.t;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
@@ -185,16 +155,16 @@ struct tracking_type {
|
||||
bool t;
|
||||
explicit tracking_type(const bool t_ = false)
|
||||
: t(t_)
|
||||
{};
|
||||
{}
|
||||
tracking_type(const tracking_type & t_)
|
||||
: t(t_.t)
|
||||
{}
|
||||
operator bool () const {
|
||||
return t;
|
||||
};
|
||||
}
|
||||
operator bool & () {
|
||||
return t;
|
||||
};
|
||||
}
|
||||
tracking_type & operator=(const bool t_){
|
||||
t = t_;
|
||||
return *this;
|
||||
@@ -211,8 +181,8 @@ struct tracking_type {
|
||||
}
|
||||
};
|
||||
|
||||
struct class_name_type :
|
||||
private boost::noncopyable
|
||||
struct class_name_type :
|
||||
private boost::noncopyable
|
||||
{
|
||||
char *t;
|
||||
operator const char * & () const {
|
||||
@@ -224,9 +194,9 @@ struct class_name_type :
|
||||
std::size_t size() const {
|
||||
return std::strlen(t);
|
||||
}
|
||||
explicit class_name_type(const char *key_)
|
||||
explicit class_name_type(const char *key_)
|
||||
: t(const_cast<char *>(key_)){}
|
||||
explicit class_name_type(char *key_)
|
||||
explicit class_name_type(char *key_)
|
||||
: t(key_){}
|
||||
class_name_type & operator=(const class_name_type & rhs){
|
||||
t = rhs.t;
|
||||
@@ -246,7 +216,7 @@ BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_SIGNATURE();
|
||||
|
||||
/* NOTE : Warning : Warning : Warning : Warning : Warning
|
||||
* If any of these are changed to different sized types,
|
||||
* If any of these are changed to different sized types,
|
||||
* binary_iarchive won't be able to read older archives
|
||||
* unless you rev the library version and include conditional
|
||||
* code based on the library version. There is nothing
|
||||
@@ -276,7 +246,7 @@ BOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type)
|
||||
// set implementation level to primitive for all types
|
||||
// used internally by the serialization library
|
||||
|
||||
BOOST_CLASS_IMPLEMENTATION(boost::archive::library_version_type, primitive_type)
|
||||
BOOST_CLASS_IMPLEMENTATION(boost::serialization::library_version_type, primitive_type)
|
||||
BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type)
|
||||
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type)
|
||||
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type)
|
||||
@@ -288,10 +258,10 @@ BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
|
||||
|
||||
#include <boost/serialization/is_bitwise_serializable.hpp>
|
||||
|
||||
// set types used internally by the serialization library
|
||||
// set types used internally by the serialization library
|
||||
// to be bitwise serializable
|
||||
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(boost::serialization::library_version_type)
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
|
||||
// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/serialization/library_version_type.hpp>
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
|
||||
@@ -40,7 +41,7 @@
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace detail {
|
||||
@@ -50,7 +51,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_binary_iarchive - read serialized objects from a input binary stream
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -66,7 +67,7 @@ protected:
|
||||
#endif
|
||||
#endif
|
||||
// intermediate level to support override of operators
|
||||
// fot templates in the absence of partial function
|
||||
// fot templates in the absence of partial function
|
||||
// template ordering. If we get here pass to base class
|
||||
// note extra nonsense to sneak it pass the borland compiers
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
@@ -84,12 +85,12 @@ protected:
|
||||
BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
|
||||
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
|
||||
|
||||
// binary files don't include the optional information
|
||||
// binary files don't include the optional information
|
||||
void load_override(class_id_optional_type & /* t */){}
|
||||
|
||||
void load_override(tracking_type & t, int /*version*/){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
boost::serialization::library_version_type lv = this->get_library_version();
|
||||
if(boost::serialization::library_version_type(6) < lv){
|
||||
int_least8_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::tracking_type(x);
|
||||
@@ -101,18 +102,30 @@ protected:
|
||||
}
|
||||
}
|
||||
void load_override(class_id_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
boost::serialization::library_version_type lv = this->get_library_version();
|
||||
/*
|
||||
* library versions:
|
||||
* boost 1.39 -> 5
|
||||
* boost 1.43 -> 7
|
||||
* boost 1.47 -> 9
|
||||
*
|
||||
*
|
||||
* 1) in boost 1.43 and inferior, class_id_type is always a 16bit value, with no check on the library version
|
||||
* --> this means all archives with version v <= 7 are written with a 16bit class_id_type
|
||||
* 2) in boost 1.44 this load_override has disappeared (and thus boost 1.44 is not backward compatible at all !!)
|
||||
* 3) recent boosts reintroduced load_override with a test on the version :
|
||||
* - v > 7 : this->detail_common_iarchive::load_override(t, version)
|
||||
* - v > 6 : 16bit
|
||||
* - other : 32bit
|
||||
* --> which is obviously incorrect, see point 1
|
||||
*
|
||||
* the fix here decodes class_id_type on 16bit for all v <= 7, which seems to be the correct behaviour ...
|
||||
*/
|
||||
if(boost::serialization::library_version_type (7) < lv){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
int_least16_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::class_id_type(x);
|
||||
}
|
||||
else{
|
||||
int x=0;
|
||||
int_least16_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::class_id_type(x);
|
||||
}
|
||||
@@ -122,24 +135,24 @@ protected:
|
||||
}
|
||||
|
||||
void load_override(version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
boost::serialization::library_version_type lv = this->get_library_version();
|
||||
if(boost::serialization::library_version_type(7) < lv){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lv){
|
||||
uint_least8_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::version_type(x);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(5) < lvt){
|
||||
if(boost::serialization::library_version_type(5) < lv){
|
||||
uint_least16_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::version_type(x);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(2) < lvt){
|
||||
if(boost::serialization::library_version_type(2) < lv){
|
||||
// upto 255 versions
|
||||
unsigned char x=0;
|
||||
* this->This() >> x;
|
||||
@@ -153,13 +166,13 @@ protected:
|
||||
}
|
||||
|
||||
void load_override(boost::serialization::item_version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
// if(boost::archive::library_version_type(7) < lvt){
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
boost::serialization::library_version_type lv = this->get_library_version();
|
||||
// if(boost::serialization::library_version_type(7) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lv){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lv){
|
||||
uint_least16_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::serialization::item_version_type(x);
|
||||
@@ -172,21 +185,21 @@ protected:
|
||||
}
|
||||
|
||||
void load_override(serialization::collection_size_type & t){
|
||||
if(boost::archive::library_version_type(5) < this->get_library_version()){
|
||||
if(boost::serialization::library_version_type(5) < this->get_library_version()){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else{
|
||||
unsigned int x=0;
|
||||
* this->This() >> x;
|
||||
t = serialization::collection_size_type(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
|
||||
basic_binary_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags)
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
|
||||
// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::memcpy;
|
||||
namespace std{
|
||||
using ::memcpy;
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
@@ -48,7 +48,6 @@ namespace std{
|
||||
#include <boost/integer.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
|
||||
//#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/serialization/is_bitwise_serializable.hpp>
|
||||
#include <boost/serialization/array_wrapper.hpp>
|
||||
|
||||
@@ -58,7 +57,7 @@ namespace std{
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -98,8 +97,8 @@ public:
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// fundamental types that need special treatment
|
||||
|
||||
// trap usage of invalid uninitialized boolean
|
||||
|
||||
// trap usage of invalid uninitialized boolean
|
||||
void load(bool & t){
|
||||
load_binary(& t, sizeof(t));
|
||||
int i = t;
|
||||
@@ -119,29 +118,29 @@ public:
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_iprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_binary_iprimitive();
|
||||
public:
|
||||
// we provide an optimized load for all fundamental types
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// use_array_optimization;
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
|
||||
};
|
||||
#else
|
||||
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
|
||||
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
|
||||
#endif
|
||||
};
|
||||
|
||||
// the optimized load_array dispatches to load_binary
|
||||
// the optimized load_array dispatches to load_binary
|
||||
template <class ValueType>
|
||||
void load_array(serialization::array_wrapper<ValueType>& a, unsigned int)
|
||||
{
|
||||
@@ -155,17 +154,17 @@ public:
|
||||
template<class Archive, class Elem, class Tr>
|
||||
inline void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::load_binary(
|
||||
void *address,
|
||||
void *address,
|
||||
std::size_t count
|
||||
){
|
||||
// note: an optimizer should eliminate the following for char files
|
||||
BOOST_ASSERT(
|
||||
static_cast<std::streamsize>(count / sizeof(Elem))
|
||||
static_cast<std::streamsize>(count / sizeof(Elem))
|
||||
<= boost::integer_traits<std::streamsize>::const_max
|
||||
);
|
||||
std::streamsize s = static_cast<std::streamsize>(count / sizeof(Elem));
|
||||
std::streamsize scount = m_sb.sgetn(
|
||||
static_cast<Elem *>(address),
|
||||
static_cast<Elem *>(address),
|
||||
s
|
||||
);
|
||||
if(scount != s)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_binary_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -58,7 +58,7 @@ namespace detail {
|
||||
// does have the virtue of buiding the smalles archive in the minimum amount
|
||||
// of time. So under some circumstances it may be he right choice.
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -90,18 +90,18 @@ protected:
|
||||
BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
|
||||
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
|
||||
|
||||
// binary files don't include the optional information
|
||||
// binary files don't include the optional information
|
||||
void save_override(const class_id_optional_type & /* t */){}
|
||||
|
||||
// enable this if we decide to support generation of previous versions
|
||||
#if 0
|
||||
void save_override(const boost::archive::version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
if(boost::serialization::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lvt){
|
||||
const boost::uint_least16_t x = t;
|
||||
* this->This() << x;
|
||||
}
|
||||
@@ -112,11 +112,11 @@ protected:
|
||||
}
|
||||
void save_override(const boost::serialization::item_version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
if(boost::serialization::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lvt){
|
||||
const boost::uint_least16_t x = t;
|
||||
* this->This() << x;
|
||||
}
|
||||
@@ -128,11 +128,11 @@ protected:
|
||||
|
||||
void save_override(class_id_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
if(boost::serialization::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
if(boost::serialization::library_version_type(6) < lvt){
|
||||
const boost::int_least16_t x = t;
|
||||
* this->This() << x;
|
||||
}
|
||||
@@ -155,11 +155,11 @@ protected:
|
||||
|
||||
#if 0
|
||||
void save_override(const serialization::collection_size_type & t){
|
||||
if (get_library_version() < boost::archive::library_version_type(6)){
|
||||
if (get_library_version() < boost::serialization::library_version_type(6)){
|
||||
unsigned int x=0;
|
||||
* this->This() >> x;
|
||||
t = serialization::collection_size_type(x);
|
||||
}
|
||||
}
|
||||
else{
|
||||
* this->This() >> t;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_binary_oprimitive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace std{
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
|
||||
//#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/serialization/is_bitwise_serializable.hpp>
|
||||
#include <boost/serialization/array_wrapper.hpp>
|
||||
|
||||
@@ -93,7 +92,7 @@ public:
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// fundamental types that need special treatment
|
||||
|
||||
|
||||
// trap usage of invalid uninitialized boolean which would
|
||||
// otherwise crash on load.
|
||||
void save(const bool t){
|
||||
@@ -113,32 +112,32 @@ public:
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_oprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_binary_oprimitive();
|
||||
public:
|
||||
|
||||
// we provide an optimized save for all fundamental types
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// use_array_optimization;
|
||||
// workaround without using mpl lambdas
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
|
||||
};
|
||||
#else
|
||||
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
|
||||
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
|
||||
#endif
|
||||
};
|
||||
|
||||
// the optimized save_array dispatches to save_binary
|
||||
// the optimized save_array dispatches to save_binary
|
||||
template <class ValueType>
|
||||
void save_array(boost::serialization::array_wrapper<ValueType> const& a, unsigned int)
|
||||
{
|
||||
@@ -149,9 +148,9 @@ public:
|
||||
};
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
inline void
|
||||
inline void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
|
||||
const void *address,
|
||||
const void *address,
|
||||
std::size_t count
|
||||
){
|
||||
// BOOST_ASSERT(count <= std::size_t(boost::integer_traits<std::streamsize>::const_max));
|
||||
@@ -166,7 +165,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
|
||||
// figure number of elements to output - round up
|
||||
count = ( count + sizeof(Elem) - 1) / sizeof(Elem);
|
||||
std::streamsize scount = m_sb.sputn(
|
||||
static_cast<const Elem *>(address),
|
||||
static_cast<const Elem *>(address),
|
||||
static_cast<std::streamsize>(count)
|
||||
);
|
||||
if(count != static_cast<std::size_t>(scount))
|
||||
@@ -174,14 +173,14 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
|
||||
archive_exception(archive_exception::output_stream_error)
|
||||
);
|
||||
//os.write(
|
||||
// static_cast<const typename OStream::char_type *>(address),
|
||||
// static_cast<const typename OStream::char_type *>(address),
|
||||
// count
|
||||
//);
|
||||
//BOOST_ASSERT(os.good());
|
||||
}
|
||||
|
||||
} //namespace boost
|
||||
} //namespace archive
|
||||
} //namespace boost
|
||||
} //namespace archive
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_text_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -46,7 +46,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_iarchive - read serialized objects from a input text stream
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
#else
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// for some inexplicable reason insertion of "class" generates compile error
|
||||
// on msvc 7.1
|
||||
friend detail::interface_iarchive<Archive>;
|
||||
#else
|
||||
@@ -62,26 +62,26 @@ protected:
|
||||
#endif
|
||||
#endif
|
||||
// intermediate level to support override of operators
|
||||
// fot templates in the absence of partial function
|
||||
// fot templates in the absence of partial function
|
||||
// template ordering
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
// text file don't include the optional information
|
||||
// text file don't include the optional information
|
||||
void load_override(class_id_optional_type & /*t*/){}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init(void);
|
||||
init();
|
||||
|
||||
basic_text_iarchive(unsigned int flags) :
|
||||
basic_text_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags)
|
||||
{}
|
||||
~basic_text_iarchive(){}
|
||||
~basic_text_iarchive() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_text_iprimitive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
#if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT)
|
||||
using ::locale;
|
||||
#endif
|
||||
@@ -121,9 +121,9 @@ protected:
|
||||
t = i;
|
||||
}
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_iprimitive(IStream &is, bool no_codecvt);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_text_iprimitive();
|
||||
public:
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_text_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -44,9 +44,9 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_oarchive
|
||||
// class basic_text_oarchive
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -89,7 +89,7 @@ protected:
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
|
||||
// text file don't include the optional information
|
||||
// text file don't include the optional information
|
||||
void save_override(const class_id_optional_type & /* t */){}
|
||||
|
||||
void save_override(const class_name_type & t){
|
||||
@@ -104,7 +104,7 @@ protected:
|
||||
detail::common_oarchive<Archive>(flags),
|
||||
delimiter(none)
|
||||
{}
|
||||
~basic_text_oarchive(){}
|
||||
~basic_text_oarchive() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_text_oprimitive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
#if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT)
|
||||
using ::locale;
|
||||
@@ -142,22 +142,23 @@ protected:
|
||||
|
||||
template<class T>
|
||||
struct is_float {
|
||||
typedef typename mpl::bool_<
|
||||
boost::is_floating_point<T>::value
|
||||
typedef typename mpl::bool_<
|
||||
boost::is_floating_point<T>::value
|
||||
|| (std::numeric_limits<T>::is_specialized
|
||||
&& !std::numeric_limits<T>::is_integer
|
||||
&& !std::numeric_limits<T>::is_exact
|
||||
&& std::numeric_limits<T>::max_exponent)
|
||||
&& std::numeric_limits<T>::max_exponent)
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
void save_impl(const T &t, boost::mpl::bool_<true> &){
|
||||
// must be a user mistake - can't serialize un-initialized data
|
||||
if(os.fail())
|
||||
if(os.fail()){
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::output_stream_error)
|
||||
);
|
||||
}
|
||||
// The formulae for the number of decimla digits required is given in
|
||||
// http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf
|
||||
// which is derived from Kahan's paper:
|
||||
@@ -181,7 +182,7 @@ protected:
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_oprimitive(OStream & os, bool no_codecvt);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_text_oprimitive();
|
||||
public:
|
||||
// unformatted append of one character
|
||||
@@ -197,12 +198,12 @@ public:
|
||||
while('\0' != *s)
|
||||
os.put(*s++);
|
||||
}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_binary(const void *address, std::size_t count);
|
||||
};
|
||||
|
||||
} //namespace boost
|
||||
} //namespace archive
|
||||
} //namespace boost
|
||||
} //namespace archive
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_xml_archive.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -21,40 +21,40 @@
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// constant strings used in xml i/o
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_OBJECT_ID();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_OBJECT_REFERENCE();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_ID();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_NAME();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_TRACKING();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_VERSION();
|
||||
|
||||
extern
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_SIGNATURE();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ protected:
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_iarchive(unsigned int flags);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_xml_iarchive();
|
||||
~basic_xml_iarchive() BOOST_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -123,7 +123,7 @@ protected:
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_oarchive(unsigned int flags);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_xml_oarchive();
|
||||
~basic_xml_oarchive() BOOST_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -33,8 +33,8 @@ namespace archive {
|
||||
// preserve correct static polymorphism.
|
||||
class BOOST_SYMBOL_VISIBLE binary_iarchive :
|
||||
public binary_iarchive_impl<
|
||||
boost::archive::binary_iarchive,
|
||||
std::istream::char_type,
|
||||
boost::archive::binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>{
|
||||
public:
|
||||
@@ -42,12 +42,16 @@ public:
|
||||
binary_iarchive_impl<
|
||||
binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
>(is, flags)
|
||||
{}
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
>(bsb, flags)
|
||||
{}
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_iarchive_impl.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -25,7 +25,7 @@
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace detail {
|
||||
@@ -33,7 +33,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
class BOOST_SYMBOL_VISIBLE binary_iarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE binary_iarchive_impl :
|
||||
public basic_binary_iprimitive<Archive, Elem, Tr>,
|
||||
public basic_binary_iarchive<Archive>
|
||||
{
|
||||
@@ -70,29 +70,25 @@ protected:
|
||||
#endif
|
||||
}
|
||||
binary_iarchive_impl(
|
||||
std::basic_streambuf<Elem, Tr> & bsb,
|
||||
std::basic_streambuf<Elem, Tr> & bsb,
|
||||
unsigned int flags
|
||||
) :
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>(
|
||||
bsb,
|
||||
bsb,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_iarchive<Archive>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
{}
|
||||
binary_iarchive_impl(
|
||||
std::basic_istream<Elem, Tr> & is,
|
||||
std::basic_istream<Elem, Tr> & is,
|
||||
unsigned int flags
|
||||
) :
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>(
|
||||
* is.rdbuf(),
|
||||
* is.rdbuf(),
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_iarchive<Archive>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -26,13 +26,13 @@
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class BOOST_SYMBOL_VISIBLE binary_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE binary_oarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
>
|
||||
@@ -42,12 +42,16 @@ public:
|
||||
binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
>(os, flags)
|
||||
{}
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
>(bsb, flags)
|
||||
{}
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_oarchive_impl.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -26,7 +26,7 @@
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace detail {
|
||||
@@ -34,7 +34,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
class BOOST_SYMBOL_VISIBLE binary_oarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE binary_oarchive_impl :
|
||||
public basic_binary_oprimitive<Archive, Elem, Tr>,
|
||||
public basic_binary_oarchive<Archive>
|
||||
{
|
||||
@@ -71,29 +71,25 @@ protected:
|
||||
#endif
|
||||
}
|
||||
binary_oarchive_impl(
|
||||
std::basic_streambuf<Elem, Tr> & bsb,
|
||||
std::basic_streambuf<Elem, Tr> & bsb,
|
||||
unsigned int flags
|
||||
) :
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>(
|
||||
bsb,
|
||||
bsb,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_oarchive<Archive>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
{}
|
||||
binary_oarchive_impl(
|
||||
std::basic_ostream<Elem, Tr> & os,
|
||||
std::basic_ostream<Elem, Tr> & os,
|
||||
unsigned int flags
|
||||
) :
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>(
|
||||
* os.rdbuf(),
|
||||
* os.rdbuf(),
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_oarchive<Archive>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_wiarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -25,10 +25,10 @@
|
||||
#include <boost/archive/binary_iarchive_impl.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class binary_wiarchive :
|
||||
class binary_wiarchive :
|
||||
public binary_iarchive_impl<
|
||||
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
|
||||
>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// binary_woarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -25,13 +25,13 @@
|
||||
#include <boost/archive/binary_oarchive_impl.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class binary_woarchive :
|
||||
class binary_woarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
|
||||
>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/force_include.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
//#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std {
|
||||
@@ -52,21 +52,21 @@ class codecvt_null;
|
||||
template<>
|
||||
class codecvt_null<char> : public std::codecvt<char, char, std::mbstate_t>
|
||||
{
|
||||
virtual bool do_always_noconv() const throw() {
|
||||
bool do_always_noconv() const throw() BOOST_OVERRIDE {
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
explicit codecvt_null(std::size_t no_locale_manage = 0) :
|
||||
std::codecvt<char, char, std::mbstate_t>(no_locale_manage)
|
||||
{}
|
||||
virtual ~codecvt_null(){};
|
||||
~codecvt_null() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
template<>
|
||||
class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> :
|
||||
public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||
{
|
||||
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
|
||||
BOOST_SYMBOL_EXPORT std::codecvt_base::result
|
||||
do_out(
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * first1,
|
||||
@@ -75,8 +75,9 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> :
|
||||
char * first2,
|
||||
char * last2,
|
||||
char * & next2
|
||||
) const;
|
||||
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
|
||||
) const BOOST_OVERRIDE;
|
||||
|
||||
BOOST_SYMBOL_EXPORT std::codecvt_base::result
|
||||
do_in(
|
||||
std::mbstate_t & state,
|
||||
const char * first1,
|
||||
@@ -85,18 +86,23 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> :
|
||||
wchar_t * first2,
|
||||
wchar_t * last2,
|
||||
wchar_t * & next2
|
||||
) const;
|
||||
virtual int do_encoding( ) const throw( ){
|
||||
) const BOOST_OVERRIDE;
|
||||
|
||||
BOOST_SYMBOL_EXPORT int do_encoding( ) const throw( ) BOOST_OVERRIDE {
|
||||
return sizeof(wchar_t) / sizeof(char);
|
||||
}
|
||||
virtual int do_max_length( ) const throw( ){
|
||||
|
||||
BOOST_SYMBOL_EXPORT bool do_always_noconv() const throw() BOOST_OVERRIDE {
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOST_SYMBOL_EXPORT int do_max_length( ) const throw( ) BOOST_OVERRIDE {
|
||||
return do_encoding();
|
||||
}
|
||||
public:
|
||||
explicit codecvt_null(std::size_t no_locale_manage = 0) :
|
||||
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
||||
{}
|
||||
virtual ~codecvt_null(){};
|
||||
BOOST_SYMBOL_EXPORT explicit codecvt_null(std::size_t no_locale_manage = 0);
|
||||
|
||||
BOOST_SYMBOL_EXPORT ~codecvt_null() BOOST_OVERRIDE ;
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
@@ -105,6 +111,6 @@ public:
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
|
||||
//#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
|
||||
|
||||
#endif //BOOST_ARCHIVE_CODECVT_NULL_HPP
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// abi_prefix.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// abi_suffix.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// archive_serializer_map.hpp: extenstion of type_info required for
|
||||
// archive_serializer_map.hpp: extenstion of type_info required for
|
||||
// serialization.
|
||||
|
||||
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -18,7 +18,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
// note: this is nothing more than the thinest of wrappers around
|
||||
// basic_serializer_map so we can have a one map / archive type.
|
||||
// basic_serializer_map so we can have a one map / archive type.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
// See library home page at http://www.boost.org/libs/serialization
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
// enable automatic library variant selection ------------------------------//
|
||||
// enable automatic library variant selection ------------------------------//
|
||||
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
// See library home page at http://www.boost.org/libs/serialization
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
// enable automatic library variant selection ------------------------------//
|
||||
// enable automatic library variant selection ------------------------------//
|
||||
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_iarchive.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -72,27 +72,27 @@ public:
|
||||
const basic_iserializer & bis
|
||||
);
|
||||
BOOST_ARCHIVE_DECL void load_object(
|
||||
void *t,
|
||||
void *t,
|
||||
const basic_iserializer & bis
|
||||
);
|
||||
BOOST_ARCHIVE_DECL const basic_pointer_iserializer *
|
||||
BOOST_ARCHIVE_DECL const basic_pointer_iserializer *
|
||||
load_pointer(
|
||||
void * & t,
|
||||
void * & t,
|
||||
const basic_pointer_iserializer * bpis_ptr,
|
||||
const basic_pointer_iserializer * (*finder)(
|
||||
const boost::serialization::extended_type_info & eti
|
||||
)
|
||||
);
|
||||
// real public API starts here
|
||||
BOOST_ARCHIVE_DECL void
|
||||
set_library_version(library_version_type archive_library_version);
|
||||
BOOST_ARCHIVE_DECL library_version_type
|
||||
BOOST_ARCHIVE_DECL void
|
||||
set_library_version(boost::serialization::library_version_type archive_library_version);
|
||||
BOOST_ARCHIVE_DECL boost::serialization::library_version_type
|
||||
get_library_version() const;
|
||||
BOOST_ARCHIVE_DECL unsigned int
|
||||
get_flags() const;
|
||||
BOOST_ARCHIVE_DECL void
|
||||
BOOST_ARCHIVE_DECL void
|
||||
reset_object_address(const void * new_address, const void * old_address);
|
||||
BOOST_ARCHIVE_DECL void
|
||||
BOOST_ARCHIVE_DECL void
|
||||
delete_created_pointers();
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_iserializer.hpp: extenstion of type_info required for serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -42,7 +42,7 @@ namespace detail {
|
||||
class basic_iarchive;
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE basic_iserializer :
|
||||
class BOOST_SYMBOL_VISIBLE basic_iserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
private:
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
return m_bpis;
|
||||
}
|
||||
virtual void load_object_data(
|
||||
basic_iarchive & ar,
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
) const = 0;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_oarchive.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -69,19 +69,19 @@ public:
|
||||
const basic_oserializer & bos
|
||||
);
|
||||
BOOST_ARCHIVE_DECL void save_object(
|
||||
const void *x,
|
||||
const void *x,
|
||||
const basic_oserializer & bos
|
||||
);
|
||||
BOOST_ARCHIVE_DECL void save_pointer(
|
||||
const void * t,
|
||||
const void * t,
|
||||
const basic_pointer_oserializer * bpos_ptr
|
||||
);
|
||||
void save_null_pointer(){
|
||||
vsave(NULL_POINTER_TAG);
|
||||
vsave(BOOST_SERIALIZATION_NULL_POINTER_TAG);
|
||||
}
|
||||
// real public interface starts here
|
||||
BOOST_ARCHIVE_DECL void end_preamble(); // default implementation does nothing
|
||||
BOOST_ARCHIVE_DECL library_version_type get_library_version() const;
|
||||
BOOST_ARCHIVE_DECL boost::serialization::library_version_type get_library_version() const;
|
||||
BOOST_ARCHIVE_DECL unsigned int get_flags() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_oserializer.hpp: extenstion of type_info required for serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_pointer_oserializer.hpp: extenstion of type_info required for
|
||||
// basic_pointer_oserializer.hpp: extenstion of type_info required for
|
||||
// serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
virtual void * heap_allocation() const = 0;
|
||||
virtual const basic_iserializer & get_basic_serializer() const = 0;
|
||||
virtual void load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
basic_iarchive & ar,
|
||||
void * x,
|
||||
const unsigned int file_version
|
||||
) const = 0;
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_pointer_oserializer.hpp: extenstion of type_info required for
|
||||
// basic_pointer_oserializer.hpp: extenstion of type_info required for
|
||||
// serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -39,7 +39,7 @@ namespace detail {
|
||||
class basic_oarchive;
|
||||
class basic_oserializer;
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer :
|
||||
class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_serializer.hpp: extenstion of type_info required for serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -32,18 +32,18 @@ namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class basic_serializer :
|
||||
class basic_serializer :
|
||||
private boost::noncopyable
|
||||
{
|
||||
const boost::serialization::extended_type_info * m_eti;
|
||||
protected:
|
||||
explicit basic_serializer(
|
||||
const boost::serialization::extended_type_info & eti
|
||||
) :
|
||||
) :
|
||||
m_eti(& eti)
|
||||
{}
|
||||
public:
|
||||
inline bool
|
||||
inline bool
|
||||
operator<(const basic_serializer & rhs) const {
|
||||
// can't compare address since there can be multiple eti records
|
||||
// for the same type in different execution modules (that is, DLLS)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_serializer_map.hpp: extenstion of type_info required for serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
class extended_type_info;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ basic_serializer_map : public
|
||||
) const ;
|
||||
};
|
||||
typedef std::set<
|
||||
const basic_serializer *,
|
||||
const basic_serializer *,
|
||||
type_info_pointer_compare
|
||||
> map_type;
|
||||
map_type m_map;
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#pragma inline_recursion(on)
|
||||
#endif
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// check.hpp: interface for serialization system.
|
||||
|
||||
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -49,7 +49,7 @@ namespace detail {
|
||||
|
||||
template<class T>
|
||||
inline void check_object_level(){
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::greater_equal<
|
||||
serialization::implementation_level< T >,
|
||||
mpl::int_<serialization::primitive_type>
|
||||
@@ -62,7 +62,7 @@ inline void check_object_level(){
|
||||
|
||||
template<class T>
|
||||
inline void check_object_versioning(){
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::or_<
|
||||
typename mpl::greater<
|
||||
serialization::implementation_level< T >,
|
||||
@@ -90,8 +90,8 @@ inline void check_object_tracking(){
|
||||
// saving an non-const object of a type not marked "track_never)
|
||||
|
||||
// may be an indicator of an error usage of the
|
||||
// serialization library and should be double checked.
|
||||
// See documentation on object tracking. Also, see the
|
||||
// serialization library and should be double checked.
|
||||
// See documentation on object tracking. Also, see the
|
||||
// "rationale" section of the documenation
|
||||
// for motivation for this checking.
|
||||
|
||||
@@ -104,7 +104,7 @@ template<class T>
|
||||
inline void check_pointer_level(){
|
||||
// we should only invoke this once we KNOW that T
|
||||
// has been used as a pointer!!
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::or_<
|
||||
typename mpl::greater<
|
||||
serialization::implementation_level< T >,
|
||||
@@ -126,12 +126,12 @@ inline void check_pointer_level(){
|
||||
|
||||
// in this case, indication that an object is tracked is
|
||||
// not stored in the archive itself - see level == object_serializable
|
||||
// but rather the existence of the operation ar >> T * is used to
|
||||
// but rather the existence of the operation ar >> T * is used to
|
||||
// infer that an object of this type should be tracked. So, if
|
||||
// you save via a pointer but don't load via a pointer the operation
|
||||
// will fail on load without given any valid reason for the failure.
|
||||
|
||||
// So if your program traps here, consider changing the
|
||||
// So if your program traps here, consider changing the
|
||||
// tracking or implementation level traits - or not
|
||||
// serializing via a pointer.
|
||||
BOOST_STATIC_WARNING(typex::value);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// common_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -35,28 +35,29 @@ class extended_type_info;
|
||||
|
||||
// note: referred to as Curiously Recurring Template Patter (CRTP)
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE common_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE common_iarchive :
|
||||
public basic_iarchive,
|
||||
public interface_iarchive<Archive>
|
||||
{
|
||||
friend class interface_iarchive<Archive>;
|
||||
friend class basic_iarchive;
|
||||
private:
|
||||
virtual void vload(version_type & t){
|
||||
* this->This() >> t;
|
||||
}
|
||||
virtual void vload(object_id_type & t){
|
||||
void vload(version_type & t) BOOST_OVERRIDE {
|
||||
* this->This() >> t;
|
||||
}
|
||||
virtual void vload(class_id_type & t){
|
||||
void vload(object_id_type & t) BOOST_OVERRIDE {
|
||||
* this->This() >> t;
|
||||
}
|
||||
virtual void vload(class_id_optional_type & t){
|
||||
void vload(class_id_type & t) BOOST_OVERRIDE {
|
||||
* this->This() >> t;
|
||||
}
|
||||
virtual void vload(tracking_type & t){
|
||||
void vload(class_id_optional_type & t) BOOST_OVERRIDE {
|
||||
* this->This() >> t;
|
||||
}
|
||||
virtual void vload(class_name_type &s){
|
||||
void vload(tracking_type & t) BOOST_OVERRIDE {
|
||||
* this->This() >> t;
|
||||
}
|
||||
void vload(class_name_type &s) BOOST_OVERRIDE {
|
||||
* this->This() >> s;
|
||||
}
|
||||
protected:
|
||||
@@ -70,7 +71,7 @@ protected:
|
||||
void load_start(const char * /*name*/){}
|
||||
void load_end(const char * /*name*/){}
|
||||
// default archive initialization
|
||||
common_iarchive(unsigned int flags = 0) :
|
||||
common_iarchive(unsigned int flags = 0) :
|
||||
basic_iarchive(flags),
|
||||
interface_iarchive<Archive>()
|
||||
{}
|
||||
@@ -85,4 +86,3 @@ protected:
|
||||
#endif
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// common_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -38,29 +38,30 @@ class BOOST_SYMBOL_VISIBLE common_oarchive :
|
||||
public interface_oarchive<Archive>
|
||||
{
|
||||
friend class interface_oarchive<Archive>;
|
||||
friend class basic_oarchive;
|
||||
private:
|
||||
virtual void vsave(const version_type t){
|
||||
void vsave(const version_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const object_id_type t){
|
||||
void vsave(const object_id_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const object_reference_type t){
|
||||
void vsave(const object_reference_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const class_id_type t){
|
||||
void vsave(const class_id_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const class_id_reference_type t){
|
||||
void vsave(const class_id_reference_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const class_id_optional_type t){
|
||||
void vsave(const class_id_optional_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const class_name_type & t){
|
||||
void vsave(const class_name_type & t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
virtual void vsave(const tracking_type t){
|
||||
void vsave(const tracking_type t) BOOST_OVERRIDE {
|
||||
* this->This() << t;
|
||||
}
|
||||
protected:
|
||||
@@ -71,7 +72,7 @@ protected:
|
||||
}
|
||||
void save_start(const char * /*name*/){}
|
||||
void save_end(const char * /*name*/){}
|
||||
common_oarchive(unsigned int flags = 0) :
|
||||
common_oarchive(unsigned int flags = 0) :
|
||||
basic_oarchive(flags),
|
||||
interface_oarchive<Archive>()
|
||||
{}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_DECL_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_DECL_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_DECL_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8
|
||||
// decl.hpp
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// See library home page at http://www.boost.org/libs/serialization
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// interface_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -31,10 +31,10 @@ namespace detail {
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_iarchive
|
||||
class interface_iarchive
|
||||
{
|
||||
protected:
|
||||
interface_iarchive(){};
|
||||
interface_iarchive() {}
|
||||
public:
|
||||
/////////////////////////////////////////////////////////
|
||||
// archive public interface
|
||||
@@ -47,11 +47,11 @@ public:
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const basic_pointer_iserializer *
|
||||
const basic_pointer_iserializer *
|
||||
register_type(T * = NULL){
|
||||
const basic_pointer_iserializer & bpis =
|
||||
boost::serialization::singleton<
|
||||
pointer_iserializer<Archive, T>
|
||||
pointer_iserializer<Archive, T>
|
||||
>::get_const_instance();
|
||||
this->This()->register_basic_serializer(bpis.get_basic_serializer());
|
||||
return & bpis;
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
helper_collection & hc = this->This()->get_helper_collection();
|
||||
return hc.template find_helper<Helper>(id);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
Archive & operator>>(T & t){
|
||||
this->This()->load_override(t);
|
||||
return * this->This();
|
||||
}
|
||||
|
||||
// the & operator
|
||||
// the & operator
|
||||
template<class T>
|
||||
Archive & operator&(T & t){
|
||||
return *(this->This()) >> t;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// interface_oarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -32,10 +32,10 @@ namespace detail {
|
||||
class basic_pointer_oserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_oarchive
|
||||
class interface_oarchive
|
||||
{
|
||||
protected:
|
||||
interface_oarchive(){};
|
||||
interface_oarchive() {}
|
||||
public:
|
||||
/////////////////////////////////////////////////////////
|
||||
// archive public interface
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const basic_pointer_oserializer *
|
||||
const basic_pointer_oserializer *
|
||||
register_type(const T * = NULL){
|
||||
const basic_pointer_oserializer & bpos =
|
||||
boost::serialization::singleton<
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
this->This()->register_basic_serializer(bpos.get_basic_serializer());
|
||||
return & bpos;
|
||||
}
|
||||
|
||||
|
||||
template<class Helper>
|
||||
Helper &
|
||||
get_helper(void * const id = 0){
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
this->This()->save_override(t);
|
||||
return * this->This();
|
||||
}
|
||||
|
||||
// the & operator
|
||||
|
||||
// the & operator
|
||||
template<class T>
|
||||
Archive & operator&(const T & t){
|
||||
return * this ->This() << t;
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
#define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma once
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#pragma inline_recursion(on)
|
||||
#endif
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// iserializer.hpp: interface for serialization system.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace std{
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
|
||||
#include <boost/serialization/extended_type_info_typeid.hpp>
|
||||
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
|
||||
#include <boost/serialization/extended_type_info_typeid.hpp>
|
||||
#endif
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/smart_cast.hpp>
|
||||
@@ -57,16 +57,15 @@ namespace std{
|
||||
|
||||
#include <boost/serialization/assume_abstract.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, < 1210) \
|
||||
|| ( \
|
||||
defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
|
||||
)
|
||||
#define DONT_USE_HAS_NEW_OPERATOR 1
|
||||
#if !defined(BOOST_MSVC) && \
|
||||
(BOOST_WORKAROUND(__IBMCPP__, < 1210) || \
|
||||
defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590))
|
||||
#define BOOST_SERIALIZATION_DONT_USE_HAS_NEW_OPERATOR 1
|
||||
#else
|
||||
#define DONT_USE_HAS_NEW_OPERATOR 0
|
||||
#define BOOST_SERIALIZATION_DONT_USE_HAS_NEW_OPERATOR 0
|
||||
#endif
|
||||
|
||||
#if ! DONT_USE_HAS_NEW_OPERATOR
|
||||
#if ! BOOST_SERIALIZATION_DONT_USE_HAS_NEW_OPERATOR
|
||||
#include <boost/type_traits/has_new_operator.hpp>
|
||||
#endif
|
||||
|
||||
@@ -90,6 +89,8 @@ namespace std{
|
||||
#include <boost/archive/detail/archive_serializer_map.hpp>
|
||||
#include <boost/archive/detail/check.hpp>
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace serialization {
|
||||
@@ -119,43 +120,41 @@ template<class Archive, class T>
|
||||
class iserializer : public basic_iserializer
|
||||
{
|
||||
private:
|
||||
virtual void destroy(/*const*/ void *address) const {
|
||||
void destroy(/*const*/ void *address) const BOOST_OVERRIDE {
|
||||
boost::serialization::access::destroy(static_cast<T *>(address));
|
||||
}
|
||||
protected:
|
||||
// protected constructor since it's always created by singleton
|
||||
public:
|
||||
explicit iserializer() :
|
||||
basic_iserializer(
|
||||
boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance()
|
||||
)
|
||||
{}
|
||||
public:
|
||||
virtual BOOST_DLLEXPORT void load_object_data(
|
||||
BOOST_DLLEXPORT void load_object_data(
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
) const BOOST_USED;
|
||||
virtual bool class_info() const {
|
||||
return boost::serialization::implementation_level< T >::value
|
||||
) const BOOST_OVERRIDE BOOST_USED;
|
||||
bool class_info() const BOOST_OVERRIDE {
|
||||
return boost::serialization::implementation_level< T >::value
|
||||
>= boost::serialization::object_class_info;
|
||||
}
|
||||
virtual bool tracking(const unsigned int /* flags */) const {
|
||||
return boost::serialization::tracking_level< T >::value
|
||||
bool tracking(const unsigned int /* flags */) const BOOST_OVERRIDE {
|
||||
return boost::serialization::tracking_level< T >::value
|
||||
== boost::serialization::track_always
|
||||
|| ( boost::serialization::tracking_level< T >::value
|
||||
|| ( boost::serialization::tracking_level< T >::value
|
||||
== boost::serialization::track_selectively
|
||||
&& serialized_as_pointer());
|
||||
}
|
||||
virtual version_type version() const {
|
||||
version_type version() const BOOST_OVERRIDE {
|
||||
return version_type(::boost::serialization::version< T >::value);
|
||||
}
|
||||
virtual bool is_polymorphic() const {
|
||||
bool is_polymorphic() const BOOST_OVERRIDE {
|
||||
return boost::is_polymorphic< T >::value;
|
||||
}
|
||||
virtual ~iserializer(){};
|
||||
~iserializer() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@@ -165,12 +164,12 @@ public:
|
||||
template<class Archive, class T>
|
||||
BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
) const {
|
||||
// note: we now comment this out. Before we permited archive
|
||||
// version # to be very large. Now we don't. To permit
|
||||
// readers of these old archives, we have to suppress this
|
||||
// readers of these old archives, we have to suppress this
|
||||
// code. Perhaps in the future we might re-enable it but
|
||||
// permit its suppression with a runtime switch.
|
||||
#if 0
|
||||
@@ -187,7 +186,7 @@ BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
|
||||
// be specialized by the user.
|
||||
boost::serialization::serialize_adl(
|
||||
boost::serialization::smart_cast_reference<Archive &>(ar),
|
||||
* static_cast<T *>(x),
|
||||
* static_cast<T *>(x),
|
||||
file_version
|
||||
);
|
||||
}
|
||||
@@ -200,7 +199,7 @@ BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
|
||||
// the purpose of this code is to allocate memory for an object
|
||||
// without requiring the constructor to be called. Presumably
|
||||
// the allocated object will be subsequently initialized with
|
||||
// "placement new".
|
||||
// "placement new".
|
||||
// note: we have the boost type trait has_new_operator but we
|
||||
// have no corresponding has_delete_operator. So we presume
|
||||
// that the former being true would imply that the a delete
|
||||
@@ -209,7 +208,7 @@ BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
|
||||
template<class T>
|
||||
struct heap_allocation {
|
||||
// boost::has_new_operator< T > doesn't work on these compilers
|
||||
#if DONT_USE_HAS_NEW_OPERATOR
|
||||
#if BOOST_SERIALIZATION_DONT_USE_HAS_NEW_OPERATOR
|
||||
// This doesn't handle operator new overload for class T
|
||||
static T * invoke_new(){
|
||||
return static_cast<T *>(operator new(sizeof(T)));
|
||||
@@ -234,7 +233,7 @@ struct heap_allocation {
|
||||
// that the class might have class specific new with NO
|
||||
// class specific delete at all. Patches (compatible with
|
||||
// C++03) welcome!
|
||||
delete t;
|
||||
(operator delete)(t);
|
||||
}
|
||||
};
|
||||
struct doesnt_have_new_operator {
|
||||
@@ -243,7 +242,7 @@ struct heap_allocation {
|
||||
}
|
||||
static void invoke_delete(T * t) {
|
||||
// Note: I'm reliance upon automatic conversion from T * to void * here
|
||||
delete t;
|
||||
(operator delete)(t);
|
||||
}
|
||||
};
|
||||
static T * invoke_new() {
|
||||
@@ -251,7 +250,7 @@ struct heap_allocation {
|
||||
mpl::eval_if<
|
||||
boost::has_new_operator< T >,
|
||||
mpl::identity<has_new_operator >,
|
||||
mpl::identity<doesnt_have_new_operator >
|
||||
mpl::identity<doesnt_have_new_operator >
|
||||
>::type typex;
|
||||
return typex::invoke_new();
|
||||
}
|
||||
@@ -260,7 +259,7 @@ struct heap_allocation {
|
||||
mpl::eval_if<
|
||||
boost::has_new_operator< T >,
|
||||
mpl::identity<has_new_operator >,
|
||||
mpl::identity<doesnt_have_new_operator >
|
||||
mpl::identity<doesnt_have_new_operator >
|
||||
>::type typex;
|
||||
typex::invoke_delete(t);
|
||||
}
|
||||
@@ -290,26 +289,26 @@ class pointer_iserializer :
|
||||
public basic_pointer_iserializer
|
||||
{
|
||||
private:
|
||||
virtual void * heap_allocation() const {
|
||||
void * heap_allocation() const BOOST_OVERRIDE {
|
||||
detail::heap_allocation<T> h;
|
||||
T * t = h.get();
|
||||
h.release();
|
||||
return t;
|
||||
}
|
||||
virtual const basic_iserializer & get_basic_serializer() const {
|
||||
const basic_iserializer & get_basic_serializer() const BOOST_OVERRIDE {
|
||||
return boost::serialization::singleton<
|
||||
iserializer<Archive, T>
|
||||
>::get_const_instance();
|
||||
}
|
||||
BOOST_DLLEXPORT virtual void load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
BOOST_DLLEXPORT void load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
void * x,
|
||||
const unsigned int file_version
|
||||
) const BOOST_USED;
|
||||
protected:
|
||||
) const BOOST_OVERRIDE BOOST_USED;
|
||||
public:
|
||||
// this should alway be a singleton so make the constructor protected
|
||||
pointer_iserializer();
|
||||
~pointer_iserializer();
|
||||
~pointer_iserializer() BOOST_OVERRIDE;
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@@ -320,12 +319,12 @@ protected:
|
||||
// serialized only through base class won't get optimized out
|
||||
template<class Archive, class T>
|
||||
BOOST_DLLEXPORT void pointer_iserializer<Archive, T>::load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
basic_iarchive & ar,
|
||||
void * t,
|
||||
const unsigned int file_version
|
||||
) const
|
||||
{
|
||||
Archive & ar_impl =
|
||||
Archive & ar_impl =
|
||||
boost::serialization::smart_cast_reference<Archive &>(ar);
|
||||
|
||||
// note that the above will throw std::bad_alloc if the allocation
|
||||
@@ -335,7 +334,7 @@ BOOST_DLLEXPORT void pointer_iserializer<Archive, T>::load_object_ptr(
|
||||
// automatically delete the t which is most likely not fully
|
||||
// constructed
|
||||
BOOST_TRY {
|
||||
// this addresses an obscure situation that occurs when
|
||||
// this addresses an obscure situation that occurs when
|
||||
// load_constructor de-serializes something through a pointer.
|
||||
ar.next_object_pointer(t);
|
||||
boost::serialization::load_construct_data_adl<Archive, T>(
|
||||
@@ -359,7 +358,7 @@ template<class Archive, class T>
|
||||
pointer_iserializer<Archive, T>::pointer_iserializer() :
|
||||
basic_pointer_iserializer(
|
||||
boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance()
|
||||
)
|
||||
@@ -394,8 +393,8 @@ struct load_non_pointer_type {
|
||||
// make sure call is routed through the higest interface that might
|
||||
// be specialized by the user.
|
||||
boost::serialization::serialize_adl(
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
boost::serialization::version< T >::value
|
||||
);
|
||||
}
|
||||
@@ -406,9 +405,9 @@ struct load_non_pointer_type {
|
||||
struct load_standard {
|
||||
template<class T>
|
||||
static void invoke(Archive &ar, const T & t){
|
||||
void * x = & const_cast<T &>(t);
|
||||
void * x = boost::addressof(const_cast<T &>(t));
|
||||
ar.load_object(
|
||||
x,
|
||||
x,
|
||||
boost::serialization::singleton<
|
||||
iserializer<Archive, T>
|
||||
>::get_const_instance()
|
||||
@@ -484,8 +483,8 @@ struct load_pointer_type {
|
||||
};
|
||||
|
||||
template<class T>
|
||||
static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){
|
||||
// there should never be any need to load an abstract polymorphic
|
||||
static const basic_pointer_iserializer * register_type(Archive &ar, const T* const /*t*/){
|
||||
// there should never be any need to load an abstract polymorphic
|
||||
// class pointer. Inhibiting code generation for this
|
||||
// permits abstract base classes to be used - note: exception
|
||||
// virtual serialize functions used for plug-ins
|
||||
@@ -493,7 +492,7 @@ struct load_pointer_type {
|
||||
mpl::eval_if<
|
||||
boost::serialization::is_abstract<const T>,
|
||||
boost::mpl::identity<abstract>,
|
||||
boost::mpl::identity<non_abstract>
|
||||
boost::mpl::identity<non_abstract>
|
||||
>::type typex;
|
||||
return typex::template register_type< T >(ar);
|
||||
}
|
||||
@@ -509,7 +508,7 @@ struct load_pointer_type {
|
||||
boost::serialization::void_upcast(
|
||||
eti,
|
||||
boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance(),
|
||||
t
|
||||
@@ -523,7 +522,7 @@ struct load_pointer_type {
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static void check_load(T & /* t */){
|
||||
static void check_load(T * const /* t */){
|
||||
check_pointer_level< T >();
|
||||
check_pointer_tracking< T >();
|
||||
}
|
||||
@@ -537,8 +536,8 @@ struct load_pointer_type {
|
||||
|
||||
template<class Tptr>
|
||||
static void invoke(Archive & ar, Tptr & t){
|
||||
check_load(*t);
|
||||
const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t);
|
||||
check_load(t);
|
||||
const basic_pointer_iserializer * bpis_ptr = register_type(ar, t);
|
||||
const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer(
|
||||
// note major hack here !!!
|
||||
// I tried every way to convert Tptr &t (where Tptr might
|
||||
@@ -571,13 +570,13 @@ struct load_array_type {
|
||||
template<class T>
|
||||
static void invoke(Archive &ar, T &t){
|
||||
typedef typename remove_extent< T >::type value_type;
|
||||
|
||||
|
||||
// convert integers to correct enum to load
|
||||
// determine number of elements in the array. Consider the
|
||||
// fact that some machines will align elements on boundries
|
||||
// fact that some machines will align elements on boundaries
|
||||
// other than characters.
|
||||
std::size_t current_count = sizeof(t) / (
|
||||
static_cast<char *>(static_cast<void *>(&t[1]))
|
||||
static_cast<char *>(static_cast<void *>(&t[1]))
|
||||
- static_cast<char *>(static_cast<void *>(&t[0]))
|
||||
);
|
||||
boost::serialization::collection_size_type count;
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#pragma inline_recursion(on)
|
||||
#endif
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
#pragma inline_depth(511)
|
||||
#pragma inline_depth(255)
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// oserializer.hpp: interface for serialization system.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
@@ -35,8 +36,8 @@
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/bool_fwd.hpp>
|
||||
|
||||
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
|
||||
#include <boost/serialization/extended_type_info_typeid.hpp>
|
||||
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
|
||||
#include <boost/serialization/extended_type_info_typeid.hpp>
|
||||
#endif
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/smart_cast.hpp>
|
||||
@@ -68,6 +69,8 @@
|
||||
#include <boost/archive/detail/archive_serializer_map.hpp>
|
||||
#include <boost/archive/detail/check.hpp>
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace serialization {
|
||||
@@ -102,37 +105,37 @@ template<class Archive, class T>
|
||||
class oserializer : public basic_oserializer
|
||||
{
|
||||
private:
|
||||
// private constructor to inhibit any existence other than the
|
||||
// private constructor to inhibit any existence other than the
|
||||
// static one
|
||||
public:
|
||||
explicit BOOST_DLLEXPORT oserializer() :
|
||||
basic_oserializer(
|
||||
boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance()
|
||||
)
|
||||
{}
|
||||
virtual BOOST_DLLEXPORT void save_object_data(
|
||||
basic_oarchive & ar,
|
||||
BOOST_DLLEXPORT void save_object_data(
|
||||
basic_oarchive & ar,
|
||||
const void *x
|
||||
) const BOOST_USED;
|
||||
virtual bool class_info() const {
|
||||
return boost::serialization::implementation_level< T >::value
|
||||
) const BOOST_OVERRIDE BOOST_USED;
|
||||
bool class_info() const BOOST_OVERRIDE {
|
||||
return boost::serialization::implementation_level< T >::value
|
||||
>= boost::serialization::object_class_info;
|
||||
}
|
||||
virtual bool tracking(const unsigned int /* flags */) const {
|
||||
bool tracking(const unsigned int /* flags */) const BOOST_OVERRIDE {
|
||||
return boost::serialization::tracking_level< T >::value == boost::serialization::track_always
|
||||
|| (boost::serialization::tracking_level< T >::value == boost::serialization::track_selectively
|
||||
&& serialized_as_pointer());
|
||||
}
|
||||
virtual version_type version() const {
|
||||
version_type version() const BOOST_OVERRIDE {
|
||||
return version_type(::boost::serialization::version< T >::value);
|
||||
}
|
||||
virtual bool is_polymorphic() const {
|
||||
bool is_polymorphic() const BOOST_OVERRIDE {
|
||||
return boost::is_polymorphic< T >::value;
|
||||
}
|
||||
virtual ~oserializer(){}
|
||||
~oserializer() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@@ -141,7 +144,7 @@ public:
|
||||
|
||||
template<class Archive, class T>
|
||||
BOOST_DLLEXPORT void oserializer<Archive, T>::save_object_data(
|
||||
basic_oarchive & ar,
|
||||
basic_oarchive & ar,
|
||||
const void *x
|
||||
) const {
|
||||
// make sure call is routed through the highest interface that might
|
||||
@@ -164,19 +167,19 @@ class pointer_oserializer :
|
||||
public basic_pointer_oserializer
|
||||
{
|
||||
private:
|
||||
const basic_oserializer &
|
||||
get_basic_serializer() const {
|
||||
const basic_oserializer &
|
||||
get_basic_serializer() const BOOST_OVERRIDE {
|
||||
return boost::serialization::singleton<
|
||||
oserializer<Archive, T>
|
||||
>::get_const_instance();
|
||||
}
|
||||
virtual BOOST_DLLEXPORT void save_object_ptr(
|
||||
BOOST_DLLEXPORT void save_object_ptr(
|
||||
basic_oarchive & ar,
|
||||
const void * x
|
||||
) const BOOST_USED;
|
||||
) const BOOST_OVERRIDE BOOST_USED;
|
||||
public:
|
||||
pointer_oserializer();
|
||||
~pointer_oserializer();
|
||||
~pointer_oserializer() BOOST_OVERRIDE;
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@@ -193,11 +196,11 @@ BOOST_DLLEXPORT void pointer_oserializer<Archive, T>::save_object_ptr(
|
||||
// be specialized by the user.
|
||||
T * t = static_cast<T *>(const_cast<void *>(x));
|
||||
const unsigned int file_version = boost::serialization::version< T >::value;
|
||||
Archive & ar_impl
|
||||
Archive & ar_impl
|
||||
= boost::serialization::smart_cast_reference<Archive &>(ar);
|
||||
boost::serialization::save_construct_data_adl<Archive, T>(
|
||||
ar_impl,
|
||||
t,
|
||||
ar_impl,
|
||||
t,
|
||||
file_version
|
||||
);
|
||||
ar_impl << boost::serialization::make_nvp(NULL, * t);
|
||||
@@ -207,14 +210,14 @@ template<class Archive, class T>
|
||||
pointer_oserializer<Archive, T>::pointer_oserializer() :
|
||||
basic_pointer_oserializer(
|
||||
boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance()
|
||||
)
|
||||
{
|
||||
// make sure appropriate member function is instantiated
|
||||
boost::serialization::singleton<
|
||||
oserializer<Archive, T>
|
||||
oserializer<Archive, T>
|
||||
>::get_mutable_instance().set_bpos(this);
|
||||
archive_serializer_map<Archive>::insert(this);
|
||||
}
|
||||
@@ -241,8 +244,8 @@ struct save_non_pointer_type {
|
||||
// make sure call is routed through the highest interface that might
|
||||
// be specialized by the user.
|
||||
boost::serialization::serialize_adl(
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
ar,
|
||||
const_cast<T &>(t),
|
||||
::boost::serialization::version< T >::value
|
||||
);
|
||||
}
|
||||
@@ -253,7 +256,7 @@ struct save_non_pointer_type {
|
||||
template<class T>
|
||||
static void invoke(Archive &ar, const T & t){
|
||||
ar.save_object(
|
||||
& t,
|
||||
boost::addressof(t),
|
||||
boost::serialization::singleton<
|
||||
oserializer<Archive, T>
|
||||
>::get_const_instance()
|
||||
@@ -261,6 +264,8 @@ struct save_non_pointer_type {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// adds class information to the archive. This includes
|
||||
// serialization level and class version
|
||||
struct save_conditional {
|
||||
@@ -276,7 +281,7 @@ struct save_non_pointer_type {
|
||||
|
||||
template<class T>
|
||||
static void invoke(Archive & ar, const T & t){
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::eval_if<
|
||||
// if its primitive
|
||||
mpl::equal_to<
|
||||
@@ -305,7 +310,7 @@ struct save_non_pointer_type {
|
||||
// else
|
||||
// do a fast save only tracking is turned off
|
||||
mpl::identity<save_conditional>
|
||||
> > >::type typex;
|
||||
> > >::type typex;
|
||||
check_object_versioning< T >();
|
||||
typex::invoke(ar, t);
|
||||
}
|
||||
@@ -339,15 +344,15 @@ struct save_pointer_type {
|
||||
|
||||
template<class T>
|
||||
static const basic_pointer_oserializer * register_type(Archive &ar, T* const /*t*/){
|
||||
// there should never be any need to save an abstract polymorphic
|
||||
// there should never be any need to save an abstract polymorphic
|
||||
// class pointer. Inhibiting code generation for this
|
||||
// permits abstract base classes to be used - note: exception
|
||||
// virtual serialize functions used for plug-ins
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::eval_if<
|
||||
boost::serialization::is_abstract< T >,
|
||||
mpl::identity<abstract>,
|
||||
mpl::identity<non_abstract>
|
||||
mpl::identity<non_abstract>
|
||||
>::type typex;
|
||||
return typex::template register_type< T >(ar);
|
||||
}
|
||||
@@ -356,10 +361,10 @@ struct save_pointer_type {
|
||||
{
|
||||
template<class T>
|
||||
static void save(
|
||||
Archive &ar,
|
||||
Archive &ar,
|
||||
T & t
|
||||
){
|
||||
const basic_pointer_oserializer & bpos =
|
||||
const basic_pointer_oserializer & bpos =
|
||||
boost::serialization::singleton<
|
||||
pointer_oserializer<Archive, T>
|
||||
>::get_const_instance();
|
||||
@@ -372,13 +377,13 @@ struct save_pointer_type {
|
||||
{
|
||||
template<class T>
|
||||
static void save(
|
||||
Archive &ar,
|
||||
Archive &ar,
|
||||
T & t
|
||||
){
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type const
|
||||
& i = boost::serialization::singleton<
|
||||
typename
|
||||
typename
|
||||
boost::serialization::type_info_implementation< T >::type
|
||||
>::get_const_instance();
|
||||
|
||||
@@ -412,8 +417,8 @@ struct save_pointer_type {
|
||||
// convert pointer to more derived type. if this is thrown
|
||||
// it means that the base/derived relationship hasn't be registered
|
||||
vp = serialization::void_downcast(
|
||||
*true_type,
|
||||
*this_type,
|
||||
*true_type,
|
||||
*this_type,
|
||||
static_cast<const void *>(&t)
|
||||
);
|
||||
if(NULL == vp){
|
||||
@@ -426,7 +431,7 @@ struct save_pointer_type {
|
||||
);
|
||||
}
|
||||
|
||||
// since true_type is valid, and this only gets made if the
|
||||
// since true_type is valid, and this only gets made if the
|
||||
// pointer oserializer object has been created, this should never
|
||||
// fail
|
||||
const basic_pointer_oserializer * bpos
|
||||
@@ -449,7 +454,7 @@ struct save_pointer_type {
|
||||
|
||||
template<class T>
|
||||
static void save(
|
||||
Archive & ar,
|
||||
Archive & ar,
|
||||
const T & t
|
||||
){
|
||||
check_pointer_level< T >();
|
||||
@@ -466,7 +471,7 @@ struct save_pointer_type {
|
||||
static void invoke(Archive &ar, const TPtr t){
|
||||
register_type(ar, t);
|
||||
if(NULL == t){
|
||||
basic_oarchive & boa
|
||||
basic_oarchive & boa
|
||||
= boost::serialization::smart_cast_reference<basic_oarchive &>(ar);
|
||||
boa.save_null_pointer();
|
||||
save_access::end_preamble(ar);
|
||||
@@ -493,11 +498,11 @@ struct save_array_type
|
||||
template<class T>
|
||||
static void invoke(Archive &ar, const T &t){
|
||||
typedef typename boost::remove_extent< T >::type value_type;
|
||||
|
||||
|
||||
save_access::end_preamble(ar);
|
||||
// consider alignment
|
||||
std::size_t c = sizeof(t) / (
|
||||
static_cast<const char *>(static_cast<const void *>(&t[1]))
|
||||
static_cast<const char *>(static_cast<const void *>(&t[1]))
|
||||
- static_cast<const char *>(static_cast<const void *>(&t[0]))
|
||||
);
|
||||
boost::serialization::collection_size_type count(c);
|
||||
@@ -517,7 +522,7 @@ struct save_array_type
|
||||
|
||||
template<class Archive, class T>
|
||||
inline void save(Archive & ar, /*const*/ T &t){
|
||||
typedef
|
||||
typedef
|
||||
typename mpl::eval_if<is_pointer< T >,
|
||||
mpl::identity<detail::save_pointer_type<Archive> >,
|
||||
//else
|
||||
|
||||
@@ -56,125 +56,125 @@ class polymorphic_iarchive_route :
|
||||
{
|
||||
private:
|
||||
// these are used by the serialization library.
|
||||
virtual void load_object(
|
||||
void load_object(
|
||||
void *t,
|
||||
const basic_iserializer & bis
|
||||
){
|
||||
) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load_object(t, bis);
|
||||
}
|
||||
virtual const basic_pointer_iserializer * load_pointer(
|
||||
const basic_pointer_iserializer * load_pointer(
|
||||
void * & t,
|
||||
const basic_pointer_iserializer * bpis_ptr,
|
||||
const basic_pointer_iserializer * (*finder)(
|
||||
const boost::serialization::extended_type_info & type
|
||||
)
|
||||
){
|
||||
) BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::load_pointer(t, bpis_ptr, finder);
|
||||
}
|
||||
virtual void set_library_version(library_version_type archive_library_version){
|
||||
void set_library_version(boost::serialization::library_version_type archive_library_version) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::set_library_version(archive_library_version);
|
||||
}
|
||||
virtual library_version_type get_library_version() const{
|
||||
boost::serialization::library_version_type get_library_version() const BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_library_version();
|
||||
}
|
||||
virtual unsigned int get_flags() const {
|
||||
unsigned int get_flags() const BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_flags();
|
||||
}
|
||||
virtual void delete_created_pointers(){
|
||||
void delete_created_pointers() BOOST_OVERRIDE {
|
||||
ArchiveImplementation::delete_created_pointers();
|
||||
}
|
||||
virtual void reset_object_address(
|
||||
void reset_object_address(
|
||||
const void * new_address,
|
||||
const void * old_address
|
||||
){
|
||||
) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::reset_object_address(new_address, old_address);
|
||||
}
|
||||
virtual void load_binary(void * t, std::size_t size){
|
||||
void load_binary(void * t, std::size_t size) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load_binary(t, size);
|
||||
}
|
||||
// primitive types the only ones permitted by polymorphic archives
|
||||
virtual void load(bool & t){
|
||||
void load(bool & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(char & t){
|
||||
void load(char & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(signed char & t){
|
||||
void load(signed char & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned char & t){
|
||||
void load(unsigned char & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
virtual void load(wchar_t & t){
|
||||
void load(wchar_t & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
virtual void load(short & t){
|
||||
void load(short & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned short & t){
|
||||
void load(unsigned short & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(int & t){
|
||||
void load(int & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned int & t){
|
||||
void load(unsigned int & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(long & t){
|
||||
void load(long & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned long & t){
|
||||
void load(unsigned long & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
virtual void load(boost::long_long_type & t){
|
||||
void load(boost::long_long_type & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(boost::ulong_long_type & t){
|
||||
void load(boost::ulong_long_type & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
virtual void load(__int64 & t){
|
||||
void load(__int64 & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned __int64 & t){
|
||||
void load(unsigned __int64 & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#endif
|
||||
virtual void load(float & t){
|
||||
void load(float & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(double & t){
|
||||
void load(double & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(std::string & t){
|
||||
void load(std::string & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
virtual void load(std::wstring & t){
|
||||
void load(std::wstring & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#endif
|
||||
// used for xml and other tagged formats default does nothing
|
||||
virtual void load_start(const char * name){
|
||||
void load_start(const char * name) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load_start(name);
|
||||
}
|
||||
virtual void load_end(const char * name){
|
||||
void load_end(const char * name) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::load_end(name);
|
||||
}
|
||||
virtual void register_basic_serializer(const basic_iserializer & bis){
|
||||
void register_basic_serializer(const basic_iserializer & bis) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::register_basic_serializer(bis);
|
||||
}
|
||||
virtual helper_collection &
|
||||
get_helper_collection(){
|
||||
helper_collection &
|
||||
get_helper_collection() BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_helper_collection();
|
||||
}
|
||||
public:
|
||||
// this can't be inheriteded because they appear in mulitple
|
||||
// this can't be inherited because they appear in multiple
|
||||
// parents
|
||||
typedef mpl::bool_<true> is_loading;
|
||||
typedef mpl::bool_<false> is_saving;
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
}
|
||||
// register type function
|
||||
template<class T>
|
||||
const basic_pointer_iserializer *
|
||||
const basic_pointer_iserializer *
|
||||
register_type(T * t = NULL){
|
||||
return ArchiveImplementation::register_type(t);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
) :
|
||||
ArchiveImplementation(is, flags)
|
||||
{}
|
||||
virtual ~polymorphic_iarchive_route(){};
|
||||
~polymorphic_iarchive_route() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -56,116 +56,116 @@ class polymorphic_oarchive_route :
|
||||
{
|
||||
private:
|
||||
// these are used by the serialization library.
|
||||
virtual void save_object(
|
||||
void save_object(
|
||||
const void *x,
|
||||
const detail::basic_oserializer & bos
|
||||
){
|
||||
) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_object(x, bos);
|
||||
}
|
||||
virtual void save_pointer(
|
||||
void save_pointer(
|
||||
const void * t,
|
||||
const detail::basic_pointer_oserializer * bpos_ptr
|
||||
){
|
||||
) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_pointer(t, bpos_ptr);
|
||||
}
|
||||
virtual void save_null_pointer(){
|
||||
void save_null_pointer() BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_null_pointer();
|
||||
}
|
||||
// primitive types the only ones permitted by polymorphic archives
|
||||
virtual void save(const bool t){
|
||||
void save(const bool t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const char t){
|
||||
void save(const char t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const signed char t){
|
||||
void save(const signed char t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const unsigned char t){
|
||||
void save(const unsigned char t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
virtual void save(const wchar_t t){
|
||||
void save(const wchar_t t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
virtual void save(const short t){
|
||||
void save(const short t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const unsigned short t){
|
||||
void save(const unsigned short t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const int t){
|
||||
void save(const int t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const unsigned int t){
|
||||
void save(const unsigned int t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const long t){
|
||||
void save(const long t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const unsigned long t){
|
||||
void save(const unsigned long t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
virtual void save(const boost::long_long_type t){
|
||||
void save(const boost::long_long_type t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const boost::ulong_long_type t){
|
||||
void save(const boost::ulong_long_type t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
virtual void save(const boost::int64_t t){
|
||||
void save(const boost::int64_t t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const boost::uint64_t t){
|
||||
void save(const boost::uint64_t t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#endif
|
||||
virtual void save(const float t){
|
||||
void save(const float t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const double t){
|
||||
void save(const double t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
virtual void save(const std::string & t){
|
||||
void save(const std::string & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
virtual void save(const std::wstring & t){
|
||||
void save(const std::wstring & t) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save(t);
|
||||
}
|
||||
#endif
|
||||
virtual library_version_type get_library_version() const{
|
||||
boost::serialization::library_version_type get_library_version() const BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_library_version();
|
||||
}
|
||||
virtual unsigned int get_flags() const {
|
||||
unsigned int get_flags() const BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_flags();
|
||||
}
|
||||
virtual void save_binary(const void * t, std::size_t size){
|
||||
void save_binary(const void * t, std::size_t size) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_binary(t, size);
|
||||
}
|
||||
// used for xml and other tagged formats default does nothing
|
||||
virtual void save_start(const char * name){
|
||||
void save_start(const char * name) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_start(name);
|
||||
}
|
||||
virtual void save_end(const char * name){
|
||||
void save_end(const char * name) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::save_end(name);
|
||||
}
|
||||
virtual void end_preamble(){
|
||||
void end_preamble() BOOST_OVERRIDE {
|
||||
ArchiveImplementation::end_preamble();
|
||||
}
|
||||
virtual void register_basic_serializer(const detail::basic_oserializer & bos){
|
||||
void register_basic_serializer(const detail::basic_oserializer & bos) BOOST_OVERRIDE {
|
||||
ArchiveImplementation::register_basic_serializer(bos);
|
||||
}
|
||||
virtual helper_collection &
|
||||
get_helper_collection(){
|
||||
helper_collection &
|
||||
get_helper_collection() BOOST_OVERRIDE {
|
||||
return ArchiveImplementation::get_helper_collection();
|
||||
}
|
||||
public:
|
||||
// this can't be inheriteded because they appear in mulitple
|
||||
// this can't be inherited because they appear in multiple
|
||||
// parents
|
||||
typedef mpl::bool_<false> is_loading;
|
||||
typedef mpl::bool_<true> is_saving;
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
}
|
||||
// register type function
|
||||
template<class T>
|
||||
const basic_pointer_oserializer *
|
||||
const basic_pointer_oserializer *
|
||||
register_type(T * t = NULL){
|
||||
return ArchiveImplementation::register_type(t);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
) :
|
||||
ArchiveImplementation(os, flags)
|
||||
{}
|
||||
virtual ~polymorphic_oarchive_route(){};
|
||||
~polymorphic_oarchive_route() BOOST_OVERRIDE {}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP
|
||||
# define BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP
|
||||
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
|
||||
// No instantiate_ptr_serialization overloads generated by
|
||||
// BOOST_SERIALIZATION_REGISTER_ARCHIVE that lexically follow the call
|
||||
|
||||
@@ -13,27 +13,16 @@
|
||||
#error "wide char i/o not supported on this platform"
|
||||
#endif
|
||||
|
||||
// std::codecvt_utf8 doesn't seem to work for any versions of msvc
|
||||
// use boost's utf8 codecvt facet
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#define BOOST_UTF8_BEGIN_NAMESPACE \
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
#define BOOST_UTF8_END_NAMESPACE }}}
|
||||
|
||||
#if defined(_MSC_VER) || defined(BOOST_NO_CXX11_HDR_CODECVT)
|
||||
// use boost's utf8 codecvt facet
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#define BOOST_UTF8_BEGIN_NAMESPACE \
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
#define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL
|
||||
#define BOOST_UTF8_END_NAMESPACE }}}
|
||||
#include <boost/detail/utf8_codecvt_facet.hpp>
|
||||
|
||||
#include <boost/detail/utf8_codecvt_facet.hpp>
|
||||
|
||||
#undef BOOST_UTF8_END_NAMESPACE
|
||||
#undef BOOST_UTF8_DECL
|
||||
#undef BOOST_UTF8_BEGIN_NAMESPACE
|
||||
#else
|
||||
// use the standard vendor supplied facet
|
||||
#include <codecvt>
|
||||
namespace boost { namespace archive { namespace detail {
|
||||
typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
|
||||
} } }
|
||||
#endif
|
||||
#undef BOOST_UTF8_END_NAMESPACE
|
||||
#undef BOOST_UTF8_DECL
|
||||
#undef BOOST_UTF8_BEGIN_NAMESPACE
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// dinkumware.hpp:
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -29,7 +29,7 @@ namespace std {
|
||||
|
||||
// define i/o operators for 64 bit integers
|
||||
template<class CharType>
|
||||
basic_ostream<CharType> &
|
||||
basic_ostream<CharType> &
|
||||
operator<<(basic_ostream<CharType> & os, boost::uint64_t t){
|
||||
// octal rendering of 64 bit number would be 22 octets + eos
|
||||
CharType d[23];
|
||||
@@ -66,7 +66,7 @@ operator<<(basic_ostream<CharType> & os, boost::uint64_t t){
|
||||
}
|
||||
|
||||
template<class CharType>
|
||||
basic_ostream<CharType> &
|
||||
basic_ostream<CharType> &
|
||||
operator<<(basic_ostream<CharType> &os, boost::int64_t t){
|
||||
if(0 <= t){
|
||||
os << static_cast<boost::uint64_t>(t);
|
||||
@@ -79,7 +79,7 @@ operator<<(basic_ostream<CharType> &os, boost::int64_t t){
|
||||
}
|
||||
|
||||
template<class CharType>
|
||||
basic_istream<CharType> &
|
||||
basic_istream<CharType> &
|
||||
operator>>(basic_istream<CharType> &is, boost::int64_t & t){
|
||||
CharType d;
|
||||
do{
|
||||
@@ -119,7 +119,7 @@ operator>>(basic_istream<CharType> &is, boost::int64_t & t){
|
||||
}
|
||||
|
||||
template<class CharType>
|
||||
basic_istream<CharType> &
|
||||
basic_istream<CharType> &
|
||||
operator>>(basic_istream<CharType> &is, boost::uint64_t & t){
|
||||
boost::int64_t it;
|
||||
is >> it;
|
||||
@@ -127,10 +127,8 @@ operator>>(basic_istream<CharType> &is, boost::uint64_t & t){
|
||||
return is;
|
||||
}
|
||||
|
||||
//#endif
|
||||
|
||||
template<>
|
||||
class back_insert_iterator<basic_string<char> > : public
|
||||
class back_insert_iterator<basic_string<char> > : public
|
||||
iterator<output_iterator_tag, char>
|
||||
{
|
||||
public:
|
||||
@@ -140,7 +138,7 @@ public:
|
||||
explicit back_insert_iterator(container_type & s)
|
||||
: container(& s)
|
||||
{} // construct with container
|
||||
|
||||
|
||||
back_insert_iterator<container_type> & operator=(
|
||||
container_type::const_reference Val_
|
||||
){ // push value into container
|
||||
@@ -167,7 +165,7 @@ protected:
|
||||
container_type *container; // pointer to container
|
||||
};
|
||||
|
||||
template<char>
|
||||
template<char>
|
||||
inline back_insert_iterator<basic_string<char> > back_inserter(
|
||||
basic_string<char> & s
|
||||
){
|
||||
@@ -175,7 +173,7 @@ inline back_insert_iterator<basic_string<char> > back_inserter(
|
||||
}
|
||||
|
||||
template<>
|
||||
class back_insert_iterator<basic_string<wchar_t> > : public
|
||||
class back_insert_iterator<basic_string<wchar_t> > : public
|
||||
iterator<output_iterator_tag, wchar_t>
|
||||
{
|
||||
public:
|
||||
@@ -185,7 +183,7 @@ public:
|
||||
explicit back_insert_iterator(container_type & s)
|
||||
: container(& s)
|
||||
{} // construct with container
|
||||
|
||||
|
||||
back_insert_iterator<container_type> & operator=(
|
||||
container_type::const_reference Val_
|
||||
){ // push value into container
|
||||
@@ -212,7 +210,7 @@ protected:
|
||||
container_type *container; // pointer to container
|
||||
};
|
||||
|
||||
template<wchar_t>
|
||||
template<wchar_t>
|
||||
inline back_insert_iterator<basic_string<wchar_t> > back_inserter(
|
||||
basic_string<wchar_t> & s
|
||||
){
|
||||
|
||||
@@ -47,10 +47,10 @@ archive_serializer_map<Archive>::insert(const basic_serializer * bs){
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
archive_serializer_map<Archive>::erase(const basic_serializer * bs){
|
||||
BOOST_ASSERT(! boost::serialization::singleton<
|
||||
extra_detail::map<Archive>
|
||||
>::is_destroyed()
|
||||
);
|
||||
// note: previously this conditional was a runtime assertion with
|
||||
// BOOST_ASSERT. We've changed it because we've discovered that at
|
||||
// least one platform is not guaranteed to destroy singletons in
|
||||
// reverse order of distruction.
|
||||
if(boost::serialization::singleton<
|
||||
extra_detail::map<Archive>
|
||||
>::is_destroyed())
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace std{
|
||||
#endif
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
|
||||
#include <boost/archive/basic_binary_iarchive.hpp>
|
||||
|
||||
@@ -48,7 +48,7 @@ basic_binary_iarchive<Archive>::load_override(class_name_type & t){
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iarchive<Archive>::init(void){
|
||||
basic_binary_iarchive<Archive>::init() {
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
|
||||
@@ -84,12 +84,12 @@ basic_binary_iarchive<Archive>::init(void){
|
||||
|
||||
// make sure the version of the reading archive library can
|
||||
// support the format of the archive being read
|
||||
library_version_type input_library_version;
|
||||
boost::serialization::library_version_type input_library_version;
|
||||
//* this->This() >> input_library_version;
|
||||
{
|
||||
int v = 0;
|
||||
v = this->This()->m_sb.sbumpc();
|
||||
#if defined(BOOST_LITTLE_ENDIAN)
|
||||
#if BOOST_ENDIAN_LITTLE_BYTE
|
||||
if(v < 6){
|
||||
;
|
||||
}
|
||||
@@ -111,11 +111,11 @@ basic_binary_iarchive<Archive>::init(void){
|
||||
// version 8+ followed by a zero
|
||||
this->This()->m_sb.sbumpc();
|
||||
}
|
||||
#elif defined(BOOST_BIG_ENDIAN)
|
||||
#elif BOOST_ENDIAN_BIG_BYTE
|
||||
if(v == 0)
|
||||
v = this->This()->m_sb.sbumpc();
|
||||
#endif
|
||||
input_library_version = static_cast<library_version_type>(v);
|
||||
input_library_version = static_cast<boost::serialization::library_version_type>(v);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
|
||||
@@ -34,7 +34,7 @@ basic_binary_oarchive<Archive>::init(){
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
// write library version
|
||||
const library_version_type v(BOOST_ARCHIVE_VERSION());
|
||||
const boost::serialization::library_version_type v(BOOST_ARCHIVE_VERSION());
|
||||
* this->This() << v;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ basic_text_iarchive<Archive>::load_override(class_name_type & t){
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_iarchive<Archive>::init(void){
|
||||
basic_text_iarchive<Archive>::init() {
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this->This() >> file_signature;
|
||||
@@ -56,7 +56,7 @@ basic_text_iarchive<Archive>::init(void){
|
||||
|
||||
// make sure the version of the reading archive library can
|
||||
// support the format of the archive being read
|
||||
library_version_type input_library_version;
|
||||
boost::serialization::library_version_type input_library_version;
|
||||
* this->This() >> input_library_version;
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
|
||||
@@ -54,7 +54,7 @@ basic_text_oarchive<Archive>::init(){
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
// write library version
|
||||
const library_version_type v(BOOST_ARCHIVE_VERSION());
|
||||
const boost::serialization::library_version_type v(BOOST_ARCHIVE_VERSION());
|
||||
* this->This() << v;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <algorithm> // std::copy
|
||||
#include <exception> // std::uncaught_exception
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
@@ -18,6 +17,8 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/core/uncaught_exceptions.hpp>
|
||||
|
||||
#include <boost/archive/basic_text_oprimitive.hpp>
|
||||
|
||||
#include <boost/archive/iterators/base64_from_binary.hpp>
|
||||
@@ -106,7 +107,7 @@ basic_text_oprimitive<OStream>::basic_text_oprimitive(
|
||||
template<class OStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_oprimitive<OStream>::~basic_text_oprimitive(){
|
||||
if(std::uncaught_exception())
|
||||
if(boost::core::uncaught_exceptions() > 0)
|
||||
return;
|
||||
os << std::endl;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_xml_grammar.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -64,13 +64,13 @@ namespace archive {
|
||||
// XML grammar parsing
|
||||
|
||||
template<class CharType>
|
||||
class basic_xml_grammar {
|
||||
class BOOST_SYMBOL_VISIBLE basic_xml_grammar {
|
||||
public:
|
||||
// The following is not necessary according to DR45, but at least
|
||||
// one compiler (Compaq C++ 6.5 in strict_ansi mode) chokes otherwise.
|
||||
struct return_values;
|
||||
friend struct return_values;
|
||||
|
||||
|
||||
private:
|
||||
typedef typename std::basic_istream<CharType> IStream;
|
||||
typedef typename std::basic_string<CharType> StringType;
|
||||
@@ -81,16 +81,16 @@ private:
|
||||
> scanner_t;
|
||||
typedef typename boost::spirit::classic::rule<scanner_t> rule_t;
|
||||
// Start grammar definition
|
||||
rule_t
|
||||
rule_t
|
||||
Reference,
|
||||
Eq,
|
||||
Eq,
|
||||
STag,
|
||||
ETag,
|
||||
LetterOrUnderscoreOrColon,
|
||||
AttValue,
|
||||
CharRef1,
|
||||
CharRef2,
|
||||
CharRef,
|
||||
AttValue,
|
||||
CharRef1,
|
||||
CharRef2,
|
||||
CharRef,
|
||||
AmpRef,
|
||||
LTRef,
|
||||
GTRef,
|
||||
@@ -127,11 +127,11 @@ private:
|
||||
chset_t
|
||||
BaseChar,
|
||||
Ideographic,
|
||||
Char,
|
||||
Letter,
|
||||
Char,
|
||||
Letter,
|
||||
Digit,
|
||||
CombiningChar,
|
||||
Extender,
|
||||
Extender,
|
||||
Sch,
|
||||
NameChar;
|
||||
|
||||
@@ -139,7 +139,7 @@ private:
|
||||
|
||||
bool my_parse(
|
||||
IStream & is,
|
||||
const rule_t &rule_,
|
||||
const rule_t &rule_,
|
||||
const CharType delimiter = L'>'
|
||||
) const ;
|
||||
public:
|
||||
|
||||
@@ -37,7 +37,6 @@ basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
}
|
||||
// don't check start tag at highest level
|
||||
++depth;
|
||||
return;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
|
||||
@@ -115,14 +115,7 @@ text_iarchive_impl<Archive>::text_iarchive_impl(
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_text_iarchive<Archive>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
this->init();
|
||||
#else
|
||||
this->basic_text_iarchive<Archive>::init();
|
||||
#endif
|
||||
}
|
||||
{}
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
@@ -93,12 +93,6 @@ text_oarchive_impl<Archive>::text_oarchive_impl(
|
||||
),
|
||||
basic_text_oarchive<Archive>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
this->init();
|
||||
#else
|
||||
this->basic_text_oarchive<Archive>::init();
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
|
||||
@@ -108,8 +108,6 @@ text_wiarchive_impl<Archive>::text_wiarchive_impl(
|
||||
),
|
||||
basic_text_iarchive<Archive>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
basic_text_iarchive<Archive>::init();
|
||||
}
|
||||
|
||||
} // archive
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user