From 6b22dfcf59474dd016a0355a3102a1dd3692d92c Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Sun, 19 Oct 2014 22:22:58 +0200 Subject: Update Boost in 3rdParty to version 1.56.0. This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc diff --git a/3rdParty/Boost/02_android_compilation_fixes.diff b/3rdParty/Boost/02_android_compilation_fixes.diff deleted file mode 100644 index 9aba7e1..0000000 --- a/3rdParty/Boost/02_android_compilation_fixes.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/3rdParty/Boost/src/boost/detail/endian.hpp b/3rdParty/Boost/src/boost/detail/endian.hpp -index 98c870c..ac77a2e 100644 ---- a/3rdParty/Boost/src/boost/detail/endian.hpp -+++ b/3rdParty/Boost/src/boost/detail/endian.hpp -@@ -66,8 +66,8 @@ - || defined(_M_ALPHA) || defined(__amd64) \ - || defined(__amd64__) || defined(_M_AMD64) \ - || defined(__x86_64) || defined(__x86_64__) \ -- || defined(_M_X64) || defined(__bfin__) -- -+ || defined(_M_X64) || defined(__bfin__) \ -+ || defined(ANDROID) - # define BOOST_LITTLE_ENDIAN - # define BOOST_BYTE_ORDER 1234 - #else -diff --git a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp -index 16a336f..d066e40 100644 ---- a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp -+++ b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp -@@ -73,10 +73,14 @@ using std::wstring; - const fs::path dot_dot_path(".."); - # include - # include --# if !defined(__APPLE__) && !defined(__OpenBSD__) -+# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(ANDROID) - # include - # define BOOST_STATVFS statvfs - # define BOOST_STATVFS_F_FRSIZE vfs.f_frsize -+# elif defined (ANDROID) -+# include -+# define BOOST_STATVFS statfs -+# define BOOST_STATVFS_F_FRSIZE static_cast(vfs.f_bsize) - # else - # ifdef __OpenBSD__ - # include - -- \ No newline at end of file diff --git a/3rdParty/Boost/02_android_compilation_fixes.diff.old b/3rdParty/Boost/02_android_compilation_fixes.diff.old new file mode 100644 index 0000000..bb991fd --- /dev/null +++ b/3rdParty/Boost/02_android_compilation_fixes.diff.old @@ -0,0 +1,36 @@ +diff --git a/3rdParty/Boost/src/boost/detail/endian.hpp b/3rdParty/Boost/src/boost/detail/endian.hpp +index 98c870c..ac77a2e 100644 +--- a/3rdParty/Boost/src/boost/predef/other/endian.h ++++ b/3rdParty/Boost/src/boost/predef/other/endian.h +@@ -66,8 +66,8 @@ + || defined(_M_ALPHA) || defined(__amd64) \ + || defined(__amd64__) || defined(_M_AMD64) \ + || defined(__x86_64) || defined(__x86_64__) \ +- || defined(_M_X64) || defined(__bfin__) +- ++ || defined(_M_X64) || defined(__bfin__) \ ++ || defined(ANDROID) + # define BOOST_LITTLE_ENDIAN + # define BOOST_BYTE_ORDER 1234 + #else +diff --git a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp +index 16a336f..d066e40 100644 +--- a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp ++++ b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp +@@ -73,10 +73,14 @@ using std::wstring; + const fs::path dot_dot_path(".."); + # include + # include +-# if !defined(__APPLE__) && !defined(__OpenBSD__) ++# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(ANDROID) + # include + # define BOOST_STATVFS statvfs + # define BOOST_STATVFS_F_FRSIZE vfs.f_frsize ++# elif defined (ANDROID) ++# include ++# define BOOST_STATVFS statfs ++# define BOOST_STATVFS_F_FRSIZE static_cast(vfs.f_bsize) + # else + # ifdef __OpenBSD__ + # include + -- \ No newline at end of file diff --git a/3rdParty/Boost/SConscript b/3rdParty/Boost/SConscript index a0d6500..200c2b4 100644 --- a/3rdParty/Boost/SConscript +++ b/3rdParty/Boost/SConscript @@ -53,6 +53,7 @@ elif env.get("BOOST_BUNDLED", False) : myenv.Replace(CXXFLAGS = [flag for flag in env["CXXFLAGS"] if not flag.startswith("-W")]) sources = [ + "src/libs/atomic/src/lockpool.cpp", "src/libs/date_time/src/gregorian/date_generators.cpp", "src/libs/date_time/src/gregorian/greg_month.cpp", "src/libs/date_time/src/gregorian/greg_weekday.cpp", @@ -124,7 +125,6 @@ elif env.get("BOOST_BUNDLED", False) : "src/libs/serialization/src/extended_type_info_typeid.cpp", "src/libs/serialization/src/polymorphic_iarchive.cpp", "src/libs/serialization/src/polymorphic_oarchive.cpp", - "src/libs/serialization/src/shared_ptr_helper.cpp", "src/libs/serialization/src/stl_port.cpp", "src/libs/serialization/src/text_iarchive.cpp", "src/libs/serialization/src/text_oarchive.cpp", @@ -148,6 +148,7 @@ elif env.get("BOOST_BUNDLED", False) : if env["PLATFORM"] != "win32" : sources += [ "src/libs/thread/src/pthread/once.cpp", + "src/libs/thread/src/pthread/once_atomic.cpp", "src/libs/thread/src/pthread/thread.cpp"] else : sources += [ diff --git a/3rdParty/Boost/src/boost/algorithm/string/concept.hpp b/3rdParty/Boost/src/boost/algorithm/string/concept.hpp index 9876e98..17e8349 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/concept.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/concept.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_CONCEPT_HPP #include -#include +#include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp index 8b9ad42..b398750 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_FIND_FORMAT_DETAIL_HPP #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ namespace boost { // Copy the beginning of the sequence Output = std::copy( ::boost::begin(Input), ::boost::begin(M), Output ); // Format find result - // Copy formated result + // Copy formatted result Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output ); // Copy the rest of the sequence Output = std::copy( M.end(), ::boost::end(Input), Output ); @@ -118,11 +118,11 @@ namespace boost { InputT Output; // Copy the beginning of the sequence - insert( Output, ::boost::end(Output), ::boost::begin(Input), M.begin() ); - // Copy formated result - insert( Output, ::boost::end(Output), M.format_result() ); + boost::algorithm::detail::insert( Output, ::boost::end(Output), ::boost::begin(Input), M.begin() ); + // Copy formatted result + boost::algorithm::detail::insert( Output, ::boost::end(Output), M.format_result() ); // Copy the rest of the sequence - insert( Output, ::boost::end(Output), M.end(), ::boost::end(Input) ); + boost::algorithm::detail::insert( Output, ::boost::end(Output), M.end(), ::boost::end(Input) ); return Output; } diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp index 978710c..52930c8 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ namespace boost { { // Copy the beginning of the sequence Output = std::copy( LastMatch, M.begin(), Output ); - // Copy formated result + // Copy formatted result Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output ); // Proceed to the next match @@ -134,9 +134,9 @@ namespace boost { while( M ) { // Copy the beginning of the sequence - insert( Output, ::boost::end(Output), LastMatch, M.begin() ); - // Copy formated result - insert( Output, ::boost::end(Output), M.format_result() ); + boost::algorithm::detail::insert( Output, ::boost::end(Output), LastMatch, M.begin() ); + // Copy formatted result + boost::algorithm::detail::insert( Output, ::boost::end(Output), M.format_result() ); // Proceed to the next match LastMatch=M.end(); @@ -218,7 +218,7 @@ namespace boost { // Adjust search iterator SearchIt=M.end(); - // Copy formated replace to the storage + // Copy formatted replace to the storage ::boost::algorithm::detail::copy_to_storage( Storage, M.format_result() ); // Find range for a next match diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_store.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_store.hpp index e8bd84a..b9f4a88 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_store.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_store.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP #include -#include +#include namespace boost { namespace algorithm { diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_iterator.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_iterator.hpp index c76993a..9b78a0f 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_iterator.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_iterator.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp index 45bcb7d..a2a9582 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -92,7 +92,7 @@ namespace boost { // find last functor -----------------------------------------------// - // find the last match a subseqeunce in the sequence ( functor ) + // find the last match a subsequence in the sequence ( functor ) /* Returns a pair marking the subsequence in the sequence. If the find fails, returns @@ -142,7 +142,6 @@ namespace boost { ForwardIteratorT End, std::forward_iterator_tag ) const { - typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; first_finder_type first_finder( @@ -263,7 +262,6 @@ namespace boost { ForwardIteratorT End, unsigned int N) const { - typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; // Sanity check @@ -298,7 +296,6 @@ namespace boost { ForwardIteratorT End, unsigned int N) const { - typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; // Sanity check @@ -362,7 +359,6 @@ namespace boost { unsigned int N, std::random_access_iterator_tag ) { - typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; if ( (End<=Begin) || ( static_cast(End-Begin) < N ) ) @@ -436,7 +432,6 @@ namespace boost { unsigned int N, std::random_access_iterator_tag ) { - typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; if ( (End<=Begin) || ( static_cast(End-Begin) < N ) ) @@ -627,8 +622,6 @@ namespace boost { { #if BOOST_WORKAROUND( __MWERKS__, <= 0x3003 ) return iterator_range(this->m_Range); -#elif BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - return iterator_range(m_Range.begin(), m_Range.end()); #else return m_Range; #endif diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/formatter.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/formatter.hpp index 8e7b727..c071822 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/formatter.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/formatter.hpp @@ -12,7 +12,7 @@ #define BOOST_STRING_FORMATTER_DETAIL_HPP -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/util.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/util.hpp index 7e8471f..cf4a8b1 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/util.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/util.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include namespace boost { namespace algorithm { diff --git a/3rdParty/Boost/src/boost/algorithm/string/erase.hpp b/3rdParty/Boost/src/boost/algorithm/string/erase.hpp index e738b86..6883790 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/erase.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/erase.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/find.hpp b/3rdParty/Boost/src/boost/algorithm/string/find.hpp index cc99ca1..f2c2926 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/find.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/find.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include @@ -86,7 +86,7 @@ namespace boost { //! Find first algorithm ( case insensitive ) /*! - Search for the first occurence of the substring in the input. + Search for the first occurrence of the substring in the input. Searching is case insensitive. \param Input A string which will be searched. @@ -293,7 +293,7 @@ namespace boost { If the "token compress mode" is enabled, adjacent tokens are considered to be one match. \param Input A input string. - \param Pred An unary predicate to identify a token + \param Pred A unary predicate to identify a token \param eCompress Enable/Disable compressing of adjacent tokens \return An \c iterator_range delimiting the match. diff --git a/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp b/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp index ef03739..0e84a4e 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/find_iterator.hpp b/3rdParty/Boost/src/boost/algorithm/string/find_iterator.hpp index b72ba7c..5834407 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/find_iterator.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/find_iterator.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -230,7 +230,7 @@ namespace boost { \post eof()==true */ - split_iterator() {} + split_iterator() { m_bEof = true; } //! Copy constructor /*! Construct a copy of the split_iterator diff --git a/3rdParty/Boost/src/boost/algorithm/string/finder.hpp b/3rdParty/Boost/src/boost/algorithm/string/finder.hpp index 4c7ac38..93f7ec3 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/finder.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/finder.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp b/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp index ab5921e..de8681b 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ namespace boost { Constructs a \c const_formatter. Const formatter always returns the same value, regardless of the parameter. - \param Format A predefined value used as a result for formating + \param Format A predefined value used as a result for formatting \return An instance of the \c const_formatter object. */ template @@ -95,7 +95,7 @@ namespace boost { to extract a portion of the formatted sequence. The first finder's match is returned as a result - \param Finder a finder used to select a portion of the formated sequence + \param Finder a finder used to select a portion of the formatted sequence \return An instance of the \c dissect_formatter object. */ template diff --git a/3rdParty/Boost/src/boost/algorithm/string/iter_find.hpp b/3rdParty/Boost/src/boost/algorithm/string/iter_find.hpp index e106528..10424ab 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/iter_find.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/iter_find.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/predicate.hpp b/3rdParty/Boost/src/boost/algorithm/string/predicate.hpp index 6642f42..0879829 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/predicate.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/predicate.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/predicate_facade.hpp b/3rdParty/Boost/src/boost/algorithm/string/predicate_facade.hpp index c8319f7..a9753fc 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/predicate_facade.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/predicate_facade.hpp @@ -15,7 +15,7 @@ /* \file boost/algorith/string/predicate_facade.hpp - This file containes predicate_facade definition. This template class is used + This file contains predicate_facade definition. This template class is used to identify classification predicates, so they can be combined using composition operators. */ diff --git a/3rdParty/Boost/src/boost/algorithm/string/replace.hpp b/3rdParty/Boost/src/boost/algorithm/string/replace.hpp index f2d201f..0c04e47 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/replace.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/replace.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/algorithm/string/sequence_traits.hpp b/3rdParty/Boost/src/boost/algorithm/string/sequence_traits.hpp index b1ac67e..be151f8 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/sequence_traits.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/sequence_traits.hpp @@ -36,47 +36,6 @@ namespace boost { // sequence traits -----------------------------------------------// -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - //! Native replace tester - /*! - Declare an override of this tester function with return - type boost::string_algo::yes_type for a sequence with this property. - - \return yes_type if the container has basic_string like native replace - method. - */ - no_type has_native_replace_tester(...); - - //! Stable iterators tester - /*! - Declare an override of this tester function with return - type boost::string_algo::yes_type for a sequence with this property. - - \return yes_type if the sequence's insert/replace/erase methods do not invalidate - existing iterators. - */ - no_type has_stable_iterators_tester(...); - - //! const time insert tester - /*! - Declare an override of this tester function with return - type boost::string_algo::yes_type for a sequence with this property. - - \return yes_type if the sequence's insert method is working in constant time - */ - no_type has_const_time_insert_tester(...); - - //! const time erase tester - /*! - Declare an override of this tester function with return - type boost::string_algo::yes_type for a sequence with this property. - - \return yes_type if the sequence's erase method is working in constant time - */ - no_type has_const_time_erase_tester(...); - -#endif //BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION //! Native replace trait /*! @@ -86,20 +45,12 @@ namespace boost { class has_native_replace { -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value=( - sizeof(has_native_replace_tester(t))==sizeof(yes_type) ) ); -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION public: # if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else BOOST_STATIC_CONSTANT(bool, value=false); # endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION typedef mpl::bool_::value> type; @@ -114,20 +65,12 @@ namespace boost { template< typename T > class has_stable_iterators { -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value=( - sizeof(has_stable_iterators_tester(t))==sizeof(yes_type) ) ); -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION public: # if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else BOOST_STATIC_CONSTANT(bool, value=false); # endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION typedef mpl::bool_::value> type; }; @@ -141,20 +84,12 @@ namespace boost { template< typename T > class has_const_time_insert { -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value=( - sizeof(has_const_time_insert_tester(t))==sizeof(yes_type) ) ); -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION public: # if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else BOOST_STATIC_CONSTANT(bool, value=false); # endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION typedef mpl::bool_::value> type; }; @@ -168,20 +103,12 @@ namespace boost { template< typename T > class has_const_time_erase { -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value=( - sizeof(has_const_time_erase_tester(t))==sizeof(yes_type) ) ); -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION public: # if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else BOOST_STATIC_CONSTANT(bool, value=false); # endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION typedef mpl::bool_::value> type; }; diff --git a/3rdParty/Boost/src/boost/algorithm/string/std/list_traits.hpp b/3rdParty/Boost/src/boost/algorithm/string/std/list_traits.hpp index ce2379d..a3cf7bb 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/std/list_traits.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/std/list_traits.hpp @@ -20,22 +20,6 @@ namespace boost { // std::list<> traits -----------------------------------------------// -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - // stable iterators tester - template - yes_type has_stable_iterators_tester( const ::std::list* ); - - // const time insert tester - template - yes_type has_const_time_insert_tester( const ::std::list* ); - - // const time erase tester - template - yes_type has_const_time_erase_tester( const ::std::list* ); - - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // stable iterators trait template @@ -75,7 +59,6 @@ namespace boost { #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; }; -#endif } // namespace algorithm diff --git a/3rdParty/Boost/src/boost/algorithm/string/std/slist_traits.hpp b/3rdParty/Boost/src/boost/algorithm/string/std/slist_traits.hpp index 7b915a3..c30b93c 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/std/slist_traits.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/std/slist_traits.hpp @@ -21,21 +21,6 @@ namespace boost { // SGI's std::slist<> traits -----------------------------------------------// -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - // stable iterators tester - template - yes_type has_stable_iterators_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist* ); - - // const time insert tester - template - yes_type has_const_time_insert_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist* ); - - // const time erase tester - template - yes_type has_const_time_erase_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist* ); - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // stable iterators trait template @@ -75,7 +60,6 @@ namespace boost { #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; }; -#endif } // namespace algorithm diff --git a/3rdParty/Boost/src/boost/algorithm/string/std/string_traits.hpp b/3rdParty/Boost/src/boost/algorithm/string/std/string_traits.hpp index c466d26..c940830 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/std/string_traits.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/std/string_traits.hpp @@ -20,13 +20,6 @@ namespace boost { // std::basic_string<> traits -----------------------------------------------// -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - // native replace tester - template - yes_type has_native_replace_tester( const std::basic_string* ); - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // native replace trait template @@ -43,7 +36,6 @@ namespace boost { }; -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } // namespace algorithm } // namespace boost diff --git a/3rdParty/Boost/src/boost/algorithm/string/trim.hpp b/3rdParty/Boost/src/boost/algorithm/string/trim.hpp index eb408a3..e740d57 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/trim.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/trim.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -50,7 +50,7 @@ namespace boost { \param Output An output iterator to which the result will be copied \param Input An input range - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces \return An output iterator pointing just after the last inserted character or a copy of the input @@ -118,7 +118,7 @@ namespace boost { The input sequence is modified in-place. \param Input An input sequence - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces */ template inline void trim_left_if(SequenceT& Input, PredicateT IsSpace) @@ -158,7 +158,7 @@ namespace boost { \param Output An output iterator to which the result will be copied \param Input An input range - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces \return An output iterator pointing just after the last inserted character or a copy of the input @@ -228,7 +228,7 @@ namespace boost { The input sequence is modified in-place. \param Input An input sequence - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces */ template inline void trim_right_if(SequenceT& Input, PredicateT IsSpace) @@ -270,7 +270,7 @@ namespace boost { \param Output An output iterator to which the result will be copied \param Input An input range - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces \return An output iterator pointing just after the last inserted character or a copy of the input @@ -352,7 +352,7 @@ namespace boost { The input sequence is modified in-place. \param Input An input sequence - \param IsSpace An unary predicate identifying spaces + \param IsSpace A unary predicate identifying spaces */ template inline void trim_if(SequenceT& Input, PredicateT IsSpace) diff --git a/3rdParty/Boost/src/boost/align/align.hpp b/3rdParty/Boost/src/boost/align/align.hpp new file mode 100644 index 0000000..8d29fca --- /dev/null +++ b/3rdParty/Boost/src/boost/align/align.hpp @@ -0,0 +1,86 @@ +/* + Copyright (c) 2014 Glen Joseph Fernandes + glenfe at live dot com + + 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) +*/ +#ifndef BOOST_ALIGN_ALIGN_HPP +#define BOOST_ALIGN_ALIGN_HPP + +/** + Function align. + + @file + @author Glen Fernandes +*/ + +#include + +/** + @cond +*/ +#if !defined(BOOST_NO_CXX11_STD_ALIGN) +#include +#else +#include +#endif + +#if defined(BOOST_NO_CXX11_STD_ALIGN) +/** + @endcond +*/ + +/** + Boost namespace. +*/ +namespace boost { + /** + Alignment namespace. + */ + namespace alignment { + /** + If it is possible to fit `size` bytes of storage + aligned by `alignment` into the buffer pointed to by + `ptr` with length `space`, the function updates `ptr` + to point to the first possible address of such + storage and decreases `space` by the number of bytes + used for alignment. Otherwise, the function does + nothing. + + @param alignment Shall be a fundamental alignment + value or an extended alignment value, and shall be + a power of two. + + @param size The size in bytes of storage to fit into + the buffer. + + @param ptr Shall point to contiguous storage of at + least `space` bytes. + + @param space The length of the buffer. + + @return A null pointer if the requested aligned + buffer would not fit into the available space, + otherwise the adjusted value of `ptr`. + + @remark **Note:** The function updates its `ptr` and + space arguments so that it can be called repeatedly + with possibly different `alignment` and `size` + arguments for the same buffer. + */ + inline void* align(std::size_t alignment, std::size_t size, + void*& ptr, std::size_t& space); + } +} + +/** + @cond +*/ +#endif +/** + @endcond +*/ + +#endif diff --git a/3rdParty/Boost/src/boost/align/detail/address.hpp b/3rdParty/Boost/src/boost/align/detail/address.hpp new file mode 100644 index 0000000..a205cbd --- /dev/null +++ b/3rdParty/Boost/src/boost/align/detail/address.hpp @@ -0,0 +1,27 @@ +/* + Copyright (c) 2014 Glen Joseph Fernandes + glenfe at live dot com + + 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) +*/ +#ifndef BOOST_ALIGN_DETAIL_ADDRESS_HPP +#define BOOST_ALIGN_DETAIL_ADDRESS_HPP + +#include +#include + +namespace boost { + namespace alignment { + namespace detail { +#if defined(BOOST_HAS_INTPTR_T) + typedef boost::uintptr_t address_t; +#else + typedef std::size_t address_t; +#endif + } + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/align/detail/align.hpp b/3rdParty/Boost/src/boost/align/detail/align.hpp new file mode 100644 index 0000000..d4d4287 --- /dev/null +++ b/3rdParty/Boost/src/boost/align/detail/align.hpp @@ -0,0 +1,38 @@ +/* + Copyright (c) 2014 Glen Joseph Fernandes + glenfe at live dot com + + 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) +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP +#define BOOST_ALIGN_DETAIL_ALIGN_HPP + +#include +#include +#include +#include + +namespace boost { + namespace alignment { + inline void* align(std::size_t alignment, std::size_t size, + void*& ptr, std::size_t& space) + { + BOOST_ASSERT(detail::is_alignment(alignment)); + std::size_t n = detail::address_t(ptr) & (alignment - 1); + if (n != 0) { + n = alignment - n; + } + void* p = 0; + if (n <= space && size <= space - n) { + p = static_cast(ptr) + n; + ptr = p; + space -= n; + } + return p; + } + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/align/detail/align_cxx11.hpp b/3rdParty/Boost/src/boost/align/detail/align_cxx11.hpp new file mode 100644 index 0000000..b79ea8e --- /dev/null +++ b/3rdParty/Boost/src/boost/align/detail/align_cxx11.hpp @@ -0,0 +1,20 @@ +/* + Copyright (c) 2014 Glen Joseph Fernandes + glenfe at live dot com + + 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) +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP +#define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP + +#include + +namespace boost { + namespace alignment { + using std::align; + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/align/detail/is_alignment.hpp b/3rdParty/Boost/src/boost/align/detail/is_alignment.hpp new file mode 100644 index 0000000..6e34cac --- /dev/null +++ b/3rdParty/Boost/src/boost/align/detail/is_alignment.hpp @@ -0,0 +1,27 @@ +/* + Copyright (c) 2014 Glen Joseph Fernandes + glenfe at live dot com + + 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) +*/ +#ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP +#define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP + +#include +#include + +namespace boost { + namespace alignment { + namespace detail { + BOOST_CONSTEXPR inline bool is_alignment(std::size_t + value) BOOST_NOEXCEPT + { + return (value > 0) && ((value & (value - 1)) == 0); + } + } + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/aligned_storage.hpp b/3rdParty/Boost/src/boost/aligned_storage.hpp index ce277ab..b5455f0 100644 --- a/3rdParty/Boost/src/boost/aligned_storage.hpp +++ b/3rdParty/Boost/src/boost/aligned_storage.hpp @@ -48,10 +48,10 @@ struct aligned_storage_imp { char buf[size_]; - typename mpl::eval_if_c< + typename ::boost::mpl::eval_if_c< alignment_ == std::size_t(-1) - , mpl::identity - , type_with_alignment + , ::boost::mpl::identity< ::boost::detail::max_align > + , ::boost::type_with_alignment >::type align_; } data_; void* address() const { return const_cast(this); } @@ -76,12 +76,12 @@ class aligned_storage : #else public #endif - detail::aligned_storage::aligned_storage_imp + ::boost::detail::aligned_storage::aligned_storage_imp { public: // constants - typedef detail::aligned_storage::aligned_storage_imp type; + typedef ::boost::detail::aligned_storage::aligned_storage_imp type; BOOST_STATIC_CONSTANT( std::size_t @@ -96,25 +96,11 @@ public: // constants ) ); -#if defined(__GNUC__) &&\ - (__GNUC__ > 3) ||\ - (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\ - (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3))) - private: // noncopyable aligned_storage(const aligned_storage&); aligned_storage& operator=(const aligned_storage&); -#else // gcc less than 3.2.3 - -public: // _should_ be noncopyable, but GCC compiler emits error - - aligned_storage(const aligned_storage&); - aligned_storage& operator=(const aligned_storage&); - -#endif // gcc < 3.2.3 workaround - public: // structors aligned_storage() @@ -132,46 +118,22 @@ public: // accessors return static_cast(this)->address(); } -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - const void* address() const { return static_cast(this)->address(); } - -#else // MSVC6 - - const void* address() const; - -#endif // MSVC6 workaround - }; -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - -// MSVC6 seems not to like inline functions with const void* returns, so we -// declare the following here: - -template -const void* aligned_storage::address() const -{ - return const_cast< aligned_storage* >(this)->address(); -} - -#endif // MSVC6 workaround - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // // Make sure that is_pod recognises aligned_storage<>::type // as a POD (Note that aligned_storage<> itself is not a POD): // template -struct is_pod > +struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp > BOOST_TT_AUX_BOOL_C_BASE(true) { BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) }; -#endif } // namespace boost diff --git a/3rdParty/Boost/src/boost/any.hpp b/3rdParty/Boost/src/boost/any.hpp index a8c654c..a63fea4 100644 --- a/3rdParty/Boost/src/boost/any.hpp +++ b/3rdParty/Boost/src/boost/any.hpp @@ -3,25 +3,35 @@ #ifndef BOOST_ANY_INCLUDED #define BOOST_ANY_INCLUDED +#if defined(_MSC_VER) +# pragma once +#endif + // what: variant type boost::any // who: contributed by Kevlin Henney, // with features contributed and bugs found by -// Ed Brey, Mark Rodgers, Peter Dimov, and James Curran -// when: July 2001 -// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.95 +// Antony Polukhin, Ed Brey, Mark Rodgers, +// Peter Dimov, and James Curran +// when: July 2001, April 2013 - May 2013 #include #include #include "boost/config.hpp" #include +#include +#include #include +#include #include #include +#include +#include +#include // See boost/python/type_id.hpp // TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp -# if (defined(__GNUC__) && __GNUC__ >= 3) \ +# if defined(__GNUC__) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) \ || (defined(__hpux) && defined(__HP_aCC)) \ @@ -36,14 +46,14 @@ namespace boost { public: // structors - any() + any() BOOST_NOEXCEPT : content(0) { } template any(const ValueType & value) - : content(new holder(value)) + : content(new holder::type>(value)) { } @@ -52,19 +62,39 @@ namespace boost { } - ~any() +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + // Move constructor + any(any&& other) BOOST_NOEXCEPT + : content(other.content) + { + other.content = 0; + } + + // Perfect forwarding of ValueType + template + any(ValueType&& value + , typename boost::disable_if >::type* = 0 // disable if value has type `any&` + , typename boost::disable_if >::type* = 0) // disable if value has type `const ValueType&&` + : content(new holder< typename decay::type >(static_cast(value))) + { + } +#endif + + ~any() BOOST_NOEXCEPT { delete content; } public: // modifiers - any & swap(any & rhs) + any & swap(any & rhs) BOOST_NOEXCEPT { std::swap(content, rhs.content); return *this; } + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template any & operator=(const ValueType & rhs) { @@ -74,18 +104,47 @@ namespace boost any & operator=(any rhs) { + any(rhs).swap(*this); + return *this; + } + +#else + any & operator=(const any& rhs) + { + any(rhs).swap(*this); + return *this; + } + + // move assignement + any & operator=(any&& rhs) BOOST_NOEXCEPT + { rhs.swap(*this); + any().swap(rhs); + return *this; + } + + // Perfect forwarding of ValueType + template + any & operator=(ValueType&& rhs) + { + any(static_cast(rhs)).swap(*this); return *this; } +#endif public: // queries - bool empty() const + bool empty() const BOOST_NOEXCEPT { return !content; } - const std::type_info & type() const + void clear() BOOST_NOEXCEPT + { + any().swap(*this); + } + + const std::type_info & type() const BOOST_NOEXCEPT { return content ? content->type() : typeid(void); } @@ -106,7 +165,7 @@ namespace boost public: // queries - virtual const std::type_info & type() const = 0; + virtual const std::type_info & type() const BOOST_NOEXCEPT = 0; virtual placeholder * clone() const = 0; @@ -122,9 +181,15 @@ namespace boost { } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + holder(ValueType&& value) + : held(static_cast< ValueType&& >(value)) + { + } +#endif public: // queries - virtual const std::type_info & type() const + virtual const std::type_info & type() const BOOST_NOEXCEPT { return typeid(ValueType); } @@ -147,10 +212,10 @@ namespace boost private: // representation template - friend ValueType * any_cast(any *); + friend ValueType * any_cast(any *) BOOST_NOEXCEPT; template - friend ValueType * unsafe_any_cast(any *); + friend ValueType * unsafe_any_cast(any *) BOOST_NOEXCEPT; #else @@ -161,11 +226,16 @@ namespace boost placeholder * content; }; + + inline void swap(any & lhs, any & rhs) BOOST_NOEXCEPT + { + lhs.swap(rhs); + } - class bad_any_cast : public std::bad_cast + class BOOST_SYMBOL_VISIBLE bad_any_cast : public std::bad_cast { public: - virtual const char * what() const throw() + virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW { return "boost::bad_any_cast: " "failed conversion using boost::any_cast"; @@ -173,7 +243,7 @@ namespace boost }; template - ValueType * any_cast(any * operand) + ValueType * any_cast(any * operand) BOOST_NOEXCEPT { return operand && #ifdef BOOST_AUX_ANY_TYPE_ID_NAME @@ -186,7 +256,7 @@ namespace boost } template - inline const ValueType * any_cast(const any * operand) + inline const ValueType * any_cast(const any * operand) BOOST_NOEXCEPT { return any_cast(const_cast(operand)); } @@ -196,35 +266,44 @@ namespace boost { typedef BOOST_DEDUCED_TYPENAME remove_reference::type nonref; -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - // If 'nonref' is still reference type, it means the user has not - // specialized 'remove_reference'. - - // Please use BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION macro - // to generate specialization of remove_reference for your class - // See type traits library documentation for details - BOOST_STATIC_ASSERT(!is_reference::value); -#endif nonref * result = any_cast(&operand); if(!result) boost::throw_exception(bad_any_cast()); - return *result; + + // Attempt to avoid construction of a temporary object in cases when + // `ValueType` is not a reference. Example: + // `static_cast(*result);` + // which is equal to `std::string(*result);` + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::is_reference, + ValueType, + BOOST_DEDUCED_TYPENAME boost::add_reference::type + >::type ref_type; + + return static_cast(*result); } template inline ValueType any_cast(const any & operand) { typedef BOOST_DEDUCED_TYPENAME remove_reference::type nonref; + return any_cast(const_cast(operand)); + } -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - // The comment in the above version of 'any_cast' explains when this - // assert is fired and what to do. - BOOST_STATIC_ASSERT(!is_reference::value); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + inline ValueType any_cast(any&& operand) + { + BOOST_STATIC_ASSERT_MSG( + boost::is_rvalue_reference::value /*true if ValueType is rvalue or just a value*/ + || boost::is_const< typename boost::remove_reference::type >::value, + "boost::any_cast shall not be used for getting nonconst references to temporary objects" + ); + return any_cast(operand); + } #endif - return any_cast(const_cast(operand)); - } // Note: The "unsafe" versions of any_cast are not part of the // public interface and may be removed at any time. They are @@ -232,13 +311,13 @@ namespace boost // use typeid() comparison, e.g., when our types may travel across // different shared libraries. template - inline ValueType * unsafe_any_cast(any * operand) + inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT { return &static_cast *>(operand->content)->held; } template - inline const ValueType * unsafe_any_cast(const any * operand) + inline const ValueType * unsafe_any_cast(const any * operand) BOOST_NOEXCEPT { return unsafe_any_cast(const_cast(operand)); } diff --git a/3rdParty/Boost/src/boost/archive/add_facet.hpp b/3rdParty/Boost/src/boost/archive/add_facet.hpp index 6bafe9b..242bdd9 100644 --- a/3rdParty/Boost/src/boost/archive/add_facet.hpp +++ b/3rdParty/Boost/src/boost/archive/add_facet.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ADD_FACET_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/archive_exception.hpp b/3rdParty/Boost/src/boost/archive/archive_exception.hpp index b5f33f6..ffb430c 100644 --- a/3rdParty/Boost/src/boost/archive/archive_exception.hpp +++ b/3rdParty/Boost/src/boost/archive/archive_exception.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -43,11 +43,13 @@ namespace archive { class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : public virtual std::exception { +protected: + char m_buffer[128]; public: typedef enum { no_exception, // initialized without code other_exception, // any excepton not listed below - unregistered_class, // attempt to serialize a pointer of an + unregistered_class, // attempt to serialize a pointer of // an unregistered class invalid_signature, // first line of archive does not contain // expected string @@ -55,8 +57,8 @@ public: // subsequent to this one pointer_conflict, // an attempt has been made to directly // serialize an object which has - // already been serialzed through a pointer. - // Were this permited, the archive load would result + // already been serialized through a pointer. + // Were this permitted, the archive load would result // in the creation of an extra copy of the obect. incompatible_native_format, // attempt to read native binary format // on incompatible platform @@ -68,14 +70,12 @@ public: unregistered_cast, // base - derived relationship not registered with // void_cast_register unsupported_class_version, // type saved with a version # greater than the - // one used by the program. This indicates that the proggram + // one used by the program. This indicates that the program // needs to be rebuilt. multiple_code_instantiation, // code for implementing serialization for some // type has been instantiated in more than one module. output_stream_error // error on input stream } exception_code; -protected: - std::string m_msg; public: exception_code code; archive_exception( @@ -83,9 +83,11 @@ public: const char * e1 = NULL, const char * e2 = NULL ); - ~archive_exception() throw (); - virtual const char *what( ) const throw(); + virtual ~archive_exception() throw(); + virtual const char *what() const throw(); protected: + unsigned int + append(unsigned int l, const char * a); archive_exception(); }; diff --git a/3rdParty/Boost/src/boost/archive/basic_archive.hpp b/3rdParty/Boost/src/boost/archive/basic_archive.hpp index c5ac880..0412112 100644 --- a/3rdParty/Boost/src/boost/archive/basic_archive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_archive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -15,7 +15,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. - +#include // count #include #include #include // size_t @@ -221,6 +221,9 @@ struct class_name_type : operator char * () { return t; } + std::size_t size() const { + return std::strlen(t); + } explicit class_name_type(const char *key_) : t(const_cast(key_)){} explicit class_name_type(char *key_) diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp index d851dab..a649d5e 100644 --- a/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -44,21 +44,27 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + ///////////////////////////////////////////////////////////////////////// // class basic_binary_iarchive - read serialized objects from a input binary stream template class basic_binary_iarchive : public detail::common_iarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; #else - friend class detail::interface_iarchive; +protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + #else + friend class detail::interface_iarchive; + #endif #endif // intermediate level to support override of operators // fot templates in the absence of partial function diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp index fc27123..2e72a1c 100644 --- a/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -126,7 +126,7 @@ public: template #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) struct apply { - typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; + typedef typename boost::serialization::is_bitwise_serializable< T >::type type; }; #else struct apply : public boost::serialization::is_bitwise_serializable< T > {}; @@ -178,7 +178,7 @@ basic_binary_iprimitive::load_binary( boost::serialization::throw_exception( archive_exception(archive_exception::input_stream_error) ); - std::memcpy(static_cast(address) + (count - s), &t, s); + std::memcpy(static_cast(address) + (count - s), &t, static_cast(s)); } } diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp index 01622b9..f8b53e9 100644 --- a/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -46,6 +46,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + ////////////////////////////////////////////////////////////////////// // class basic_binary_oarchive - write serialized objects to a binary output stream // note: this archive has no pretensions to portability. Archive format @@ -58,15 +62,17 @@ template class basic_binary_oarchive : public archive::detail::common_oarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; #else - friend class detail::interface_oarchive; +protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + #else + friend class detail::interface_oarchive; + #endif #endif // any datatype not specifed below will be handled by base class typedef detail::common_oarchive detail_common_oarchive; diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp index 53e44e4..ba070cd 100644 --- a/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -58,8 +58,7 @@ namespace archive { // class basic_binary_oprimitive - binary output of prmitives template -class basic_binary_oprimitive -{ +class basic_binary_oprimitive { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS friend class save_access; protected: @@ -122,7 +121,7 @@ public: template #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) struct apply { - typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; + typedef typename boost::serialization::is_bitwise_serializable< T >::type type; }; #else struct apply : public boost::serialization::is_bitwise_serializable< T > {}; @@ -170,7 +169,7 @@ basic_binary_oprimitive::save_binary( archive_exception(archive_exception::output_stream_error) ); //os.write( - // static_cast(address), + // static_cast(address), // count //); //BOOST_ASSERT(os.good()); diff --git a/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp b/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp index ca764e1..6bf8f71 100644 --- a/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -50,7 +50,7 @@ public: explicit basic_streambuf_locale_saver( state_type &s ) : s_save_( s ), a_save_( s.getloc() ) {} - basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) + explicit basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) : s_save_( s ), a_save_( s.pubimbue(a) ) {} ~basic_streambuf_locale_saver() diff --git a/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp index 729d51a..0e78ff6 100644 --- a/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -40,21 +40,27 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + ///////////////////////////////////////////////////////////////////////// // class basic_text_iarchive - read serialized objects from a input text stream template class basic_text_iarchive : public detail::common_iarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; #else - friend class detail::interface_iarchive; +protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + #else + friend class detail::interface_iarchive; + #endif #endif // intermediate level to support override of operators // fot templates in the absence of partial function diff --git a/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp index b927ec9..dabc3c8 100644 --- a/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -64,13 +64,8 @@ namespace archive { #endif template -class basic_text_iprimitive -{ -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +class basic_text_iprimitive { protected: -#else -public: -#endif IStream &is; io::ios_flags_saver flags_saver; io::ios_precision_saver precision_saver; @@ -78,18 +73,16 @@ public: #ifndef BOOST_NO_STD_LOCALE boost::scoped_ptr archive_locale; basic_streambuf_locale_saver< - BOOST_DEDUCED_TYPENAME IStream::char_type, - BOOST_DEDUCED_TYPENAME IStream::traits_type + typename IStream::char_type, + typename IStream::traits_type > locale_saver; #endif template void load(T & t) { - if(! is.fail()){ - is >> t; + if(is >> t) return; - } boost::serialization::throw_exception( archive_exception(archive_exception::input_stream_error) ); diff --git a/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp index dd10f65..bed9cd3 100644 --- a/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -42,23 +42,29 @@ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + ///////////////////////////////////////////////////////////////////////// // class basic_text_oarchive template class basic_text_oarchive : public detail::common_oarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ -|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560)) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; #else - friend class detail::interface_oarchive; +protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + #else + friend class detail::interface_oarchive; + #endif #endif + enum { none, eol, diff --git a/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp index 06885ad..73a0a62 100644 --- a/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -26,13 +26,14 @@ #include #include -#include // isnan #include #include // size_t #include #include #include +#include + #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #include #endif @@ -46,6 +47,8 @@ namespace std{ } // namespace std #endif +#include +#include #include #include #include @@ -65,11 +68,7 @@ class save_access; template class basic_text_oprimitive { -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS protected: -#else -public: -#endif OStream &os; io::ios_flags_saver flags_saver; io::ios_precision_saver precision_saver; @@ -77,21 +76,11 @@ public: #ifndef BOOST_NO_STD_LOCALE boost::scoped_ptr archive_locale; basic_streambuf_locale_saver< - BOOST_DEDUCED_TYPENAME OStream::char_type, - BOOST_DEDUCED_TYPENAME OStream::traits_type + typename OStream::char_type, + typename OStream::traits_type > locale_saver; #endif - // default saving of primitives. - template - void save(const T &t){ - if(os.fail()) - boost::serialization::throw_exception( - archive_exception(archive_exception::output_stream_error) - ); - os << t; - } - ///////////////////////////////////////////////////////// // fundamental types that need special treatment void save(const bool t){ @@ -123,33 +112,77 @@ public: save(static_cast(t)); } #endif - void save(const float t) - { - // must be a user mistake - can't serialize un-initialized data + + ///////////////////////////////////////////////////////// + // saving of any types not listed above + + template + void save_impl(const T &t, boost::mpl::bool_ &){ if(os.fail()) boost::serialization::throw_exception( archive_exception(archive_exception::output_stream_error) ); - os << std::setprecision(std::numeric_limits::digits10 + 2); os << t; } - void save(const double t) - { + + ///////////////////////////////////////////////////////// + // floating point types need even more special treatment + // the following determines whether the type T is some sort + // of floating point type. Note that we then assume that + // the stream << operator is defined on that type - if not + // we'll get a compile time error. This is meant to automatically + // support synthesized types which support floating point + // operations. Also it should handle compiler dependent types + // such long double. Due to John Maddock. + + template + struct is_float { + typedef typename mpl::bool_< + boost::is_floating_point::value + || (std::numeric_limits::is_specialized + && !std::numeric_limits::is_integer + && !std::numeric_limits::is_exact + && std::numeric_limits::max_exponent) + >::type type; + }; + + template + void save_impl(const T &t, boost::mpl::bool_ &){ // must be a user mistake - can't serialize un-initialized data if(os.fail()) boost::serialization::throw_exception( archive_exception(archive_exception::output_stream_error) ); - os << std::setprecision(std::numeric_limits::digits10 + 2); - os << t; + // 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: + // www.eecs.berkeley.edu/~wkahan/ieee754status/ieee754.ps + // const unsigned int digits = (std::numeric_limits::digits * 3010) / 10000; + // note: I've commented out the above because I didn't get good results. e.g. + // in one case I got a difference of 19 units. + #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS + const unsigned int digits = std::numeric_limits::max_digits10; + #else + const unsigned int digits = std::numeric_limits::digits10 + 2; + #endif + os << std::setprecision(digits) << std::scientific << t; } + + template + void save(const T & t){ + boost::io::ios_flags_saver fs(os); + boost::io::ios_precision_saver ps(os); + typename is_float::type tf; + save_impl(t, tf); + } + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_text_oprimitive(OStream & os, bool no_codecvt); BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) ~basic_text_oprimitive(); public: // unformatted append of one character - void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){ + void put(typename OStream::char_type c){ if(os.fail()) boost::serialization::throw_exception( archive_exception(archive_exception::output_stream_error) diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp index c99d94f..a4ad3a2 100644 --- a/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp index d7b8bfd..5047fef 100644 --- a/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -37,21 +37,27 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + ///////////////////////////////////////////////////////////////////////// // class xml_iarchive - read serialized objects from a input text stream template class basic_xml_iarchive : public detail::common_iarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; #else - friend class detail::interface_oarchive; +protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + #else + friend class detail::interface_iarchive; + #endif #endif unsigned int depth; BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp index b571372..c986833 100644 --- a/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -36,24 +36,29 @@ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + ////////////////////////////////////////////////////////////////////// // class basic_xml_oarchive - write serialized objects to a xml output stream template class basic_xml_oarchive : public detail::common_oarchive { -protected: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: -#elif defined(BOOST_MSVC) +#else +protected: +#endif +#if BOOST_WORKAROUND(BOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_oarchive; - friend class save_access; #else friend class detail::interface_oarchive; - friend class save_access; #endif + friend class save_access; // special stuff for xml output unsigned int depth; bool indent_next; diff --git a/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp index 638d996..ce67cca 100644 --- a/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -25,44 +25,7 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { -namespace archive { - -// do not derive from the classes below. If you want to extend this functionality -// via inhertance, derived from text_iarchive_impl instead. This will -// preserve correct static polymorphism. - -// same as binary_iarchive below - without the shared_ptr_helper -class naked_binary_iarchive : - public binary_iarchive_impl< - boost::archive::naked_binary_iarchive, - std::istream::char_type, - std::istream::traits_type - > -{ -public: - naked_binary_iarchive(std::istream & is, unsigned int flags = 0) : - binary_iarchive_impl< - naked_binary_iarchive, std::istream::char_type, std::istream::traits_type - >(is, flags) - {} - naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) : - binary_iarchive_impl< - naked_binary_iarchive, std::istream::char_type, std::istream::traits_type - >(bsb, flags) - {} -}; - -} // namespace archive -} // namespace boost - -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - -namespace boost { +namespace boost { namespace archive { // do not derive from this class. If you want to extend this functionality @@ -73,9 +36,7 @@ class binary_iarchive : boost::archive::binary_iarchive, std::istream::char_type, std::istream::traits_type - >, - public detail::shared_ptr_helper -{ + >{ public: binary_iarchive(std::istream & is, unsigned int flags = 0) : binary_iarchive_impl< diff --git a/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp b/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp index 32c476d..a9afe61 100644 --- a/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -29,6 +29,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + template class binary_iarchive_impl : public basic_binary_iprimitive, @@ -37,10 +41,18 @@ class binary_iarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_iarchive; - friend class basic_binary_iarchive; - friend class load_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend basic_binary_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class basic_binary_iarchive; + friend class load_access; + #endif #endif // note: the following should not needed - but one compiler (vc 7.1) // fails to compile one test (test_shared_ptr) without it !!! diff --git a/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp index 2aac14f..89a86da 100644 --- a/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -50,8 +50,6 @@ public: {} }; -typedef binary_oarchive naked_binary_oarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp b/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp index 7ca773b..a8c9733 100644 --- a/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -30,6 +30,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + template class binary_oarchive_impl : public basic_binary_oprimitive, @@ -38,10 +42,18 @@ class binary_oarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_oarchive; - friend class basic_binary_oarchive; - friend class save_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_binary_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_binary_oarchive; + friend class save_access; + #endif #endif // note: the following should not needed - but one compiler (vc 7.1) // fails to compile one test (test_shared_ptr) without it !!! diff --git a/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp index b5f6a71..775d8f8 100644 --- a/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -28,43 +28,6 @@ namespace boost { namespace archive { -// same as binary_wiarchive below - without the shared_ptr_helper -class naked_binary_wiarchive : - public binary_iarchive_impl< - boost::archive::naked_binary_wiarchive, - std::wistream::char_type, - std::wistream::traits_type - > -{ -public: - naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) : - binary_iarchive_impl< - naked_binary_wiarchive, - std::wistream::char_type, - std::wistream::traits_type - >(is, flags) - {} - naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) : - binary_iarchive_impl< - naked_binary_wiarchive, - std::wistream::char_type, - std::wistream::traits_type - >(bsb, flags) - {} -}; - -} // namespace archive -} // namespace boost - -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - -namespace boost { -namespace archive { - class binary_wiarchive : public binary_iarchive_impl< binary_wiarchive, std::wistream::char_type, std::wistream::traits_type diff --git a/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp index 2075dac..a8817d6 100644 --- a/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -49,8 +49,6 @@ public: {} }; -typedef binary_woarchive naked_binary_woarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/codecvt_null.hpp b/3rdParty/Boost/src/boost/archive/codecvt_null.hpp index 910b261..caeefee 100644 --- a/3rdParty/Boost/src/boost/archive/codecvt_null.hpp +++ b/3rdParty/Boost/src/boost/archive/codecvt_null.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_CODECVT_NULL_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp b/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp index 6d2eec4..53fcae4 100644 --- a/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_SERIALIZER_MAP_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp b/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp index 05956f0..79b0e49 100644 --- a/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp b/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp index 4d4efcd..683d191 100644 --- a/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp index f62987e..fdafbbf 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -22,10 +22,10 @@ #include #include -#include #include #include #include +#include #include // must be the last header namespace boost { @@ -42,7 +42,8 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; ////////////////////////////////////////////////////////////////////// // class basic_iarchive - read serialized objects from a input stream class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : - private boost::noncopyable + private boost::noncopyable, + public boost::archive::detail::helper_collection { friend class basic_iarchive_impl; // hide implementation of this class to minimize header conclusion @@ -99,12 +100,6 @@ public: } // namespace archive } // namespace boost -// required by smart_cast for compilers not implementing -// partial template specialization -BOOST_TT_BROKEN_COMPILER_SPEC( - boost::archive::detail::basic_iarchive -) - #include // pops abi_suffix.hpp pragmas #endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp index 2f4f6d8..3bff3e1 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp index 402e569..f65d110 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -20,14 +20,12 @@ #include #include -#include - // can't use this - much as I'd like to as borland doesn't support it // #include #include #include - +#include #include // must be the last header namespace boost { @@ -41,10 +39,12 @@ namespace detail { class basic_oarchive_impl; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; + ////////////////////////////////////////////////////////////////////// // class basic_oarchive - write serialized objects to an output stream class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : - private boost::noncopyable + private boost::noncopyable, + public boost::archive::detail::helper_collection { friend class basic_oarchive_impl; // hide implementation of this class to minimize header conclusion @@ -95,12 +95,6 @@ public: } // namespace archive } // namespace boost -// required by smart_cast for compilers not implementing -// partial template specialization -BOOST_TT_BROKEN_COMPILER_SPEC( - boost::archive::detail::basic_oarchive -) - #include // pops abi_suffix.hpp pragmas #endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp index 74af7e6..6ae063f 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp index d957b83..86badc1 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -52,10 +52,11 @@ protected: #endif ~basic_pointer_iserializer(); public: + virtual void * heap_allocation() const = 0; virtual const basic_iserializer & get_basic_serializer() const = 0; virtual void load_object_ptr( basic_iarchive & ar, - void * & x, + void * x, const unsigned int file_version ) const = 0; }; diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp index b0d3fb9..bafc46a 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp index 5dbd886..c7d3b4b 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp index a991ea1..202c20e 100644 --- a/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp @@ -2,7 +2,7 @@ #define BOOST_SERIALIZER_MAP_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/check.hpp b/3rdParty/Boost/src/boost/archive/detail/check.hpp index c9cba51..10034e7 100644 --- a/3rdParty/Boost/src/boost/archive/detail/check.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/check.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_CHECK_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #pragma inline_depth(511) #pragma inline_recursion(on) @@ -50,7 +50,7 @@ namespace detail { template inline void check_object_level(){ typedef - BOOST_DEDUCED_TYPENAME mpl::greater_equal< + typename mpl::greater_equal< serialization::implementation_level< T >, mpl::int_ >::type typex; @@ -63,12 +63,12 @@ inline void check_object_level(){ template inline void check_object_versioning(){ typedef - BOOST_DEDUCED_TYPENAME mpl::or_< - BOOST_DEDUCED_TYPENAME mpl::greater< + typename mpl::or_< + typename mpl::greater< serialization::implementation_level< T >, mpl::int_ >, - BOOST_DEDUCED_TYPENAME mpl::equal_to< + typename mpl::equal_to< serialization::version< T >, mpl::int_<0> > @@ -83,7 +83,7 @@ inline void check_object_tracking(){ // presume it has already been determined that // T is not a const BOOST_STATIC_ASSERT(! boost::is_const< T >::value); - typedef BOOST_DEDUCED_TYPENAME mpl::equal_to< + typedef typename mpl::equal_to< serialization::tracking_level< T >, mpl::int_ >::type typex; @@ -105,13 +105,13 @@ inline void check_pointer_level(){ // we should only invoke this once we KNOW that T // has been used as a pointer!! typedef - BOOST_DEDUCED_TYPENAME mpl::or_< - BOOST_DEDUCED_TYPENAME mpl::greater< + typename mpl::or_< + typename mpl::greater< serialization::implementation_level< T >, mpl::int_ >, - BOOST_DEDUCED_TYPENAME mpl::not_< - BOOST_DEDUCED_TYPENAME mpl::equal_to< + typename mpl::not_< + typename mpl::equal_to< serialization::tracking_level< T >, mpl::int_ > @@ -139,7 +139,7 @@ inline void check_pointer_level(){ template void inline check_pointer_tracking(){ - typedef BOOST_DEDUCED_TYPENAME mpl::greater< + typedef typename mpl::greater< serialization::tracking_level< T >, mpl::int_ >::type typex; @@ -151,10 +151,10 @@ void inline check_pointer_tracking(){ template inline void check_const_loading(){ typedef - BOOST_DEDUCED_TYPENAME mpl::or_< - BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >, - BOOST_DEDUCED_TYPENAME mpl::not_< - BOOST_DEDUCED_TYPENAME boost::is_const< T > + typename mpl::or_< + typename boost::serialization::is_wrapper< T >, + typename mpl::not_< + typename boost::is_const< T > > >::type typex; // cannot load data into a "const" object unless it's a diff --git a/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp index 54c07c3..45e6d34 100644 --- a/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp index 7962063..0d7474b 100644 --- a/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/decl.hpp b/3rdParty/Boost/src/boost/archive/detail/decl.hpp index 9695001..44e22be 100644 --- a/3rdParty/Boost/src/boost/archive/detail/decl.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/decl.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_DECL_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/helper_collection.hpp b/3rdParty/Boost/src/boost/archive/detail/helper_collection.hpp new file mode 100644 index 0000000..ba3c60c --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/helper_collection.hpp @@ -0,0 +1,111 @@ +#ifndef BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP +#define BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// helper_collection.hpp: archive support for run-time helpers + +// (C) Copyright 2002-2008 Robert Ramey and Joaquin M Lopez Munoz +// 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) + +// See http://www.boost.org for updates, documentation, and revision history. + +#include // NULL +#include +#include +#include +#include +#include + +#include + +#ifdef BOOST_NO_CXX11_SMART_PTR + #include + #include +#endif + +namespace boost { + +namespace archive { +namespace detail { + +class helper_collection +{ + helper_collection(const helper_collection&); // non-copyable + helper_collection& operator = (const helper_collection&); // non-copyable + + // note: we dont' actually "share" the function object pointer + // we only use shared_ptr to make sure that it get's deleted + + #ifndef BOOST_NO_CXX11_SMART_PTR + typedef std::pair< + const std::type_info *, + std::shared_ptr + > helper_value_type; + template + std::shared_ptr make_helper_ptr(){ + return std::make_shared(); + } + #else + typedef std::pair< + const std::type_info *, + boost::shared_ptr + > helper_value_type; + template + boost::shared_ptr make_helper_ptr(){ + return boost::make_shared(); + } + #endif + typedef std::vector collection; + collection m_collection; + + struct predicate { + const std::type_info * m_ti; + bool operator()(helper_value_type const &rhs) const { + return *m_ti == *rhs.first; + } + predicate(const std::type_info * ti) : + m_ti(ti) + {} + }; +protected: + helper_collection(){} + ~helper_collection(){} +public: + template + Helper& get_helper(Helper * = NULL) { + + const std::type_info * eti = & typeid(Helper); + + collection::const_iterator it = + std::find_if( + m_collection.begin(), + m_collection.end(), + predicate(eti) + ); + + void * rval; + if(it == m_collection.end()){ + m_collection.push_back( + std::make_pair(eti, make_helper_ptr()) + ); + rval = m_collection.back().second.get(); + } + else{ + rval = it->second.get(); + } + return *static_cast(rval); + } +}; + +} // namespace detail +} // namespace serialization +} // namespace boost + +#endif // BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp index 0648752..b7bd165 100644 --- a/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp index e8db7a2..7ae7176 100644 --- a/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp index 53765af..cf547de 100644 --- a/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #pragma inline_depth(511) #pragma inline_recursion(on) @@ -23,7 +23,6 @@ // See http://www.boost.org for updates, documentation, and revision history. #include // for placement new -#include // for auto_ptr #include // size_t, NULL #include @@ -59,14 +58,11 @@ namespace std{ #include -#define DONT_USE_HAS_NEW_OPERATOR ( \ +#if ! ( \ defined(__BORLANDC__) \ || BOOST_WORKAROUND(__IBMCPP__, < 1210) \ - || defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) \ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ ) - -#if ! DONT_USE_HAS_NEW_OPERATOR #include #endif @@ -127,7 +123,7 @@ protected: explicit iserializer() : basic_iserializer( boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type >::get_const_instance() ) @@ -197,85 +193,84 @@ BOOST_DLLEXPORT void iserializer::load_object_data( # pragma warning(disable : 4511 4512) #endif -template -class pointer_iserializer : - public basic_pointer_iserializer -{ -private: - virtual const basic_iserializer & get_basic_serializer() const { - return boost::serialization::singleton< - iserializer - >::get_const_instance(); - } - BOOST_DLLEXPORT virtual void load_object_ptr( - basic_iarchive & ar, - void * & x, - const unsigned int file_version - ) const BOOST_USED; -protected: - // this should alway be a singleton so make the constructor protected - pointer_iserializer(); - ~pointer_iserializer(); -}; - -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - -// note trick to be sure that operator new is using class specific -// version if such exists. Due to Peter Dimov. -// note: the following fails if T has no default constructor. -// otherwise it would have been ideal -//struct heap_allocator : public T -//{ -// T * invoke(){ -// return ::new(sizeof(T)); -// } -//} +// 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". +// 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 +// operator is also defined for the class T. template -struct heap_allocator -{ +struct heap_allocation { // boost::has_new_operator< T > doesn't work on these compilers #if DONT_USE_HAS_NEW_OPERATOR // This doesn't handle operator new overload for class T - static T * invoke(){ + static T * invoke_new(){ return static_cast(operator new(sizeof(T))); } + static viod invoke_delete(){ + (operator delete(sizeof(T))); + } #else + // note: we presume that a true value for has_new_operator + // implies the existence of a class specific delete operator as well + // as a class specific new operator. struct has_new_operator { - static T* invoke() { + static T * invoke_new() { return static_cast((T::operator new)(sizeof(T))); } + static void invoke_delete(T * t) { + // if compilation fails here, the likely cause that the class + // T has a class specific new operator but no class specific + // delete operator which matches the following signature. Fix + // your program to have this. Note that adding operator delete + // with only one parameter doesn't seem correct to me since + // the standard(3.7.4.2) says " + // "If a class T has a member deallocation function named + // 'operator delete' with exactly one parameter, then that function + // is a usual (non-placement) deallocation function" which I take + // to mean that it will call the destructor of type T which we don't + // want to do here. + // Note: reliance upon automatic conversion from T * to void * here + (T::operator delete)(t, sizeof(T)); + } }; struct doesnt_have_new_operator { - static T* invoke() { + static T* invoke_new() { return static_cast(operator new(sizeof(T))); } + static void invoke_delete(T * t) { + // Note: I'm reliance upon automatic conversion from T * to void * here + (operator delete)(t); + } }; - static T * invoke() { - typedef BOOST_DEDUCED_TYPENAME + static T * invoke_new() { + typedef typename mpl::eval_if< boost::has_new_operator< T >, mpl::identity, mpl::identity >::type typex; - return typex::invoke(); + return typex::invoke_new(); + } + static void invoke_delete(T *t) { + typedef typename + mpl::eval_if< + boost::has_new_operator< T >, + mpl::identity, + mpl::identity + >::type typex; + typex::invoke_delete(t); } #endif -}; - -// due to Martin Ecker -template -class auto_ptr_with_deleter -{ -public: - explicit auto_ptr_with_deleter(T* p) : - m_p(p) - {} - ~auto_ptr_with_deleter(){ - if (m_p) - boost::serialization::access::destroy(m_p); + explicit heap_allocation(){ + m_p = invoke_new(); + } + ~heap_allocation(){ + if (0 != m_p) + invoke_delete(m_p); } T* get() const { return m_p; @@ -283,60 +278,88 @@ public: T* release() { T* p = m_p; - m_p = NULL; + m_p = 0; return p; } private: T* m_p; }; +template +class pointer_iserializer : + public basic_pointer_iserializer +{ +private: + virtual void * heap_allocation() const { + detail::heap_allocation h; + T * t = h.get(); + h.release(); + return t; + } + virtual const basic_iserializer & get_basic_serializer() const { + return boost::serialization::singleton< + iserializer + >::get_const_instance(); + } + BOOST_DLLEXPORT virtual void load_object_ptr( + basic_iarchive & ar, + void * x, + const unsigned int file_version + ) const BOOST_USED; +protected: + // this should alway be a singleton so make the constructor protected + pointer_iserializer(); + ~pointer_iserializer(); +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + // note: BOOST_DLLEXPORT is so that code for polymorphic class // serialized only through base class won't get optimized out template BOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( basic_iarchive & ar, - void * & x, + void * t, const unsigned int file_version ) const { Archive & ar_impl = boost::serialization::smart_cast_reference(ar); - auto_ptr_with_deleter< T > ap(heap_allocator< T >::invoke()); - if(NULL == ap.get()) - boost::serialization::throw_exception(std::bad_alloc()) ; - - T * t = ap.get(); - x = t; + // note that the above will throw std::bad_alloc if the allocation + // fails so we don't have to address this contingency here. // catch exception during load_construct_data so that we don't // automatically delete the t which is most likely not fully // constructed BOOST_TRY { - // this addresses an obscure situtation 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( ar_impl, - t, + static_cast(t), file_version ); } BOOST_CATCH(...){ - ap.release(); + // if we get here the load_construct failed. The heap_allocation + // will be automatically deleted so we don't have to do anything + // special here. BOOST_RETHROW; } BOOST_CATCH_END - ar_impl >> boost::serialization::make_nvp(NULL, * t); - ap.release(); + ar_impl >> boost::serialization::make_nvp(NULL, * static_cast(t)); } template pointer_iserializer::pointer_iserializer() : basic_pointer_iserializer( boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type >::get_const_instance() ) @@ -405,7 +428,7 @@ struct load_non_pointer_type { template static void invoke(Archive & ar, T &t){ - typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + typedef typename mpl::eval_if< // if its primitive mpl::equal_to< boost::serialization::implementation_level< T >, @@ -413,7 +436,7 @@ struct load_non_pointer_type { >, mpl::identity, // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< // class info / version mpl::greater_equal< boost::serialization::implementation_level< T >, @@ -422,7 +445,7 @@ struct load_non_pointer_type { // do standard load mpl::identity, // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< // no tracking mpl::equal_to< boost::serialization::tracking_level< T >, @@ -466,7 +489,7 @@ struct load_pointer_type { // class pointer. Inhibiting code generation for this // permits abstract base classes to be used - note: exception // virtual serialize functions used for plug-ins - typedef BOOST_DEDUCED_TYPENAME + typedef typename mpl::eval_if< boost::serialization::is_abstract, boost::mpl::identity, @@ -482,18 +505,21 @@ struct load_pointer_type { const T & ) { // tweak the pointer back to the base class - return static_cast( - const_cast( - boost::serialization::void_upcast( - eti, - boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME - boost::serialization::type_info_implementation< T >::type - >::get_const_instance(), - t - ) + void * upcast = const_cast( + boost::serialization::void_upcast( + eti, + boost::serialization::singleton< + typename + boost::serialization::type_info_implementation< T >::type + >::get_const_instance(), + t ) ); + if(NULL == upcast) + boost::serialization::throw_exception( + archive_exception(archive_exception::unregistered_class) + ); + return static_cast(upcast); } template @@ -544,7 +570,7 @@ template struct load_array_type { template static void invoke(Archive &ar, T &t){ - typedef BOOST_DEDUCED_TYPENAME remove_extent< T >::type value_type; + typedef typename remove_extent< T >::type value_type; // convert integers to correct enum to load // determine number of elements in the array. Consider the @@ -576,13 +602,13 @@ inline void load(Archive & ar, T &t){ // handled below. detail::check_const_loading< T >(); typedef - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity > ,//else - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity > ,//else - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity > ,//else mpl::identity > diff --git a/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp index 7d2694d..7a7e239 100644 --- a/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_OSERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #pragma inline_depth(511) #pragma inline_recursion(on) @@ -106,7 +106,7 @@ public: explicit BOOST_DLLEXPORT oserializer() : basic_oserializer( boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type >::get_const_instance() ) @@ -205,7 +205,7 @@ template pointer_oserializer::pointer_oserializer() : basic_pointer_oserializer( boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type >::get_const_instance() ) @@ -275,7 +275,7 @@ struct save_non_pointer_type { template static void invoke(Archive & ar, const T & t){ typedef - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< // if its primitive mpl::equal_to< boost::serialization::implementation_level< T >, @@ -283,7 +283,7 @@ struct save_non_pointer_type { >, mpl::identity, // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< // class info / version mpl::greater_equal< boost::serialization::implementation_level< T >, @@ -292,7 +292,7 @@ struct save_non_pointer_type { // do standard save mpl::identity, // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< // no tracking mpl::equal_to< boost::serialization::tracking_level< T >, @@ -342,7 +342,7 @@ struct save_pointer_type { // permits abstract base classes to be used - note: exception // virtual serialize functions used for plug-ins typedef - BOOST_DEDUCED_TYPENAME mpl::eval_if< + typename mpl::eval_if< boost::serialization::is_abstract< T >, mpl::identity, mpl::identity @@ -373,10 +373,10 @@ struct save_pointer_type { Archive &ar, T & t ){ - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type const & i = boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + typename boost::serialization::type_info_implementation< T >::type >::get_const_instance(); @@ -452,7 +452,7 @@ struct save_pointer_type { ){ check_pointer_level< T >(); check_pointer_tracking< T >(); - typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + typedef typename mpl::eval_if< is_polymorphic< T >, mpl::identity, mpl::identity @@ -490,7 +490,7 @@ struct save_array_type { template static void invoke(Archive &ar, const T &t){ - typedef BOOST_DEDUCED_TYPENAME boost::remove_extent< T >::type value_type; + typedef typename boost::remove_extent< T >::type value_type; save_access::end_preamble(ar); // consider alignment @@ -509,13 +509,13 @@ struct save_array_type template inline void save(Archive & ar, /*const*/ T &t){ typedef - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity >, //else - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity >, //else - BOOST_DEDUCED_TYPENAME mpl::eval_if, + typename mpl::eval_if, mpl::identity >, //else mpl::identity > diff --git a/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp b/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp index e31ae46..81a19b9 100644 --- a/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp @@ -81,7 +81,7 @@ void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {} namespace boost { namespace archive { namespace detail { \ \ template \ -BOOST_DEDUCED_TYPENAME _ptr_serialization_support::type \ +typename _ptr_serialization_support::type \ instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \ \ }}} diff --git a/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp b/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp index bd859ff..b2430d5 100644 --- a/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp +++ b/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp @@ -7,15 +7,17 @@ #ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP -#define BOOST_UTF8_BEGIN_NAMESPACE \ - namespace boost { namespace archive { namespace detail { -#define BOOST_UTF8_DECL -#define BOOST_UTF8_END_NAMESPACE }}} +#ifdef BOOST_NO_CXX11_HDR_CODECVT + #define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace archive { namespace detail { + #define BOOST_UTF8_DECL + #define BOOST_UTF8_END_NAMESPACE }}} -#include - -#undef BOOST_UTF8_END_NAMESPACE -#undef BOOST_UTF8_DECL -#undef BOOST_UTF8_BEGIN_NAMESPACE + #include + #undef BOOST_UTF8_END_NAMESPACE + #undef BOOST_UTF8_DECL + #undef BOOST_UTF8_BEGIN_NAMESPACE +#endif // BOOST_NO_CXX11_HDR_CODECVT #endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP + diff --git a/3rdParty/Boost/src/boost/archive/dinkumware.hpp b/3rdParty/Boost/src/boost/archive/dinkumware.hpp index bfa828d..90ba627 100644 --- a/3rdParty/Boost/src/boost/archive/dinkumware.hpp +++ b/3rdParty/Boost/src/boost/archive/dinkumware.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_DINKUMWARE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp index 8ea39f7..b8e7f45 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp @@ -12,7 +12,7 @@ #include #include -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; @@ -51,6 +51,8 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iarchive::init(){ // read signature in an archive version independent manner std::string file_signature; + + #if 0 // commented out since it interfers with derivation try { std::size_t l; this->This()->load(l); @@ -69,6 +71,11 @@ basic_binary_iarchive::init(){ // will cause invalid_signature archive exception to be thrown below file_signature = ""; } + #else + // https://svn.boost.org/trac/boost/ticket/7301 + * this->This() >> file_signature; + #endif + if(file_signature != BOOST_ARCHIVE_SIGNATURE()) boost::serialization::throw_exception( archive_exception(archive_exception::invalid_signature) @@ -113,10 +120,7 @@ basic_binary_iarchive::init(){ #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) this->set_library_version(input_library_version); #else - #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) - detail:: - #endif - basic_iarchive::set_library_version(input_library_version); + detail::basic_iarchive::set_library_version(input_library_version); #endif if(BOOST_ARCHIVE_VERSION() < input_library_version) diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp index e0f5c2e..9e2340e 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp @@ -28,6 +28,7 @@ namespace std{ #include #include #include +#include namespace boost { namespace archive { diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp index dec2cd7..467fd6f 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp @@ -12,7 +12,7 @@ #include #include -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp index 02b5ffa..509decb 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp @@ -31,6 +31,7 @@ namespace std{ using ::wcslen; } #include #include +#include namespace boost { namespace archive { diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp index 0a246b7..8d364f9 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp @@ -11,7 +11,7 @@ #include #include -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; @@ -62,10 +62,7 @@ basic_text_iarchive::init(void){ #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) this->set_library_version(input_library_version); #else - #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) - detail:: - #endif - basic_iarchive::set_library_version(input_library_version); + detail::basic_iarchive::set_library_version(input_library_version); #endif // extra little .t is to get around borland quirk diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp index ad6a6d5..d0da284 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp @@ -30,10 +30,10 @@ namespace std{ #include #include -namespace boost { +namespace boost { namespace archive { -namespace { +namespace detail { template bool is_whitespace(CharType c); @@ -48,7 +48,7 @@ namespace { return 0 != std::iswspace(t); } #endif -} +} // detail // translate base64 text into binary and copy into buffer // until buffer is full. @@ -58,7 +58,7 @@ basic_text_iprimitive::load_binary( void *address, std::size_t count ){ - typedef BOOST_DEDUCED_TYPENAME IStream::char_type CharType; + typedef typename IStream::char_type CharType; if(0 == count) return; @@ -73,7 +73,7 @@ basic_text_iprimitive::load_binary( archive_exception(archive_exception::input_stream_error) ); // convert from base64 to binary - typedef BOOST_DEDUCED_TYPENAME + typedef typename iterators::transform_width< iterators::binary_from_base64< iterators::remove_whitespace< @@ -86,33 +86,31 @@ basic_text_iprimitive::load_binary( ,CharType > binary; - - binary ti_begin = binary( + + binary i = binary( BOOST_MAKE_PFTO_WRAPPER( iterators::istream_iterator(is) ) ); - + char * caddr = static_cast(address); // take care that we don't increment anymore than necessary - while(--count > 0){ - *caddr++ = static_cast(*ti_begin); - ++ti_begin; + while(count-- > 0){ + *caddr++ = static_cast(*i++); } - *caddr++ = static_cast(*ti_begin); - - iterators::istream_iterator i; + + // skip over any excess input for(;;){ - BOOST_DEDUCED_TYPENAME IStream::int_type r; + typename IStream::int_type r; r = is.get(); if(is.eof()) break; - if(is_whitespace(static_cast(r))) + if(detail::is_whitespace(static_cast(r))) break; } } - + template BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_text_iprimitive::basic_text_iprimitive( @@ -130,7 +128,7 @@ basic_text_iprimitive::basic_text_iprimitive( archive_locale.reset( add_facet( std::locale::classic(), - new codecvt_null + new codecvt_null ) ); is.imbue(* archive_locale); diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp index 34e6995..4170c97 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp @@ -11,7 +11,7 @@ #include #include -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp index cacab61..33ab4a8 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp @@ -9,6 +9,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include // NULL +#include // std::copy #include #include @@ -30,7 +31,7 @@ basic_text_oprimitive::save_binary( const void *address, std::size_t count ){ - typedef BOOST_DEDUCED_TYPENAME OStream::char_type CharType; + typedef typename OStream::char_type CharType; if(0 == count) return; @@ -51,7 +52,7 @@ basic_text_oprimitive::save_binary( 8 > > - ,72 + ,76 ,const char // cwpro8 needs this > base64_text; @@ -90,7 +91,7 @@ basic_text_oprimitive::basic_text_oprimitive( archive_locale.reset( add_facet( std::locale::classic(), - new codecvt_null + new codecvt_null ) ); os.imbue(* archive_locale); diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp b/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp index 807ed07..66ca1f0 100644 --- a/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp +++ b/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -50,11 +50,6 @@ #include #include -// supress noise -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) -# pragma warning (disable : 4786) // too long name, harmless warning -#endif - #include #include diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp index c7cbc7f..dc62eed 100644 --- a/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp @@ -98,9 +98,9 @@ xml_iarchive_impl::load(wchar_t * ws){ const char * end = start + s.size(); while(start < end){ wchar_t wc; - int result = std::mbtowc(&wc, start, end - start); - if(0 < result){ - start += result; + int length = std::mbtowc(&wc, start, end - start); + if(0 < length){ + start += length; *ws++ = wc; continue; } diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp index 8ab954f..ab1a217 100644 --- a/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp @@ -8,7 +8,7 @@ #include #include -#include +#include // std::copy #include #include // strlen diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp index 9dde66c..a4665ad 100644 --- a/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp @@ -1,5 +1,5 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// xml_wiprimitive.cpp: +// xml_wiarchive_impl.ipp: // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Distributed under the Boost Software License, Version 1.0. (See @@ -8,8 +8,6 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include // for BOOST_DEDUCED_TYPENAME - #include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ @@ -21,7 +19,7 @@ namespace std{ #ifndef BOOST_NO_STD_WSTREAMBUF #include -#include +#include // std::copy #include // Dinkumware and RogueWave #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) @@ -34,9 +32,16 @@ namespace std{ #include #include -#include -#include +#ifndef BOOST_NO_CXX11_HDR_CODECVT + #include + namespace boost { namespace archive { namespace detail { + typedef std::codecvt_utf8 utf8_codecvt_facet; + } } } +#else + #include +#endif +#include #include #include @@ -167,7 +172,7 @@ xml_wiarchive_impl::xml_wiarchive_impl( if(0 == (flags & no_codecvt)){ archive_locale.reset( add_facet( - std::locale::classic(), + is_.getloc(), new boost::archive::detail::utf8_codecvt_facet ) ); diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp index 3bf42bd..6092a91 100644 --- a/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp +++ b/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp @@ -11,15 +11,14 @@ #include #include -#include +#include // std::copy #include -#include // msvc 6.0 needs this to suppress warnings - // for BOOST_DEDUCED_TYPENAME #include // strlen #include // mbtowc #include // wcslen +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::strlen; @@ -39,7 +38,14 @@ namespace std{ #include #include -#include +#ifndef BOOST_NO_CXX11_HDR_CODECVT + #include + namespace boost { namespace archive { namespace detail { + typedef std::codecvt_utf8 utf8_codecvt_facet; + } } } +#else + #include +#endif namespace boost { namespace archive { @@ -128,26 +134,27 @@ xml_woarchive_impl::xml_woarchive_impl( // a) before output is invoked or // b) after flush has been called. This prevents one-to-many // transforms (such as one to many transforms from getting - // mixed up. Unfortunately, STLPort doesn't respect b) above - // so the restoration of the original archive locale done by - // the locale_saver doesn't get processed, - // before the current one is destroyed. - // so the codecvt doesn't get replaced with the orginal - // so closing the stream invokes codecvt::do_unshift - // so it crashes because the corresponding locale that contained - // the codecvt isn't around any more. - // we can hack around this by using a static codecvt that never - // gets destroyed. + // mixed up. if(0 == (flags & no_codecvt)){ boost::archive::detail::utf8_codecvt_facet *pfacet; #if defined(__SGI_STL_PORT) - static boost::archive::detail::utf8_codecvt_facet + // Unfortunately, STLPort doesn't respect b) above + // so the restoration of the original archive locale done by + // the locale_saver doesn't get processed, + // before the current one is destroyed. + // so the codecvt doesn't get replaced with the orginal + // so closing the stream invokes codecvt::do_unshift + // so it crashes because the corresponding locale that contained + // the codecvt isn't around any more. + // we can hack around this by using a static codecvt that never + // gets destroyed. + static boost::archive::detail::utf8_codecvt_facet facet(static_cast(1)); pfacet = & facet; #else pfacet = new boost::archive::detail::utf8_codecvt_facet; #endif - archive_locale.reset(add_facet(std::locale::classic(), pfacet)); + archive_locale.reset(add_facet(os_.getloc(), pfacet)); os.imbue(* archive_locale); } if(0 == (flags & no_header)) diff --git a/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp b/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp index ecb916a..836d93d 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -19,7 +19,6 @@ #include #include // size_t -#include // for BOOST_DEDUCED_TYPENAME #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; @@ -57,7 +56,7 @@ struct from_6_bit { } // namespace detail // note: what we would like to do is -// template +// template // typedef transform_iterator< // from_6_bit, // transform_width @@ -69,10 +68,10 @@ struct from_6_bit { // a templated constructor. This makes it incompatible with the dataflow // ideal. This is also addressed here. -//template +//template template< class Base, - class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type + class CharType = typename boost::iterator_value::type > class base64_from_binary : public transform_iterator< @@ -82,7 +81,7 @@ class base64_from_binary : { friend class boost::iterator_core_access; typedef transform_iterator< - BOOST_DEDUCED_TYPENAME detail::from_6_bit, + typename detail::from_6_bit, Base > super_t; diff --git a/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp b/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp index 60f23f3..9d2c87e 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -18,7 +18,6 @@ #include -#include // for BOOST_DEDUCED_TYPENAME #include #include #include @@ -43,7 +42,7 @@ struct to_6_bit { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, - 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, + 52,53,54,55,56,57,58,59,60,61,-1,-1,-1, 0,-1,-1, // render '=' as 0 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, @@ -67,7 +66,7 @@ struct to_6_bit { } // namespace detail // note: what we would like to do is -// template +// template // typedef transform_iterator< // from_6_bit, // transform_width @@ -81,7 +80,7 @@ struct to_6_bit { template< class Base, - class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type + class CharType = typename boost::iterator_value::type > class binary_from_base64 : public transform_iterator< diff --git a/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp b/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp index 1d655a1..e3e1860 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/iterators/escape.hpp b/3rdParty/Boost/src/boost/archive/iterators/escape.hpp index bb527d4..a1fee91 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/escape.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/escape.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -19,7 +19,6 @@ #include #include // NULL -#include // for BOOST_DEDUCED_TYPENAME #include #include @@ -35,16 +34,16 @@ class escape : public boost::iterator_adaptor< Derived, Base, - BOOST_DEDUCED_TYPENAME boost::iterator_value::type, + typename boost::iterator_value::type, single_pass_traversal_tag, - BOOST_DEDUCED_TYPENAME boost::iterator_value::type + typename boost::iterator_value::type > { - typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type base_value_type; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference::type reference_type; + typedef typename boost::iterator_value::type base_value_type; + typedef typename boost::iterator_reference::type reference_type; friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< Derived, Base, base_value_type, diff --git a/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp b/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp index 5f826ca..7fbc79f 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -18,7 +18,7 @@ #include -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } #endif @@ -37,7 +37,7 @@ namespace iterators { template< class Base, int N, - class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type + class CharType = typename boost::iterator_value::type > class insert_linebreaks : public iterator_adaptor< diff --git a/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp b/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp index 1df612d..41aa0be 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -41,24 +41,25 @@ class istream_iterator : { friend class boost::iterator_core_access; typedef istream_iterator this_t ; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_facade< + typedef typename boost::iterator_facade< istream_iterator, Elem, std::input_iterator_tag, Elem > super_t; - typedef BOOST_DEDUCED_TYPENAME std::basic_istream istream_type; + typedef typename std::basic_istream istream_type; - //Access the value referred to - Elem dereference() const { - return m_current_value; - } - bool equal(const this_t & rhs) const { // note: only works for comparison against end of stream return m_istream == rhs.m_istream; } +/* + //Access the value referred to + Elem dereference() const { + return m_current_value; + } + void increment(){ if(NULL != m_istream){ m_current_value = static_cast(m_istream->get()); @@ -67,6 +68,17 @@ class istream_iterator : } } } +*/ + //Access the value referred to + Elem dereference() const { + return m_istream->peek(); + } + + void increment(){ + if(NULL != m_istream){ + m_istream->ignore(1); + } + } istream_type *m_istream; Elem m_current_value; @@ -74,7 +86,7 @@ public: istream_iterator(istream_type & is) : m_istream(& is) { - increment(); + //increment(); } istream_iterator() : diff --git a/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp b/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp index d8f8a12..04e7c7e 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -20,7 +20,7 @@ #include // size_t #include // for wctomb() -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; @@ -50,7 +50,7 @@ class mb_from_wchar { friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< mb_from_wchar, Base, wchar_t, diff --git a/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp b/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp index 7c3203f..49a9b99 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp b/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp index a01049f..4383987 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -18,17 +18,12 @@ #include -#include // for BOOST_DEDUCED_TYPENAME - #include #include #include #include -//#include -//#if ! BOOST_WORKAROUND(BOOST_MSVC, <=1300) - // here is the default standard implementation of the functor used // by the filter iterator to remove spaces. Unfortunately usage // of this implementation in combination with spirit trips a bug @@ -53,8 +48,6 @@ namespace std{ using ::isspace; } #undef iswspace #endif -//#endif // BOOST_WORKAROUND - namespace { // anonymous template @@ -100,14 +93,14 @@ class filter_iterator > { friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< filter_iterator, Base, use_default, single_pass_traversal_tag > super_t; typedef filter_iterator this_t; - typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type; + typedef typename super_t::reference reference_type; reference_type dereference_impl(){ if(! m_full){ @@ -142,8 +135,8 @@ template class remove_whitespace : public filter_iterator< remove_whitespace_predicate< - BOOST_DEDUCED_TYPENAME boost::iterator_value::type - //BOOST_DEDUCED_TYPENAME Base::value_type + typename boost::iterator_value::type + //typename Base::value_type >, Base > @@ -151,8 +144,8 @@ class remove_whitespace : friend class boost::iterator_core_access; typedef filter_iterator< remove_whitespace_predicate< - BOOST_DEDUCED_TYPENAME boost::iterator_value::type - //BOOST_DEDUCED_TYPENAME Base::value_type + typename boost::iterator_value::type + //typename Base::value_type >, Base > super_t; diff --git a/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp b/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp index 6e2c526..4e11953 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -24,14 +24,13 @@ // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters // or 3 8 bit characters -#include - -#include // for BOOST_DEDUCED_TYPENAME & PTFO #include #include #include +#include // std::min + namespace boost { namespace archive { namespace iterators { @@ -43,7 +42,7 @@ template< class Base, int BitsOut, int BitsIn, - class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type // output character + class CharType = typename boost::iterator_value::type // output character > class transform_width : public boost::iterator_adaptor< @@ -55,7 +54,7 @@ class transform_width : > { friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< transform_width, Base, CharType, @@ -64,103 +63,111 @@ class transform_width : > super_t; typedef transform_width this_t; - typedef BOOST_DEDUCED_TYPENAME iterator_value::type base_value_type; + typedef typename iterator_value::type base_value_type; - CharType fill(); + void fill(); - CharType dereference_impl(){ - if(! m_full){ - m_current_value = fill(); - m_full = true; - } - return m_current_value; + CharType dereference() const { + if(!m_buffer_out_full) + const_cast(this)->fill(); + return m_buffer_out; } - CharType dereference() const { - return const_cast(this)->dereference_impl(); + bool equal_impl(const this_t & rhs){ + if(BitsIn < BitsOut) // discard any left over bits + return this->base_reference() == rhs.base_reference(); + else{ + // BitsIn > BitsOut // zero fill + if(this->base_reference() == rhs.base_reference()){ + m_end_of_sequence = true; + return 0 == m_remaining_bits; + } + return false; + } } - // test for iterator equality + // standard iterator interface bool equal(const this_t & rhs) const { - return - this->base_reference() == rhs.base_reference(); - ; + return const_cast(this)->equal_impl(rhs); } void increment(){ - m_displacement += BitsOut; - - while(m_displacement >= BitsIn){ - m_displacement -= BitsIn; - if(0 == m_displacement) - m_bufferfull = false; - if(! m_bufferfull){ - // note: suspect that this is not invoked for borland - ++(this->base_reference()); - } - } - m_full = false; + m_buffer_out_full = false; } - CharType m_current_value; - // number of bits left in current input character buffer - unsigned int m_displacement; - base_value_type m_buffer; - // flag to current output character is ready - just used to save time - bool m_full; - // flag to indicate that m_buffer has data - bool m_bufferfull; + bool m_buffer_out_full; + CharType m_buffer_out; + + // last read element from input + base_value_type m_buffer_in; + + // number of bits to left in the input buffer. + unsigned int m_remaining_bits; + + // flag to indicate we've reached end of data. + bool m_end_of_sequence; public: // make composible buy using templated constructor template transform_width(BOOST_PFTO_WRAPPER(T) start) : super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), - m_displacement(0), - m_full(false), - m_bufferfull(false) + m_buffer_out_full(false), + // To disable GCC warning, but not truly necessary + //(m_buffer_in will be initialized later before being + //used because m_remaining_bits == 0) + m_buffer_in(0), + m_remaining_bits(0), + m_end_of_sequence(false) {} // intel 7.1 doesn't like default copy constructor transform_width(const transform_width & rhs) : super_t(rhs.base_reference()), - m_current_value(rhs.m_current_value), - m_displacement(rhs.m_displacement), - m_buffer(rhs.m_buffer), - m_full(rhs.m_full), - m_bufferfull(rhs.m_bufferfull) + m_buffer_out_full(rhs.m_buffer_out_full), + m_buffer_in(rhs.m_buffer_in), + m_remaining_bits(rhs.m_remaining_bits), + m_end_of_sequence(false) {} }; -template -CharType transform_width::fill(){ - CharType retval = 0; +template< + class Base, + int BitsOut, + int BitsIn, + class CharType +> +void transform_width::fill() { unsigned int missing_bits = BitsOut; - for(;;){ - unsigned int bcount; - if(! m_bufferfull){ - m_buffer = * this->base_reference(); - m_bufferfull = true; - bcount = BitsIn; + m_buffer_out = 0; + do{ + if(0 == m_remaining_bits){ + if(m_end_of_sequence){ + m_buffer_in = 0; + m_remaining_bits = missing_bits; + } + else{ + m_buffer_in = * this->base_reference()++; + m_remaining_bits = BitsIn; + } } - else - bcount = BitsIn - m_displacement; - unsigned int i = (std::min)(bcount, missing_bits); + + // append these bits to the next output + // up to the size of the output + unsigned int i = std::min(missing_bits, m_remaining_bits); // shift interesting bits to least significant position - unsigned int j = m_buffer >> (bcount - i); - // strip off uninteresting bits - // (note presumption of two's complement arithmetic) - j &= ~(-(1 << i)); + base_value_type j = m_buffer_in >> (m_remaining_bits - i); + // and mask off the un interesting higher bits + // note presumption of twos complement notation + j &= (1 << i) - 1; // append then interesting bits to the output value - retval <<= i; - retval |= j; + m_buffer_out <<= i; + m_buffer_out |= j; + + // and update counters missing_bits -= i; - if(0 == missing_bits) - break; - // note: suspect that this is not invoked for borland 5.51 - ++(this->base_reference()); - m_bufferfull = false; - } - return retval; + m_remaining_bits -= i; + }while(0 < missing_bits); + m_buffer_out_full = true; } } // namespace iterators diff --git a/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp b/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp index 9cbd316..abf6240 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -18,9 +18,7 @@ #include -#include // for BOOST_DEDUCED_TYPENAME #include -//#include #include namespace boost { @@ -35,24 +33,24 @@ class unescape : public boost::iterator_adaptor< unescape, Base, - BOOST_DEDUCED_TYPENAME pointee::type, + typename pointee::type, single_pass_traversal_tag, - BOOST_DEDUCED_TYPENAME pointee::type + typename pointee::type > { friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< unescape, Base, - BOOST_DEDUCED_TYPENAME pointee::type, + typename pointee::type, single_pass_traversal_tag, - BOOST_DEDUCED_TYPENAME pointee::type + typename pointee::type > super_t; typedef unescape this_t; public: - typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; - typedef BOOST_DEDUCED_TYPENAME this_t::reference reference; + typedef typename this_t::value_type value_type; + typedef typename this_t::reference reference; private: value_type dereference_impl() { if(! m_full){ diff --git a/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp b/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp index 4da8121..ab81f17 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -21,7 +21,7 @@ #include // size_t #include // mblen -#include // for BOOST_DEDUCED_TYPENAME +#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::mblen; @@ -53,7 +53,7 @@ class wchar_from_mb > { friend class boost::iterator_core_access; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + typedef typename boost::iterator_adaptor< wchar_from_mb, Base, wchar_t, diff --git a/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp b/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp index eadb96e..a5d2c51 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -17,10 +17,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include - -#include // for BOOST_DEDUCED_TYPENAME #include - #include namespace boost { diff --git a/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp b/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp index 3295adb..69438ed 100644 --- a/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp +++ b/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -18,8 +18,6 @@ #include -#include // for BOOST_DEDUCED_TYPENAME - #include #include @@ -39,7 +37,7 @@ class xml_unescape friend class boost::iterator_core_access; typedef xml_unescape this_t; typedef unescape super_t; - typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference reference_type; + typedef typename boost::iterator_reference reference_type; reference_type dereference() const { return unescape, Base>::dereference(); @@ -49,7 +47,7 @@ public: #if defined(BOOST_MSVC) typedef int value_type; #else - typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; + typedef typename this_t::value_type value_type; #endif void drain_residue(const char *literal); @@ -83,7 +81,7 @@ void xml_unescape::drain_residue(const char * literal){ // iterator refenence which would make subsequent iterator comparisons // incorrect and thereby break the composiblity of iterators. template -BOOST_DEDUCED_TYPENAME xml_unescape::value_type +typename xml_unescape::value_type //int xml_unescape::drain(){ value_type retval = * this->base_reference(); diff --git a/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp b/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp index 2f76cf2..50488a3 100644 --- a/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -39,8 +39,6 @@ namespace std{ #include // must be the last header namespace boost { -template -class shared_ptr; namespace serialization { class extended_type_info; } // namespace serialization @@ -155,18 +153,11 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - -namespace boost { +namespace boost { namespace archive { class polymorphic_iarchive : - public polymorphic_iarchive_impl, - public detail::shared_ptr_helper + public polymorphic_iarchive_impl { public: virtual ~polymorphic_iarchive(){}; diff --git a/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp b/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp index 420029b..1eb9e0b 100644 --- a/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -38,8 +38,6 @@ namespace std{ #include // must be the last header namespace boost { -template -class shared_ptr; namespace serialization { class extended_type_info; } // namespace serialization diff --git a/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp b/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp deleted file mode 100644 index 39e6eb8..0000000 --- a/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp +++ /dev/null @@ -1,219 +0,0 @@ -#ifndef BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP -#define BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr_helper.hpp: serialization for boost shared pointern - -// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo -// 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) - -// See http://www.boost.org for updates, documentation, and revision history. - -#include -#include -#include -#include // NULL - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include // must be the last headern - -namespace boost_132 { - template class shared_ptr; -} -namespace boost { - template class shared_ptr; - namespace serialization { - class extended_type_info; - template - inline void load( - Archive & ar, - boost::shared_ptr< T > &t, - const unsigned int file_version - ); - } -namespace archive{ -namespace detail { - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// a common class for holding various types of shared pointers - -class shared_ptr_helper { - struct collection_type_compare { - bool operator()( - const shared_ptr &lhs, - const shared_ptr &rhs - )const{ - return lhs.get() < rhs.get(); - } - }; - typedef std::set< - boost::shared_ptr, - collection_type_compare - > collection_type; - typedef collection_type::const_iterator iterator_type; - // list of shared_pointers create accessable by raw pointer. This - // is used to "match up" shared pointers loaded at different - // points in the archive. Note, we delay construction until - // it is actually used since this is by default included as - // a "mix-in" even if shared_ptr isn't used. - collection_type * m_pointers; - - struct null_deleter { - void operator()(void const *) const {} - }; - - struct void_deleter { - const boost::serialization::extended_type_info * m_eti; - void_deleter(const boost::serialization::extended_type_info *eti) : - m_eti(eti) - {} - void operator()(void *vp) const { - m_eti->destroy(vp); - } - }; - -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -public: -#else - template - friend inline void boost::serialization::load( - Archive & ar, - boost::shared_ptr< T > &t, - const unsigned int file_version - ); -#endif - -// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP - // list of loaded pointers. This is used to be sure that the pointers - // stay around long enough to be "matched" with other pointers loaded - // by the same archive. These are created with a "null_deleter" so that - // when this list is destroyed - the underlaying raw pointers are not - // destroyed. This has to be done because the pointers are also held by - // new system which is disjoint from this set. This is implemented - // by a change in load_construct_data below. It makes this file suitable - // only for loading pointers into a 1.33 or later boost system. - std::list > * m_pointers_132; -// #endif - - // returns pointer to object and an indicator whether this is a - // new entry (true) or a previous one (false) - BOOST_ARCHIVE_DECL(shared_ptr) - get_od( - const void * od, - const boost::serialization::extended_type_info * true_type, - const boost::serialization::extended_type_info * this_type - ); - - BOOST_ARCHIVE_DECL(void) - append(const boost::shared_ptr &); - - template - struct non_polymorphic { - static const boost::serialization::extended_type_info * - get_object_identifier(T &){ - return & boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME - boost::serialization::type_info_implementation< T >::type - >::get_const_instance(); - } - }; - template - struct polymorphic { - static const boost::serialization::extended_type_info * - get_object_identifier(T & t){ - return boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME - boost::serialization::type_info_implementation< T >::type - >::get_const_instance().get_derived_extended_type_info(t); - } - }; -public: - template - void reset(shared_ptr< T > & s, T * t){ - if(NULL == t){ - s.reset(); - return; - } - const boost::serialization::extended_type_info * this_type - = & boost::serialization::type_info_implementation< T >::type - ::get_const_instance(); - - // get pointer to the most derived object. This is effectively - // the object identifern - typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< - is_polymorphic< T >, - mpl::identity >, - mpl::identity > - >::type type; - - const boost::serialization::extended_type_info * true_type - = type::get_object_identifier(*t); - - // note:if this exception is thrown, be sure that derived pointern - // is either registered or exported. - if(NULL == true_type) - boost::serialization::throw_exception( - archive_exception( - archive_exception::unregistered_class, - this_type->get_debug_info() - ) - ); - shared_ptr r = - get_od( - static_cast(t), - true_type, - this_type - ); - if(!r){ - s.reset(t); - const void * od = void_downcast( - *true_type, - *this_type, - static_cast(t) - ); - shared_ptr sp(s, od); - append(sp); - } - else{ - s = shared_ptr< T >( - r, - static_cast(r.get()) - ); - } - } - -// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP - BOOST_ARCHIVE_DECL(void) - append(const boost_132::shared_ptr & t); -// #endif -public: - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) - shared_ptr_helper(); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) - ~shared_ptr_helper(); -}; - -} // namespace detail -} // namespace archive -} // namespace boost - -#include // pops abi_suffix.hpp pragmas - -#endif // BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP diff --git a/3rdParty/Boost/src/boost/archive/text_iarchive.hpp b/3rdParty/Boost/src/boost/archive/text_iarchive.hpp index 298928b..1fd0f60 100644 --- a/3rdParty/Boost/src/boost/archive/text_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/text_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -35,6 +35,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + template class text_iarchive_impl : public basic_text_iprimitive, @@ -43,10 +47,16 @@ class text_iarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_iarchive; - friend class basic_text_iarchive; - friend class load_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class load_access; + #endif #endif template void load(T & t){ @@ -92,22 +102,6 @@ protected: ~text_iarchive_impl(){}; }; -// do not derive from the classes below. If you want to extend this functionality -// via inhertance, derived from text_iarchive_impl instead. This will -// preserve correct static polymorphism. - -// same as text_iarchive below - without the shared_ptr_helper -class naked_text_iarchive : - public text_iarchive_impl -{ -public: - naked_text_iarchive(std::istream & is_, unsigned int flags = 0) : - // note: added _ to suppress useless gcc warning - text_iarchive_impl(is_, flags) - {} - ~naked_text_iarchive(){} -}; - } // namespace archive } // namespace boost @@ -117,12 +111,6 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) @@ -132,9 +120,7 @@ namespace boost { namespace archive { class text_iarchive : - public text_iarchive_impl, - public detail::shared_ptr_helper -{ + public text_iarchive_impl{ public: text_iarchive(std::istream & is_, unsigned int flags = 0) : // note: added _ to suppress useless gcc warning diff --git a/3rdParty/Boost/src/boost/archive/text_oarchive.hpp b/3rdParty/Boost/src/boost/archive/text_oarchive.hpp index 2100d53..9fd63a9 100644 --- a/3rdParty/Boost/src/boost/archive/text_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/text_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -42,6 +42,10 @@ namespace std{ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + template class text_oarchive_impl : /* protected ? */ public basic_text_oprimitive, @@ -50,10 +54,18 @@ class text_oarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_oarchive; - friend class basic_text_oarchive; - friend class save_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_text_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; + #endif #endif template void save(const T & t){ @@ -102,8 +114,6 @@ public: ~text_oarchive(){} }; -typedef text_oarchive naked_text_oarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp index 7451f3a..5105d35 100644 --- a/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -39,6 +39,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + template class text_wiarchive_impl : public basic_text_iprimitive, @@ -47,10 +51,16 @@ class text_wiarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_iarchive; - friend class basic_text_iarchive; - friend class load_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class load_access; + #endif #endif template void load(T & t){ @@ -89,21 +99,6 @@ protected: ~text_wiarchive_impl(){}; }; -// do not derive from the classes below. If you want to extend this functionality -// via inhertance, derived from text_iarchive_impl instead. This will -// preserve correct static polymorphism. - -// same as text_wiarchive below - without the shared_ptr_helper -class naked_text_wiarchive : - public text_wiarchive_impl -{ -public: - naked_text_wiarchive(std::wistream & is, unsigned int flags = 0) : - text_wiarchive_impl(is, flags) - {} - ~naked_text_wiarchive(){} -}; - } // namespace archive } // namespace boost @@ -113,12 +108,6 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) @@ -128,9 +117,7 @@ namespace boost { namespace archive { class text_wiarchive : - public text_wiarchive_impl, - public detail::shared_ptr_helper -{ + public text_wiarchive_impl{ public: text_wiarchive(std::wistream & is, unsigned int flags = 0) : text_wiarchive_impl(is, flags) diff --git a/3rdParty/Boost/src/boost/archive/text_woarchive.hpp b/3rdParty/Boost/src/boost/archive/text_woarchive.hpp index 7ed0c82..2f75204 100644 --- a/3rdParty/Boost/src/boost/archive/text_woarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/text_woarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -47,6 +47,10 @@ namespace std{ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + template class text_woarchive_impl : public basic_text_oprimitive, @@ -55,10 +59,18 @@ class text_woarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_oarchive; - friend class basic_text_oarchive; - friend class save_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_text_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; + #endif #endif template void save(const T & t){ @@ -127,8 +139,6 @@ public: ~text_woarchive(){} }; -typedef text_woarchive naked_text_woarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/wcslen.hpp b/3rdParty/Boost/src/boost/archive/wcslen.hpp index 5c14acf..2a3d635 100644 --- a/3rdParty/Boost/src/boost/archive/wcslen.hpp +++ b/3rdParty/Boost/src/boost/archive/wcslen.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_WCSLEN_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp b/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp index 48e6cb3..622cafe 100644 --- a/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp +++ b/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp index be6cfe4..ba50d7c 100644 --- a/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_XML_IARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -35,6 +35,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + template class basic_xml_grammar; typedef basic_xml_grammar xml_grammar; @@ -47,10 +51,18 @@ class xml_iarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_iarchive; - friend class basic_xml_iarchive; - friend class load_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend basic_xml_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; + #endif #endif // instances of micro xml parser to parse start preambles // scoped_ptr doesn't play nice with borland - so use a naked pointer @@ -102,21 +114,6 @@ protected: ~xml_iarchive_impl(); }; -// do not derive from the classes below. If you want to extend this functionality -// via inhertance, derived from text_iarchive_impl instead. This will -// preserve correct static polymorphism. - -// same as xml_iarchive below - without the shared_ptr_helper -class naked_xml_iarchive : - public xml_iarchive_impl -{ -public: - naked_xml_iarchive(std::istream & is, unsigned int flags = 0) : - xml_iarchive_impl(is, flags) - {} - ~naked_xml_iarchive(){} -}; - } // namespace archive } // namespace boost @@ -125,13 +122,6 @@ public: #endif #include // pops abi_suffix.hpp pragmas - -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) @@ -141,9 +131,7 @@ namespace boost { namespace archive { class xml_iarchive : - public xml_iarchive_impl, - public detail::shared_ptr_helper -{ + public xml_iarchive_impl{ public: xml_iarchive(std::istream & is, unsigned int flags = 0) : xml_iarchive_impl(is, flags) diff --git a/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp index 167ba09..2ac4ae1 100644 --- a/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_XML_OARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -42,6 +42,10 @@ namespace std{ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + template class xml_oarchive_impl : public basic_text_oprimitive, @@ -50,10 +54,18 @@ class xml_oarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_oarchive; - friend class basic_xml_oarchive; - friend class save_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_xml_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; + #endif #endif //void end_preamble(){ // basic_xml_oarchive::end_preamble(); @@ -116,8 +128,6 @@ public: ~xml_oarchive(){} }; -typedef xml_oarchive naked_xml_oarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp index 59ebbb5..31aff88 100644 --- a/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_XML_WIARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -40,6 +40,10 @@ namespace boost { namespace archive { +namespace detail { + template class interface_iarchive; +} // namespace detail + template class basic_xml_grammar; typedef basic_xml_grammar xml_wgrammar; @@ -52,10 +56,18 @@ class xml_wiarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_iarchive; - friend class basic_xml_iarchive; - friend class load_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend basic_xml_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; + #endif #endif // instances of micro xml parser to parse start preambles // scoped_ptr doesn't play nice with borland - so use a naked pointer @@ -107,21 +119,6 @@ protected: ~xml_wiarchive_impl(); }; -// do not derive from the classes below. If you want to extend this functionality -// via inhertance, derived from xml_wiarchive_impl instead. This will -// preserve correct static polymorphism. - -// same as xml_wiarchive below - without the shared_ptr_helper -class naked_xml_wiarchive : - public xml_wiarchive_impl -{ -public: - naked_xml_wiarchive(std::wistream & is, unsigned int flags = 0) : - xml_wiarchive_impl(is, flags) - {} - ~naked_xml_wiarchive(){} -}; - } // namespace archive } // namespace boost @@ -131,12 +128,6 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special -// structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a -// special esteem in the boost library - we included it here by default. -#include - #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) @@ -146,9 +137,7 @@ namespace boost { namespace archive { class xml_wiarchive : - public xml_wiarchive_impl, - public detail::shared_ptr_helper -{ + public xml_wiarchive_impl{ public: xml_wiarchive(std::wistream & is, unsigned int flags = 0) : xml_wiarchive_impl(is, flags) diff --git a/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp index 08c0fdc..7fcaeb9 100644 --- a/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp +++ b/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp @@ -2,7 +2,7 @@ #define BOOST_ARCHIVE_XML_WOARCHIVE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -46,6 +46,10 @@ namespace std{ namespace boost { namespace archive { +namespace detail { + template class interface_oarchive; +} // namespace detail + template class xml_woarchive_impl : public basic_text_oprimitive, @@ -54,11 +58,20 @@ class xml_woarchive_impl : #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else - friend class detail::interface_oarchive; - friend class basic_xml_oarchive; - friend class save_access; protected: + #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_xml_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; + #endif #endif + //void end_preamble(){ // basic_xml_oarchive::end_preamble(); //} @@ -122,8 +135,6 @@ public: ~xml_woarchive(){} }; -typedef xml_woarchive naked_xml_woarchive; - } // namespace archive } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio.hpp b/3rdParty/Boost/src/boost/asio.hpp index 8205c55..871fcbe 100644 --- a/3rdParty/Boost/src/boost/asio.hpp +++ b/3rdParty/Boost/src/boost/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) @@ -17,6 +17,7 @@ # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) +#include #include #include #include @@ -40,12 +41,20 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include #include +#include #include +#include #include #include #include diff --git a/3rdParty/Boost/src/boost/asio/async_result.hpp b/3rdParty/Boost/src/boost/asio/async_result.hpp new file mode 100644 index 0000000..7a24ce5 --- /dev/null +++ b/3rdParty/Boost/src/boost/asio/async_result.hpp @@ -0,0 +1,96 @@ +// +// async_result.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under 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) +// + +#ifndef BOOST_ASIO_ASYNC_RESULT_HPP +#define BOOST_ASIO_ASYNC_RESULT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include + +#include + +namespace boost { +namespace asio { + +/// An interface for customising the behaviour of an initiating function. +/** + * This template may be specialised for user-defined handler types. + */ +template +class async_result +{ +public: + /// The return type of the initiating function. + typedef void type; + + /// Construct an async result from a given handler. + /** + * When using a specalised async_result, the constructor has an opportunity + * to initialise some state associated with the handler, which is then + * returned from the initiating function. + */ + explicit async_result(Handler&) + { + } + + /// Obtain the value to be returned from the initiating function. + type get() + { + } +}; + +namespace detail { + +// Helper template to deduce the true type of a handler, capture a local copy +// of the handler, and then create an async_result for the handler. +template +struct async_result_init +{ + explicit async_result_init(BOOST_ASIO_MOVE_ARG(Handler) orig_handler) + : handler(BOOST_ASIO_MOVE_CAST(Handler)(orig_handler)), + result(handler) + { + } + + typename handler_type::type handler; + async_result::type> result; +}; + +template +struct async_result_type_helper +{ + typedef typename async_result< + typename handler_type::type + >::type type; +}; + +} // namespace detail +} // namespace asio +} // namespace boost + +#include + +#if defined(GENERATING_DOCUMENTATION) +# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ + void_or_deduced +#elif defined(_MSC_VER) && (_MSC_VER < 1500) +# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ + typename ::boost::asio::detail::async_result_type_helper::type +#else +# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ + typename ::boost::asio::async_result< \ + typename ::boost::asio::handler_type::type>::type +#endif + +#endif // BOOST_ASIO_ASYNC_RESULT_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp index a773315..1be3c78 100644 --- a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp @@ -2,7 +2,7 @@ // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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,6 +21,7 @@ #include #include #include +#include #include #include @@ -166,6 +167,50 @@ public: BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other)); return *this; } + + /// Move-construct a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This constructor moves a datagram socket from one object to another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_service&) constructor. + */ + template + basic_datagram_socket( + basic_datagram_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket( + BOOST_ASIO_MOVE_CAST2(basic_datagram_socket< + Protocol1, DatagramSocketService1>)(other)) + { + } + + /// Move-assign a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a datagram socket from one object to + * another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_service&) constructor. + */ + template + typename enable_if::value, + basic_datagram_socket>::type& operator=( + basic_datagram_socket&& other) + { + basic_socket::operator=( + BOOST_ASIO_MOVE_CAST2(basic_datagram_socket< + Protocol1, DatagramSocketService1>)(other)); + return *this; + } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on a connected socket. @@ -255,9 +300,8 @@ public: /// Start an asynchronous send on a connected socket. /** - * This function is used to send data on the datagram socket. The function - * call will block until the data has been sent successfully or an error - * occurs. + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. * * @param buffers One or more data buffers to be sent on the socket. Although * the buffers object may be copied as necessary, ownership of the underlying @@ -290,22 +334,23 @@ public: * std::vector. */ template - void async_send(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send(this->get_implementation(), + return this->get_service().async_send(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send on a connected socket. /** - * This function is used to send data on the datagram socket. The function - * call will block until the data has been sent successfully or an error - * occurs. + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. * * @param buffers One or more data buffers to be sent on the socket. Although * the buffers object may be copied as necessary, ownership of the underlying @@ -331,7 +376,9 @@ public: * socket. */ template - void async_send(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -339,7 +386,7 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send(this->get_implementation(), + return this->get_service().async_send(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } @@ -469,7 +516,9 @@ public: * std::vector. */ template - void async_send_to(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -477,8 +526,9 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send_to(this->get_implementation(), buffers, - destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, 0, + BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send. @@ -509,7 +559,9 @@ public: * boost::asio::io_service::post(). */ template - void async_send_to(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -517,8 +569,9 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send_to(this->get_implementation(), buffers, - destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data on a connected socket. @@ -647,14 +700,16 @@ public: * std::vector. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), + return this->get_service().async_receive(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } @@ -687,7 +742,9 @@ public: * datagram socket. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -695,7 +752,7 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), + return this->get_service().async_receive(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } @@ -819,13 +876,15 @@ public: * To receive into a single data buffer use the @ref buffer function as * follows: * @code socket.async_receive_from( - * boost::asio::buffer(data, size), 0, sender_endpoint, handler); @endcode + * boost::asio::buffer(data, size), sender_endpoint, handler); @endcode * See the @ref buffer documentation for information on receiving into * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template - void async_receive_from(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -833,8 +892,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive_from(this->get_implementation(), buffers, - sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -867,7 +927,9 @@ public: * boost::asio::io_service::post(). */ template - void async_receive_from(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -875,8 +937,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive_from(this->get_implementation(), buffers, - sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp index 6baeb7a..767e859 100644 --- a/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp @@ -2,7 +2,7 @@ // basic_deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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,6 +16,10 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include + +#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) + #include #include #include @@ -492,13 +496,15 @@ public: * boost::asio::io_service::post(). */ template - void async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler) + BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler, + void (boost::system::error_code)) + async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WaitHandler. BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - this->service.async_wait(this->implementation, + return this->service.async_wait(this->implementation, BOOST_ASIO_MOVE_CAST(WaitHandler)(handler)); } }; @@ -508,4 +514,7 @@ public: #include +#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) + // || defined(GENERATING_DOCUMENTATION) + #endif // BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp index 0464335..784fcc9 100644 --- a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp @@ -2,7 +2,7 @@ // basic_io_object.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp index 90f66c0..4f3c7c2 100644 --- a/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp @@ -2,7 +2,7 @@ // basic_raw_socket.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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,6 +20,7 @@ #include #include #include +#include #include #include @@ -165,6 +166,46 @@ public: BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other)); return *this; } + + /// Move-construct a basic_raw_socket from a socket of another protocol type. + /** + * This constructor moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_service&) constructor. + */ + template + basic_raw_socket(basic_raw_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket( + BOOST_ASIO_MOVE_CAST2(basic_raw_socket< + Protocol1, RawSocketService1>)(other)) + { + } + + /// Move-assign a basic_raw_socket from a socket of another protocol type. + /** + * This assignment operator moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_service&) constructor. + */ + template + typename enable_if::value, + basic_raw_socket>::type& operator=( + basic_raw_socket&& other) + { + basic_socket::operator=( + BOOST_ASIO_MOVE_CAST2(basic_raw_socket< + Protocol1, RawSocketService1>)(other)); + return *this; + } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on a connected socket. @@ -285,14 +326,16 @@ public: * std::vector. */ template - void async_send(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send(this->get_implementation(), + return this->get_service().async_send(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } @@ -325,7 +368,9 @@ public: * socket. */ template - void async_send(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -333,7 +378,7 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send(this->get_implementation(), + return this->get_service().async_send(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } @@ -463,7 +508,9 @@ public: * std::vector. */ template - void async_send_to(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -471,8 +518,8 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send_to(this->get_implementation(), buffers, - destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + return this->get_service().async_send_to(this->get_implementation(), + buffers, destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send. @@ -503,7 +550,9 @@ public: * boost::asio::io_service::post(). */ template - void async_send_to(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -511,8 +560,9 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send_to(this->get_implementation(), buffers, - destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data on a connected socket. @@ -641,14 +691,16 @@ public: * std::vector. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), + return this->get_service().async_receive(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } @@ -681,7 +733,9 @@ public: * raw socket. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -689,7 +743,7 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), + return this->get_service().async_receive(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } @@ -819,7 +873,9 @@ public: * std::vector. */ template - void async_receive_from(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -827,8 +883,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive_from(this->get_implementation(), buffers, - sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -861,7 +918,9 @@ public: * boost::asio::io_service::post(). */ template - void async_receive_from(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -869,8 +928,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive_from(this->get_implementation(), buffers, - sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_seq_packet_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_seq_packet_socket.hpp index a638c71..630296c 100644 --- a/3rdParty/Boost/src/boost/asio/basic_seq_packet_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_seq_packet_socket.hpp @@ -2,7 +2,7 @@ // basic_seq_packet_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) @@ -171,6 +171,51 @@ public: BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other)); return *this; } + + /// Move-construct a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This constructor moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_service&) constructor. + */ + template + basic_seq_packet_socket( + basic_seq_packet_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket( + BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< + Protocol1, SeqPacketSocketService1>)(other)) + { + } + + /// Move-assign a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_service&) constructor. + */ + template + typename enable_if::value, + basic_seq_packet_socket>::type& operator=( + basic_seq_packet_socket&& other) + { + basic_socket::operator=( + BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< + Protocol1, SeqPacketSocketService1>)(other)); + return *this; + } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on the socket. @@ -267,7 +312,9 @@ public: * std::vector. */ template - void async_send(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { @@ -275,7 +322,7 @@ public: // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_send(this->get_implementation(), + return this->get_service().async_send(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } @@ -437,7 +484,9 @@ public: * std::vector. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, socket_base::message_flags& out_flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { @@ -445,8 +494,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), buffers, - 0, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive( + this->get_implementation(), buffers, 0, out_flags, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -492,7 +542,9 @@ public: * std::vector. */ template - void async_receive(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, socket_base::message_flags in_flags, socket_base::message_flags& out_flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) @@ -501,8 +553,9 @@ public: // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_receive(this->get_implementation(), buffers, - in_flags, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + return this->get_service().async_receive( + this->get_implementation(), buffers, in_flags, out_flags, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp index 31ee955..dda2c88 100644 --- a/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp @@ -2,7 +2,7 @@ // basic_serial_port.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -559,14 +559,16 @@ public: * std::vector. */ template - void async_write_some(const ConstBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (boost::system::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - this->get_service().async_write_some(this->get_implementation(), + return this->get_service().async_write_some(this->get_implementation(), buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } @@ -670,14 +672,16 @@ public: * std::vector. */ template - void async_read_some(const MutableBufferSequence& buffers, + BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (boost::system::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - this->get_service().async_read_some(this->get_implementation(), + return this->get_service().async_read_some(this->get_implementation(), buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_signal_set.hpp b/3rdParty/Boost/src/boost/asio/basic_signal_set.hpp index ddbef87..d7f60fa 100644 --- a/3rdParty/Boost/src/boost/asio/basic_signal_set.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_signal_set.hpp @@ -2,7 +2,7 @@ // basic_signal_set.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) @@ -365,13 +365,15 @@ public: * boost::asio::io_service::post(). */ template - void async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler) + BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler, + void (boost::system::error_code, int)) + async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a SignalHandler. BOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; - this->service.async_wait(this->implementation, + return this->service.async_wait(this->implementation, BOOST_ASIO_MOVE_CAST(SignalHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_socket.hpp index c9e2045..a28f365 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket.hpp @@ -2,7 +2,7 @@ // basic_socket.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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,9 +16,11 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include +#include #include #include #include +#include #include #include @@ -173,6 +175,51 @@ public: BOOST_ASIO_MOVE_CAST(basic_socket)(other)); return *this; } + + // All sockets have access to each other's implementations. + template + friend class basic_socket; + + /// Move-construct a basic_socket from a socket of another protocol type. + /** + * This constructor moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_service&) constructor. + */ + template + basic_socket(basic_socket&& other, + typename enable_if::value>::type* = 0) + : basic_io_object(other.get_io_service()) + { + this->get_service().template converting_move_construct( + this->get_implementation(), other.get_implementation()); + } + + /// Move-assign a basic_socket from a socket of another protocol type. + /** + * This assignment operator moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_service&) constructor. + */ + template + typename enable_if::value, + basic_socket>::type& operator=( + basic_socket&& other) + { + basic_socket tmp(BOOST_ASIO_MOVE_CAST2(basic_socket< + Protocol1, SocketService1>)(other)); + basic_io_object::operator=( + BOOST_ASIO_MOVE_CAST(basic_socket)(tmp)); + return *this; + } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Get a reference to the lowest layer. @@ -395,7 +442,7 @@ public: * CancelIoEx function is always used. This function does not have the * problems described above. */ -#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \ +#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ && !defined(BOOST_ASIO_ENABLE_CANCELIO) __declspec(deprecated("By default, this function always fails with " @@ -443,7 +490,7 @@ public: * CancelIoEx function is always used. This function does not have the * problems described above. */ -#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \ +#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ && !defined(BOOST_ASIO_ENABLE_CANCELIO) __declspec(deprecated("By default, this function always fails with " @@ -698,7 +745,9 @@ public: * @endcode */ template - void async_connect(const endpoint_type& peer_endpoint, + BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler, + void (boost::system::error_code)) + async_connect(const endpoint_type& peer_endpoint, BOOST_ASIO_MOVE_ARG(ConnectHandler) handler) { // If you get an error on the following line it means that your handler does @@ -711,14 +760,21 @@ public: const protocol_type protocol = peer_endpoint.protocol(); if (this->get_service().open(this->get_implementation(), protocol, ec)) { + detail::async_result_init< + ConnectHandler, void (boost::system::error_code)> init( + BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); + this->get_io_service().post( boost::asio::detail::bind_handler( - BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler), ec)); - return; + BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE( + ConnectHandler, void (boost::system::error_code)))( + init.handler), ec)); + + return init.result.get(); } } - this->get_service().async_connect(this->get_implementation(), + return this->get_service().async_connect(this->get_implementation(), peer_endpoint, BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); } @@ -843,7 +899,7 @@ public: * ... * boost::asio::ip::tcp::socket::keep_alive option; * socket.get_option(option); - * bool is_set = option.get(); + * bool is_set = option.value(); * @endcode */ template @@ -891,7 +947,7 @@ public: * { * // An error occurred. * } - * bool is_set = option.get(); + * bool is_set = option.value(); * @endcode */ template diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp index 5a3b0f7..ed019a0 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp @@ -2,7 +2,7 @@ // basic_socket_acceptor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -211,6 +212,54 @@ public: BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other)); return *this; } + + // All socket acceptors have access to each other's implementations. + template + friend class basic_socket_acceptor; + + /// Move-construct a basic_socket_acceptor from an acceptor of another + /// protocol type. + /** + * This constructor moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_service&) constructor. + */ + template + basic_socket_acceptor( + basic_socket_acceptor&& other, + typename enable_if::value>::type* = 0) + : basic_io_object(other.get_io_service()) + { + this->get_service().template converting_move_construct( + this->get_implementation(), other.get_implementation()); + } + + /// Move-assign a basic_socket_acceptor from an acceptor of another protocol + /// type. + /** + * This assignment operator moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_service&) constructor. + */ + template + typename enable_if::value, + basic_socket_acceptor>::type& operator=( + basic_socket_acceptor&& other) + { + basic_socket_acceptor tmp(BOOST_ASIO_MOVE_CAST2(basic_socket_acceptor< + Protocol1, SocketAcceptorService1>)(other)); + basic_io_object::operator=( + BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(tmp)); + return *this; + } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Open the acceptor using the specified protocol. @@ -316,8 +365,9 @@ public: * @par Example * @code * boost::asio::ip::tcp::acceptor acceptor(io_service); - * acceptor.open(boost::asio::ip::tcp::v4()); - * acceptor.bind(boost::asio::ip::tcp::endpoint(12345)); + * boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); + * acceptor.bind(endpoint); * @endcode */ void bind(const endpoint_type& endpoint) @@ -340,9 +390,10 @@ public: * @par Example * @code * boost::asio::ip::tcp::acceptor acceptor(io_service); - * acceptor.open(boost::asio::ip::tcp::v4()); + * boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); * boost::system::error_code ec; - * acceptor.bind(boost::asio::ip::tcp::endpoint(12345), ec); + * acceptor.bind(endpoint, ec); * if (ec) * { * // An error occurred. @@ -871,11 +922,13 @@ public: * acceptor.accept(socket); * @endcode */ - template - void accept(basic_socket& peer) + template + void accept(basic_socket& peer, + typename enable_if::value>::type* = 0) { boost::system::error_code ec; - this->get_service().accept(this->get_implementation(), peer, 0, ec); + this->get_service().accept(this->get_implementation(), + peer, static_cast(0), ec); boost::asio::detail::throw_error(ec, "accept"); } @@ -902,12 +955,14 @@ public: * } * @endcode */ - template + template boost::system::error_code accept( - basic_socket& peer, - boost::system::error_code& ec) + basic_socket& peer, + boost::system::error_code& ec, + typename enable_if::value>::type* = 0) { - return this->get_service().accept(this->get_implementation(), peer, 0, ec); + return this->get_service().accept(this->get_implementation(), + peer, static_cast(0), ec); } /// Start an asynchronous accept. @@ -948,16 +1003,20 @@ public: * acceptor.async_accept(socket, accept_handler); * @endcode */ - template - void async_accept(basic_socket& peer, - BOOST_ASIO_MOVE_ARG(AcceptHandler) handler) + template + BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (boost::system::error_code)) + async_accept(basic_socket& peer, + BOOST_ASIO_MOVE_ARG(AcceptHandler) handler, + typename enable_if::value>::type* = 0) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; - this->get_service().async_accept(this->get_implementation(), - peer, 0, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); + return this->get_service().async_accept(this->get_implementation(), + peer, static_cast(0), + BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); } /// Accept a new connection and obtain the endpoint of the peer @@ -1057,14 +1116,16 @@ public: * boost::asio::io_service::post(). */ template - void async_accept(basic_socket& peer, + BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (boost::system::error_code)) + async_accept(basic_socket& peer, endpoint_type& peer_endpoint, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; - this->get_service().async_accept(this->get_implementation(), peer, + return this->get_service().async_accept(this->get_implementation(), peer, &peer_endpoint, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); } }; diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp index 6fae085..221de7f 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp @@ -2,7 +2,7 @@ // basic_socket_iostream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) @@ -17,44 +17,40 @@ #include -#if !defined(BOOST_NO_IOSTREAM) +#if !defined(BOOST_ASIO_NO_IOSTREAM) -#include +#include +#include #include #include #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) -# include -# include -# include -# include - -# if !defined(BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY) -# define BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY 5 -# endif // !defined(BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY) +# include // A macro that should expand to: // template // explicit basic_socket_iostream(T1 x1, ..., Tn xn) -// : basic_iostream(&this->boost::base_from_member< -// basic_socket_streambuf >::member) +// : std::basic_iostream( +// &this->detail::socket_iostream_base< +// Protocol, StreamSocketService, Time, +// TimeTraits, TimerService>::streambuf_) // { // if (rdbuf()->connect(x1, ..., xn) == 0) // this->setstate(std::ios_base::failbit); // } // This macro should only persist within this file. -# define BOOST_ASIO_PRIVATE_CTR_DEF(z, n, data) \ - template \ - explicit basic_socket_iostream(BOOST_PP_ENUM_BINARY_PARAMS(n, T, x)) \ - : std::basic_iostream(&this->boost::base_from_member< \ - basic_socket_streambuf >::member) \ +# define BOOST_ASIO_PRIVATE_CTR_DEF(n) \ + template \ + explicit basic_socket_iostream(BOOST_ASIO_VARIADIC_PARAMS(n)) \ + : std::basic_iostream( \ + &this->detail::socket_iostream_base< \ + Protocol, StreamSocketService, Time, \ + TimeTraits, TimerService>::streambuf_) \ { \ this->setf(std::ios_base::unitbuf); \ - if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \ + if (rdbuf()->connect(BOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ this->setstate(std::ios_base::failbit); \ } \ /**/ @@ -68,11 +64,11 @@ // } // This macro should only persist within this file. -# define BOOST_ASIO_PRIVATE_CONNECT_DEF(z, n, data) \ - template \ - void connect(BOOST_PP_ENUM_BINARY_PARAMS(n, T, x)) \ +# define BOOST_ASIO_PRIVATE_CONNECT_DEF(n) \ + template \ + void connect(BOOST_ASIO_VARIADIC_PARAMS(n)) \ { \ - if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \ + if (rdbuf()->connect(BOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ this->setstate(std::ios_base::failbit); \ } \ /**/ @@ -83,34 +79,69 @@ namespace boost { namespace asio { +namespace detail { + +// A separate base class is used to ensure that the streambuf is initialised +// prior to the basic_socket_iostream's basic_iostream base class. +template +class socket_iostream_base +{ +protected: + basic_socket_streambuf streambuf_; +}; + +} /// Iostream interface for a socket. template , +#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) typename Time = boost::posix_time::ptime, typename TimeTraits = boost::asio::time_traits