Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
69
Server/RylServerProject/BaseLibrary/boost/config.hpp
Normal file
69
Server/RylServerProject/BaseLibrary/boost/config.hpp
Normal file
@@ -0,0 +1,69 @@
|
||||
// Boost config.hpp configuration header file ------------------------------//
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Boost config.hpp policy and rationale documentation has been moved to
|
||||
// http://www.boost.org/libs/config
|
||||
//
|
||||
// CAUTION: This file is intended to be completely stable -
|
||||
// DO NOT MODIFY THIS FILE!
|
||||
//
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#define BOOST_CONFIG_HPP
|
||||
|
||||
// if we don't have a user config, then use the default location:
|
||||
#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
|
||||
# define BOOST_USER_CONFIG <boost/config/user.hpp>
|
||||
#endif
|
||||
// include it first:
|
||||
#ifdef BOOST_USER_CONFIG
|
||||
# include BOOST_USER_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a compiler config set, try and find one:
|
||||
#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
|
||||
# include <boost/config/select_compiler_config.hpp>
|
||||
#endif
|
||||
// if we have a compiler config, include it now:
|
||||
#ifdef BOOST_COMPILER_CONFIG
|
||||
# include BOOST_COMPILER_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a std library config set, try and find one:
|
||||
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG)
|
||||
# include <boost/config/select_stdlib_config.hpp>
|
||||
#endif
|
||||
// if we have a std library config, include it now:
|
||||
#ifdef BOOST_STDLIB_CONFIG
|
||||
# include BOOST_STDLIB_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a platform config set, try and find one:
|
||||
#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
|
||||
# include <boost/config/select_platform_config.hpp>
|
||||
#endif
|
||||
// if we have a platform config, include it now:
|
||||
#ifdef BOOST_PLATFORM_CONFIG
|
||||
# include BOOST_PLATFORM_CONFIG
|
||||
#endif
|
||||
|
||||
// get config suffix code:
|
||||
#include <boost/config/suffix.hpp>
|
||||
|
||||
#endif // BOOST_CONFIG_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Microsoft Visual C++ compiler setup:
|
||||
|
||||
#define BOOST_MSVC _MSC_VER
|
||||
|
||||
// turn off the warnings before we #include anything
|
||||
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
|
||||
|
||||
#if _MSC_VER <= 1200 // 1200 == VC++ 6.0
|
||||
#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
|
||||
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
# define BOOST_NO_VOID_RETURNS
|
||||
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
|
||||
# define BOOST_NO_DEDUCED_TYPENAME
|
||||
// disable min/max macro defines on vc6:
|
||||
//
|
||||
#endif
|
||||
|
||||
#if (_MSC_VER <= 1300) // 1200 == VC++ 7.0
|
||||
|
||||
#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
#endif
|
||||
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_NO_PRIVATE_IN_AGGREGATE
|
||||
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
|
||||
// VC++ 6/7 has member templates but they have numerous problems including
|
||||
// cases of silent failure, so for safety we define:
|
||||
# define BOOST_NO_MEMBER_TEMPLATES
|
||||
// For VC++ experts wishing to attempt workarounds, we define:
|
||||
# define BOOST_MSVC6_MEMBER_TEMPLATES
|
||||
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
# define BOOST_NO_USING_TEMPLATE
|
||||
# define BOOST_NO_SWPRINTF
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
# if (_MSC_VER > 1200)
|
||||
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1310 // 1310 == VC++ 7.1
|
||||
# define BOOST_NO_SWPRINTF
|
||||
#endif
|
||||
|
||||
#if _MSC_VER <= 1310
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
#endif
|
||||
|
||||
#ifndef _NATIVE_WCHAR_T_DEFINED
|
||||
# define BOOST_NO_INTRINSIC_WCHAR_T
|
||||
#endif
|
||||
|
||||
//
|
||||
// check for exception handling support:
|
||||
#ifndef _CPPUNWIND
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
//
|
||||
// __int64 support:
|
||||
//
|
||||
#if (_MSC_VER >= 1200) && defined(_MSC_EXTENSIONS)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
#endif
|
||||
#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS)
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
//
|
||||
// disable Win32 API's if compiler extentions are
|
||||
// turned off:
|
||||
//
|
||||
#ifndef _MSC_EXTENSIONS
|
||||
# define BOOST_DISABLE_WIN32
|
||||
#endif
|
||||
|
||||
# if _MSC_VER == 1200
|
||||
# define BOOST_COMPILER_VERSION 6.0
|
||||
# elif _MSC_VER == 1300
|
||||
# define BOOST_COMPILER_VERSION 7.0
|
||||
# elif _MSC_VER == 1310
|
||||
# define BOOST_COMPILER_VERSION 7.1
|
||||
# else
|
||||
# define BOOST_COMPILER_VERSION _MSC_VER
|
||||
# endif
|
||||
|
||||
#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
|
||||
|
||||
//
|
||||
// versions check:
|
||||
// we don't support Visual C++ prior to version 6:
|
||||
#if _MSC_VER < 1200
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are 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)
|
||||
//
|
||||
// The aim of this header is just to include <utility> but to do
|
||||
// so in a way that does not result in recursive inclusion of
|
||||
// the Boost TR1 components if boost/tr1/tr1/utility is in the
|
||||
// include search path. We have to do this to avoid circular
|
||||
// dependencies:
|
||||
//
|
||||
|
||||
#ifndef BOOST_CONFIG_UTILITY
|
||||
# define BOOST_CONFIG_UTILITY
|
||||
|
||||
# ifndef BOOST_TR1_NO_RECURSION
|
||||
# define BOOST_TR1_NO_RECURSION
|
||||
# define BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# endif
|
||||
|
||||
# include <utility>
|
||||
|
||||
# ifdef BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# undef BOOST_TR1_NO_RECURSION
|
||||
# undef BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Win32 specific config options:
|
||||
|
||||
#define BOOST_PLATFORM "Win32"
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF)
|
||||
# define BOOST_NO_SWPRINTF
|
||||
#endif
|
||||
|
||||
//
|
||||
// Win32 will normally be using native Win32 threads,
|
||||
// but there is a pthread library avaliable as an option,
|
||||
// we used to disable this when BOOST_DISABLE_WIN32 was
|
||||
// defined but no longer - this should allow some
|
||||
// files to be compiled in strict mode - while maintaining
|
||||
// a consistent setting of BOOST_HAS_THREADS across
|
||||
// all translation units (needed for shared_ptr etc).
|
||||
//
|
||||
#ifndef BOOST_HAS_PTHREADS
|
||||
# define BOOST_HAS_WINTHREADS
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_DISABLE_WIN32
|
||||
// WEK: Added
|
||||
#define BOOST_HAS_FTIME
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// disable min/max macros:
|
||||
//
|
||||
#ifdef min
|
||||
# undef min
|
||||
#endif
|
||||
#ifdef max
|
||||
# undef max
|
||||
#endif
|
||||
#ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
namespace std{
|
||||
// Apparently, something in the Microsoft libraries requires the "long"
|
||||
// overload, because it calls the min/max functions with arguments of
|
||||
// slightly different type. (If this proves to be incorrect, this
|
||||
// whole "BOOST_MSVC" section can be removed.)
|
||||
inline long min(long __a, long __b) {
|
||||
return __b < __a ? __b : __a;
|
||||
}
|
||||
inline long max(long __a, long __b) {
|
||||
return __a < __b ? __b : __a;
|
||||
}
|
||||
// The "long double" overload is required, otherwise user code calling
|
||||
// min/max for floating-point numbers will use the "long" overload.
|
||||
// (SourceForge bug #495495)
|
||||
inline long double min(long double __a, long double __b) {
|
||||
return __b < __a ? __b : __a;
|
||||
}
|
||||
inline long double max(long double __a, long double __b) {
|
||||
return __a < __b ? __b : __a;
|
||||
}
|
||||
}
|
||||
using std::min;
|
||||
using std::max;
|
||||
# endif
|
||||
@@ -0,0 +1,78 @@
|
||||
// Boost compiler configuration selection header file
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// locate which compiler we are using and define
|
||||
// BOOST_COMPILER_CONFIG as needed:
|
||||
|
||||
# if defined __COMO__
|
||||
// Comeau C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
|
||||
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
|
||||
// Intel
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/intel.hpp"
|
||||
|
||||
# elif defined __GNUC__
|
||||
// GNU C++:
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc.hpp"
|
||||
|
||||
#elif defined __KCC
|
||||
// Kai C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/kai.hpp"
|
||||
|
||||
#elif defined __sgi
|
||||
// SGI MIPSpro C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/sgi_mipspro.hpp"
|
||||
|
||||
#elif defined __DECCXX
|
||||
// Compaq Tru64 Unix cxx
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/compaq_cxx.hpp"
|
||||
|
||||
#elif defined __ghs
|
||||
// Greenhills C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/greenhills.hpp"
|
||||
|
||||
#elif defined __BORLANDC__
|
||||
// Borland
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/borland.hpp"
|
||||
|
||||
#elif defined __MWERKS__
|
||||
// Metrowerks CodeWarrior
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/metrowerks.hpp"
|
||||
|
||||
#elif defined __SUNPRO_CC
|
||||
// Sun Workshop Compiler C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/sunpro_cc.hpp"
|
||||
|
||||
#elif defined __HP_aCC
|
||||
// HP aCC
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/hp_acc.hpp"
|
||||
|
||||
#elif defined(__MRC__) || defined(__SC__)
|
||||
// MPW MrCpp or SCpp
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/mpw.hpp"
|
||||
|
||||
#elif defined(__IBMCPP__)
|
||||
// IBM Visual Age
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/vacpp.hpp"
|
||||
|
||||
#elif defined _MSC_VER
|
||||
// Microsoft Visual C++
|
||||
//
|
||||
// Must remain the last #elif since some other vendors (Metrowerks, for
|
||||
// example) also #define _MSC_VER
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/visualc.hpp"
|
||||
|
||||
#elif defined (BOOST_ASSERT_CONFIG)
|
||||
// this must come last - generate an error if we don't
|
||||
// recognise the compiler:
|
||||
# error "Unknown compiler - please configure and report the results to boost.org"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
// Boost compiler configuration selection header file
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// locate which platform we are on and define BOOST_PLATFORM_CONFIG as needed.
|
||||
// Note that we define the headers to include using "header_name" not
|
||||
// <header_name> in order to prevent macro expansion within the header
|
||||
// name (for example "linux" is a macro on linux systems).
|
||||
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__)
|
||||
// linux:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
// BSD:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/bsd.hpp"
|
||||
|
||||
#elif defined(sun) || defined(__sun)
|
||||
// solaris:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/solaris.hpp"
|
||||
|
||||
#elif defined(__sgi)
|
||||
// SGI Irix:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/irix.hpp"
|
||||
|
||||
#elif defined(__hpux)
|
||||
// hp unix:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/hpux.hpp"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
// cygwin is not win32:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/cygwin.hpp"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
// win32:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp"
|
||||
|
||||
#elif defined(__BEOS__)
|
||||
// BeOS
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp"
|
||||
|
||||
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
|
||||
// MacOS
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/macos.hpp"
|
||||
|
||||
#elif defined(__IBMCPP__)
|
||||
// IBM
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp"
|
||||
|
||||
#elif defined(__amigaos__)
|
||||
// AmigaOS
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp"
|
||||
|
||||
#else
|
||||
|
||||
# if defined(unix) \
|
||||
|| defined(__unix) \
|
||||
|| defined(_XOPEN_SOURCE) \
|
||||
|| defined(_POSIX_SOURCE)
|
||||
|
||||
// generic unix platform:
|
||||
|
||||
# ifndef BOOST_HAS_UNISTD_H
|
||||
# define BOOST_HAS_UNISTD_H
|
||||
# endif
|
||||
|
||||
# include <boost/config/posix_features.hpp>
|
||||
|
||||
# endif
|
||||
|
||||
# if defined (BOOST_ASSERT_CONFIG)
|
||||
// this must come last - generate an error if we don't
|
||||
// recognise the platform:
|
||||
# error "Unknown platform - please configure and report the results to boost.org"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
// Boost compiler configuration selection header file
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed:
|
||||
|
||||
// we need to include a std lib header here in order to detect which
|
||||
// library is in use, use <utility> as it's about the smallest
|
||||
// of the std lib headers - do not rely on this header being included -
|
||||
// users can short-circuit this header if they know whose std lib
|
||||
// they are using.
|
||||
|
||||
#include <utility>
|
||||
|
||||
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||
// STLPort library; this _must_ come first, otherwise since
|
||||
// STLport typically sits on top of some other library, we
|
||||
// can end up detecting that first rather than STLport:
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
|
||||
|
||||
#elif defined(__LIBCOMO__)
|
||||
// Comeau STL:
|
||||
#define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp"
|
||||
|
||||
#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
|
||||
// Rogue Wave library:
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
|
||||
|
||||
#elif defined(__GLIBCPP__)
|
||||
// GNU libstdc++ 3
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
|
||||
|
||||
#elif defined(__STL_CONFIG_H)
|
||||
// generic SGI STL
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/sgi.hpp"
|
||||
|
||||
#elif defined(__MSL_CPP__)
|
||||
// MSL standard lib:
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/msl.hpp"
|
||||
|
||||
#elif defined(__IBMCPP__)
|
||||
// take the default VACPP std lib
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/vacpp.hpp"
|
||||
|
||||
#elif defined(MSIPL_COMPILE_H)
|
||||
// Modena C++ standard library
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/modena.hpp"
|
||||
|
||||
#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
|
||||
// Dinkumware Library (this has to appear after any possible replacement libraries):
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/dinkumware.hpp"
|
||||
|
||||
#elif defined (BOOST_ASSERT_CONFIG)
|
||||
// this must come last - generate an error if we don't
|
||||
// recognise the library:
|
||||
# error "Unknown standard library - please configure and report the results to boost.org"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Dinkumware standard library config:
|
||||
|
||||
#if !defined(_YVALS) && !defined(_CPPLIB_VER)
|
||||
#include <utility>
|
||||
#if !defined(_YVALS) && !defined(_CPPLIB_VER)
|
||||
#error This is not the Dinkumware lib!
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
|
||||
// full dinkumware 3.06 and above
|
||||
// fully conforming provided the compiler supports it:
|
||||
# if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(_STD) // can be defined in yvals.h
|
||||
# define BOOST_NO_STDC_NAMESPACE
|
||||
# endif
|
||||
# if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300))
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
# endif
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1300)
|
||||
// if this lib version is set up for vc6 then there is no std::use_facet:
|
||||
# define BOOST_NO_STD_USE_FACET
|
||||
# define BOOST_HAS_TWO_ARG_USE_FACET
|
||||
// C lib functions aren't in namespace std either:
|
||||
# define BOOST_NO_STDC_NAMESPACE
|
||||
// and nor is <exception>
|
||||
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
|
||||
# endif
|
||||
// There's no numeric_limits<long long> support unless _LONGLONG is defined:
|
||||
# if !defined(_LONGLONG) && (_CPPLIB_VER <= 310)
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
# endif
|
||||
// 3.06 appears to have (non-sgi versions of) <hash_set> & <hash_map>,
|
||||
// and no <slist> at all
|
||||
#else
|
||||
# define BOOST_MSVC_STD_ITERATOR 1
|
||||
# define BOOST_NO_STD_ITERATOR
|
||||
# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
# define BOOST_NO_STDC_NAMESPACE
|
||||
# define BOOST_NO_STD_USE_FACET
|
||||
# define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
|
||||
# define BOOST_HAS_MACRO_USE_FACET
|
||||
# ifndef _CPPLIB_VER
|
||||
// Updated Dinkum library defines this, and provides
|
||||
// its own min and max definitions.
|
||||
# define BOOST_NO_STD_MIN_MAX
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
|
||||
// if we're using a dinkum lib that's
|
||||
// been configured for VC6/7 then there is
|
||||
// no iterator traits (true even for icl)
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
#endif
|
||||
|
||||
#if defined(__ICL) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
|
||||
// Intel C++ chokes over any non-trivial use of <locale>
|
||||
// this may be an overly restrictive define, but regex fails without it:
|
||||
# define BOOST_NO_STD_LOCALE
|
||||
#endif
|
||||
|
||||
#ifdef _CPPLIB_VER
|
||||
# define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER)
|
||||
#else
|
||||
# define BOOST_STDLIB "Dinkumware standard library version 1.x"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
383
Server/RylServerProject/BaseLibrary/boost/config/suffix.hpp
Normal file
383
Server/RylServerProject/BaseLibrary/boost/config/suffix.hpp
Normal file
@@ -0,0 +1,383 @@
|
||||
// Boost config.hpp configuration header file ------------------------------//
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Boost config.hpp policy and rationale documentation has been moved to
|
||||
// http://www.boost.org/libs/config
|
||||
//
|
||||
// This file is intended to be stable, and relatively unchanging.
|
||||
// It should contain boilerplate code only - no compiler specific
|
||||
// code unless it is unavoidable - no changes unless unavoidable.
|
||||
|
||||
#ifndef BOOST_CONFIG_SUFFIX_HPP
|
||||
#define BOOST_CONFIG_SUFFIX_HPP
|
||||
|
||||
//
|
||||
// look for long long by looking for the appropriate macros in <limits.h>.
|
||||
// Note that we use limits.h rather than climits for maximal portability,
|
||||
// remember that since these just declare a bunch of macros, there should be
|
||||
// no namespace issues from this.
|
||||
//
|
||||
#include <limits.h>
|
||||
# if !defined(BOOST_HAS_LONG_LONG) \
|
||||
&& !(defined(BOOST_MSVC) && BOOST_MSVC <=1300) && !defined(__BORLANDC__) \
|
||||
&& (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
#endif
|
||||
|
||||
// GCC 3.x will clean up all of those nasty macro definitions that
|
||||
// BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
|
||||
// it under GCC 3.x.
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
|
||||
# undef BOOST_NO_CTYPE_FUNCTIONS
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Assume any extensions are in namespace std:: unless stated otherwise:
|
||||
//
|
||||
# ifndef BOOST_STD_EXTENSION_NAMESPACE
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE std
|
||||
# endif
|
||||
|
||||
//
|
||||
// If cv-qualified specializations are not allowed, then neither are cv-void ones:
|
||||
//
|
||||
# if defined(BOOST_NO_CV_SPECIALIZATIONS) \
|
||||
&& !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
|
||||
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
# endif
|
||||
|
||||
//
|
||||
// If there is no numeric_limits template, then it can't have any compile time
|
||||
// constants either!
|
||||
//
|
||||
# if defined(BOOST_NO_LIMITS) \
|
||||
&& !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
|
||||
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
|
||||
# endif
|
||||
|
||||
//
|
||||
// if there is no long long then there is no specialisation
|
||||
// for numeric_limits<long long> either:
|
||||
//
|
||||
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
|
||||
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
|
||||
#endif
|
||||
|
||||
//
|
||||
// if there is no __int64 then there is no specialisation
|
||||
// for numeric_limits<__int64> either:
|
||||
//
|
||||
#if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
#endif
|
||||
|
||||
//
|
||||
// if member templates are supported then so is the
|
||||
// VC6 subset of member templates:
|
||||
//
|
||||
# if !defined(BOOST_NO_MEMBER_TEMPLATES) \
|
||||
&& !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
||||
# define BOOST_MSVC6_MEMBER_TEMPLATES
|
||||
# endif
|
||||
|
||||
//
|
||||
// Without partial specialization, can't test for partial specialisation bugs:
|
||||
//
|
||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
|
||||
# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
|
||||
# endif
|
||||
|
||||
//
|
||||
// Without partial specialization, std::iterator_traits can't work:
|
||||
//
|
||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
# endif
|
||||
|
||||
//
|
||||
// Without member template support, we can't have template constructors
|
||||
// in the standard library either:
|
||||
//
|
||||
# if defined(BOOST_NO_MEMBER_TEMPLATES) \
|
||||
&& !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
|
||||
&& !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
|
||||
# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
|
||||
# endif
|
||||
|
||||
//
|
||||
// Without member template support, we can't have a conforming
|
||||
// std::allocator template either:
|
||||
//
|
||||
# if defined(BOOST_NO_MEMBER_TEMPLATES) \
|
||||
&& !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
|
||||
&& !defined(BOOST_NO_STD_ALLOCATOR)
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
# endif
|
||||
|
||||
//
|
||||
// If we have a standard allocator, then we have a partial one as well:
|
||||
//
|
||||
#if !defined(BOOST_NO_STD_ALLOCATOR)
|
||||
# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
|
||||
#endif
|
||||
|
||||
//
|
||||
// We can't have a working std::use_facet if there is no std::locale:
|
||||
//
|
||||
# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
|
||||
# define BOOST_NO_STD_USE_FACET
|
||||
# endif
|
||||
|
||||
//
|
||||
// We can't have a std::messages facet if there is no std::locale:
|
||||
//
|
||||
# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
|
||||
# define BOOST_NO_STD_MESSAGES
|
||||
# endif
|
||||
|
||||
//
|
||||
// We can't have a working std::wstreambuf if there is no std::locale:
|
||||
//
|
||||
# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
|
||||
# define BOOST_NO_STD_WSTREAMBUF
|
||||
# endif
|
||||
|
||||
//
|
||||
// We can't have a <cwctype> if there is no <cwchar>:
|
||||
//
|
||||
# if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
|
||||
# define BOOST_NO_CWCTYPE
|
||||
# endif
|
||||
|
||||
//
|
||||
// We can't have a swprintf if there is no <cwchar>:
|
||||
//
|
||||
# if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
|
||||
# define BOOST_NO_SWPRINTF
|
||||
# endif
|
||||
|
||||
//
|
||||
// If Win32 support is turned off, then we must turn off
|
||||
// threading support also, unless there is some other
|
||||
// thread API enabled:
|
||||
//
|
||||
#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
|
||||
&& !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
|
||||
# define BOOST_DISABLE_THREADS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Turn on threading support if the compiler thinks that it's in
|
||||
// multithreaded mode. We put this here because there are only a
|
||||
// limited number of macros that identify this (if there's any missing
|
||||
// from here then add to the appropriate compiler section):
|
||||
//
|
||||
#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
|
||||
|| defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
|
||||
# define BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Turn threading support off if BOOST_DISABLE_THREADS is defined:
|
||||
//
|
||||
#if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
|
||||
# undef BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Turn threading support off if we don't recognise the threading API:
|
||||
//
|
||||
#if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
|
||||
&& !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
|
||||
&& !defined(BOOST_HAS_MPTASKS)
|
||||
# undef BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
//
|
||||
// If the compiler claims to be C99 conformant, then it had better
|
||||
// have a <stdint.h>:
|
||||
//
|
||||
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
# define BOOST_HAS_STDINT_H
|
||||
# endif
|
||||
|
||||
//
|
||||
// Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
|
||||
// Note that this is for backwards compatibility only.
|
||||
//
|
||||
# ifndef BOOST_HAS_SLIST
|
||||
# define BOOST_NO_SLIST
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_HAS_HASH
|
||||
# define BOOST_NO_HASH
|
||||
# endif
|
||||
|
||||
// BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
|
||||
// Because std::size_t usage is so common, even in boost headers which do not
|
||||
// otherwise use the C library, the <cstddef> workaround is included here so
|
||||
// that ugly workaround code need not appear in many other boost headers.
|
||||
// NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
|
||||
// must still be #included in the usual places so that <cstddef> inclusion
|
||||
// works as expected with standard conforming compilers. The resulting
|
||||
// double inclusion of <cstddef> is harmless.
|
||||
|
||||
# ifdef BOOST_NO_STDC_NAMESPACE
|
||||
# include <cstddef>
|
||||
namespace std { using ::ptrdiff_t; using ::size_t; }
|
||||
# endif
|
||||
|
||||
// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
|
||||
|
||||
# ifdef BOOST_NO_STD_MIN_MAX
|
||||
|
||||
namespace std {
|
||||
template <class _Tp>
|
||||
inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
|
||||
return __b < __a ? __b : __a;
|
||||
}
|
||||
template <class _Tp>
|
||||
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
|
||||
return __a < __b ? __b : __a;
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
// BOOST_STATIC_CONSTANT workaround --------------------------------------- //
|
||||
// On compilers which don't allow in-class initialization of static integral
|
||||
// constant members, we must use enums as a workaround if we want the constants
|
||||
// to be available at compile-time. This macro gives us a convenient way to
|
||||
// declare such constants.
|
||||
|
||||
# ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
|
||||
# else
|
||||
# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
|
||||
# endif
|
||||
|
||||
// BOOST_USE_FACET workaround ----------------------------------------------//
|
||||
// When the standard library does not have a conforming std::use_facet there
|
||||
// are various workarounds available, but they differ from library to library.
|
||||
// This macro provides a consistent way to access a locale's facets.
|
||||
// Usage:
|
||||
// replace
|
||||
// std::use_facet<Type>(loc);
|
||||
// with
|
||||
// BOOST_USE_FACET(Type, loc);
|
||||
// Note do not add a std:: prefix to the front of BOOST_USE_FACET!
|
||||
|
||||
#if defined(BOOST_NO_STD_USE_FACET)
|
||||
# ifdef BOOST_HAS_TWO_ARG_USE_FACET
|
||||
# define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
|
||||
# elif defined(BOOST_HAS_MACRO_USE_FACET)
|
||||
# define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
|
||||
# elif defined(BOOST_HAS_STLP_USE_FACET)
|
||||
# define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
|
||||
# endif
|
||||
#else
|
||||
# define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
|
||||
#endif
|
||||
|
||||
// BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
|
||||
// Member templates are supported by some compilers even though they can't use
|
||||
// the A::template member<U> syntax, as a workaround replace:
|
||||
//
|
||||
// typedef typename A::template rebind<U> binder;
|
||||
//
|
||||
// with:
|
||||
//
|
||||
// typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
|
||||
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
|
||||
# define BOOST_NESTED_TEMPLATE template
|
||||
#else
|
||||
# define BOOST_NESTED_TEMPLATE
|
||||
#endif
|
||||
|
||||
// BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------//
|
||||
// Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
||||
// is defined, in which case it evaluates to return x; Use when you have a return
|
||||
// statement that can never be reached.
|
||||
|
||||
#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
||||
# define BOOST_UNREACHABLE_RETURN(x) return x;
|
||||
#else
|
||||
# define BOOST_UNREACHABLE_RETURN(x)
|
||||
#endif
|
||||
|
||||
// BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
|
||||
//
|
||||
// Some compilers don't support the use of `typename' for dependent
|
||||
// types in deduced contexts, e.g.
|
||||
//
|
||||
// template <class T> void f(T, typename T::type);
|
||||
// ^^^^^^^^
|
||||
// Replace these declarations with:
|
||||
//
|
||||
// template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);
|
||||
|
||||
#ifndef BOOST_NO_DEDUCED_TYPENAME
|
||||
# define BOOST_DEDUCED_TYPENAME typename
|
||||
#else
|
||||
# define BOOST_DEDUCED_TYPENAME
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------//
|
||||
|
||||
//
|
||||
// Helper macro BOOST_STRINGIZE:
|
||||
// Converts the parameter X to a string after macro replacement
|
||||
// on X has been performed.
|
||||
//
|
||||
#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
|
||||
#define BOOST_DO_STRINGIZE(X) #X
|
||||
|
||||
//
|
||||
// Helper macro BOOST_JOIN:
|
||||
// The following piece of macro magic joins the two
|
||||
// arguments together, even when one of the arguments is
|
||||
// itself a macro (see 16.3.1 in C++ standard). The key
|
||||
// is that macro expansion of macro arguments does not
|
||||
// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
|
||||
//
|
||||
#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
|
||||
#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
|
||||
#define BOOST_DO_JOIN2( X, Y ) X##Y
|
||||
|
||||
//
|
||||
// Set some default values for compiler/library/platform names.
|
||||
// These are for debugging config setup only:
|
||||
//
|
||||
# ifndef BOOST_COMPILER
|
||||
# define BOOST_COMPILER "Unknown ISO C++ Compiler"
|
||||
# endif
|
||||
# ifndef BOOST_STDLIB
|
||||
# define BOOST_STDLIB "Unknown ISO standard library"
|
||||
# endif
|
||||
# ifndef BOOST_PLATFORM
|
||||
# if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
|
||||
|| defined(_POSIX_SOURCE)
|
||||
# define BOOST_PLATFORM "Generic Unix"
|
||||
# else
|
||||
# define BOOST_PLATFORM "Unknown"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
68
Server/RylServerProject/BaseLibrary/boost/config/user.hpp
Normal file
68
Server/RylServerProject/BaseLibrary/boost/config/user.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
// boost/config/user.hpp ---------------------------------------------------//
|
||||
|
||||
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// Do not check in modified versions of this file,
|
||||
// This file may be customized by the end user, but not by boost.
|
||||
|
||||
//
|
||||
// Use this file to define a site and compiler specific
|
||||
// configuration policy:
|
||||
//
|
||||
|
||||
// define this to locate a compiler config file:
|
||||
// #define BOOST_COMPILER_CONFIG <myheader>
|
||||
|
||||
// define this to locate a stdlib config file:
|
||||
// #define BOOST_STDLIB_CONFIG <myheader>
|
||||
|
||||
// define this to locate a platform config file:
|
||||
// #define BOOST_PLATFORM_CONFIG <myheader>
|
||||
|
||||
// define this to disable compiler config,
|
||||
// use if your compiler config has nothing to set:
|
||||
// #define BOOST_NO_COMPILER_CONFIG
|
||||
|
||||
// define this to disable stdlib config,
|
||||
// use if your stdlib config has nothing to set:
|
||||
// #define BOOST_NO_STDLIB_CONFIG
|
||||
|
||||
// define this to disable platform config,
|
||||
// use if your platform config has nothing to set:
|
||||
// #define BOOST_NO_PLATFORM_CONFIG
|
||||
|
||||
// define this to disable all config options,
|
||||
// excluding the user config. Use if your
|
||||
// setup is fully ISO compliant, and has no
|
||||
// useful extensions, or for autoconf generated
|
||||
// setups:
|
||||
// #define BOOST_NO_CONFIG
|
||||
|
||||
// define this to make the config "optimistic"
|
||||
// about unknown compiler versions. Normally
|
||||
// unknown compiler versions are assumed to have
|
||||
// all the defects of the last known version, however
|
||||
// setting this flag, causes the config to assume
|
||||
// that unknown compiler versions are fully conformant
|
||||
// with the standard:
|
||||
// #define BOOST_STRICT_CONFIG
|
||||
|
||||
// define this to cause the config to halt compilation
|
||||
// with an #error if it encounters anything unknown --
|
||||
// either an unknown compiler version or an unknown
|
||||
// compiler/platform/library:
|
||||
// #define BOOST_ASSERT_CONFIG
|
||||
|
||||
|
||||
// define if you want to disable threading support, even
|
||||
// when available:
|
||||
// #define BOOST_DISABLE_THREADS
|
||||
|
||||
// define when you want to disable Win32 specific features
|
||||
// even when available:
|
||||
// #define BOOST_DISABLE_WIN32
|
||||
|
||||
|
||||
463
Server/RylServerProject/BaseLibrary/boost/detail/limits.hpp
Normal file
463
Server/RylServerProject/BaseLibrary/boost/detail/limits.hpp
Normal file
@@ -0,0 +1,463 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/* NOTE: This is not portable code. Parts of numeric_limits<> are
|
||||
* inherently machine-dependent, and this file is written for the MIPS
|
||||
* architecture and the SGI MIPSpro C++ compiler. Parts of it (in
|
||||
* particular, some of the characteristics of floating-point types)
|
||||
* are almost certainly incorrect for any other platform.
|
||||
*/
|
||||
|
||||
/* The above comment is almost certainly out of date. This file works
|
||||
* on systems other than SGI MIPSpro C++ now.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Revision history:
|
||||
* 21 Sep 2001:
|
||||
* Only include <cwchar> if BOOST_NO_CWCHAR is defined. (Darin Adler)
|
||||
* 10 Aug 2001:
|
||||
* Added MIPS (big endian) to the big endian family. (Jens Maurer)
|
||||
* 13 Apr 2001:
|
||||
* Added powerpc to the big endian family. (Jeremy Siek)
|
||||
* 5 Apr 2001:
|
||||
* Added sparc (big endian) processor support (John Maddock).
|
||||
* Initial sub:
|
||||
* Modified by Jens Maurer for gcc 2.95 on x86.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_SGI_CPP_LIMITS
|
||||
#define BOOST_SGI_CPP_LIMITS
|
||||
|
||||
#include <climits>
|
||||
#include <cfloat>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#include <cwchar> // for WCHAR_MIN and WCHAR_MAX
|
||||
#endif
|
||||
|
||||
// The macros are not named appropriately. We don't care about integer
|
||||
// bit layout, but about floating-point NaN (etc.) bit patterns.
|
||||
#if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__ppc__) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER)
|
||||
#define BOOST_BIG_ENDIAN
|
||||
#elif defined(__i386__) || defined(__alpha__)
|
||||
#define BOOST_LITTLE_ENDIAN
|
||||
#else
|
||||
#error The file boost/detail/limits.hpp needs to be set up for your CPU type.
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
|
||||
enum float_round_style {
|
||||
round_indeterminate = -1,
|
||||
round_toward_zero = 0,
|
||||
round_to_nearest = 1,
|
||||
round_toward_infinity = 2,
|
||||
round_toward_neg_infinity = 3
|
||||
};
|
||||
|
||||
enum float_denorm_style {
|
||||
denorm_indeterminate = -1,
|
||||
denorm_absent = 0,
|
||||
denorm_present = 1
|
||||
};
|
||||
|
||||
// The C++ standard (section 18.2.1) requires that some of the members of
|
||||
// numeric_limits be static const data members that are given constant-
|
||||
// initializers within the class declaration. On compilers where the
|
||||
// BOOST_NO_INCLASS_MEMBER_INITIALIZATION macro is defined, it is impossible to write
|
||||
// a standard-conforming numeric_limits class.
|
||||
//
|
||||
// There are two possible workarounds: either initialize the data
|
||||
// members outside the class, or change them from data members to
|
||||
// enums. Neither workaround is satisfactory: the former makes it
|
||||
// impossible to use the data members in constant-expressions, and the
|
||||
// latter means they have the wrong type and that it is impossible to
|
||||
// take their addresses. We choose the former workaround.
|
||||
|
||||
#ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \
|
||||
enum { __mem_name = __mem_value }
|
||||
#else /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */
|
||||
# define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \
|
||||
static const __mem_type __mem_name = __mem_value
|
||||
#endif /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */
|
||||
|
||||
// Deal with min/max for MinGW
|
||||
#ifdef min
|
||||
# undef min
|
||||
#endif
|
||||
|
||||
#ifdef max
|
||||
# undef max
|
||||
#endif
|
||||
|
||||
// Base class for all specializations of numeric_limits.
|
||||
template <class __number>
|
||||
class _Numeric_limits_base {
|
||||
public:
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false);
|
||||
|
||||
static __number min() throw() { return __number(); }
|
||||
static __number max() throw() { return __number(); }
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, 0);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, 0);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, false);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 0);
|
||||
|
||||
static __number epsilon() throw() { return __number(); }
|
||||
static __number round_error() throw() { return __number(); }
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style,
|
||||
has_denorm,
|
||||
denorm_absent);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false);
|
||||
|
||||
static __number infinity() throw() { return __number(); }
|
||||
static __number quiet_NaN() throw() { return __number(); }
|
||||
static __number signaling_NaN() throw() { return __number(); }
|
||||
static __number denorm_min() throw() { return __number(); }
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style,
|
||||
round_style,
|
||||
round_toward_zero);
|
||||
};
|
||||
|
||||
// Base class for integers.
|
||||
|
||||
template <class _Int,
|
||||
_Int __imin,
|
||||
_Int __imax,
|
||||
int __idigits = -1>
|
||||
class _Integer_limits : public _Numeric_limits_base<_Int>
|
||||
{
|
||||
public:
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true);
|
||||
|
||||
static _Int min() throw() { return __imin; }
|
||||
static _Int max() throw() { return __imax; }
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int,
|
||||
digits,
|
||||
(__idigits < 0) ? (int)(sizeof(_Int) * CHAR_BIT)
|
||||
- (__imin == 0 ? 0 : 1)
|
||||
: __idigits);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, (digits * 301) / 1000);
|
||||
// log 2 = 0.301029995664...
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, __imin != 0);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, true);
|
||||
};
|
||||
|
||||
#if defined(BOOST_BIG_ENDIAN)
|
||||
|
||||
template<class Number, unsigned int Word>
|
||||
struct float_helper{
|
||||
static Number get_word() throw() {
|
||||
// sizeof(long double) == 16
|
||||
const unsigned int _S_word[4] = { Word, 0, 0, 0 };
|
||||
return *reinterpret_cast<const Number*>(&_S_word);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template<class Number, unsigned int Word>
|
||||
struct float_helper{
|
||||
static Number get_word() throw() {
|
||||
// sizeof(long double) == 12, but only 10 bytes significant
|
||||
const unsigned int _S_word[4] = { 0, 0, 0, Word };
|
||||
return *reinterpret_cast<const Number*>(
|
||||
reinterpret_cast<const char *>(&_S_word)+16-
|
||||
(sizeof(Number) == 12 ? 10 : sizeof(Number)));
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Base class for floating-point numbers.
|
||||
template <class __number,
|
||||
int __Digits, int __Digits10,
|
||||
int __MinExp, int __MaxExp,
|
||||
int __MinExp10, int __MaxExp10,
|
||||
unsigned int __InfinityWord,
|
||||
unsigned int __QNaNWord, unsigned int __SNaNWord,
|
||||
bool __IsIEC559,
|
||||
float_round_style __RoundStyle>
|
||||
class _Floating_limits : public _Numeric_limits_base<__number>
|
||||
{
|
||||
public:
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style,
|
||||
has_denorm,
|
||||
denorm_indeterminate);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false);
|
||||
|
||||
|
||||
static __number infinity() throw() {
|
||||
return float_helper<__number, __InfinityWord>::get_word();
|
||||
}
|
||||
static __number quiet_NaN() throw() {
|
||||
return float_helper<__number,__QNaNWord>::get_word();
|
||||
}
|
||||
static __number signaling_NaN() throw() {
|
||||
return float_helper<__number,__SNaNWord>::get_word();
|
||||
}
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true);
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false /* was: true */ );
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false);
|
||||
|
||||
BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle);
|
||||
};
|
||||
|
||||
// Class numeric_limits
|
||||
|
||||
// The unspecialized class.
|
||||
|
||||
template<class T>
|
||||
class numeric_limits : public _Numeric_limits_base<T> {};
|
||||
|
||||
// Specializations for all built-in integral types.
|
||||
|
||||
template<>
|
||||
class numeric_limits<bool>
|
||||
: public _Integer_limits<bool, false, true, 0>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<char>
|
||||
: public _Integer_limits<char, CHAR_MIN, CHAR_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<signed char>
|
||||
: public _Integer_limits<signed char, SCHAR_MIN, SCHAR_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<unsigned char>
|
||||
: public _Integer_limits<unsigned char, 0, UCHAR_MAX>
|
||||
{};
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<>
|
||||
class numeric_limits<wchar_t>
|
||||
#if !defined(WCHAR_MAX) || !defined(WCHAR_MIN)
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
: public _Integer_limits<wchar_t, 0, USHRT_MAX>
|
||||
#elif defined(__hppa)
|
||||
// wchar_t has "unsigned int" as the underlying type
|
||||
: public _Integer_limits<wchar_t, 0, UINT_MAX>
|
||||
#else
|
||||
// assume that wchar_t has "int" as the underlying type
|
||||
: public _Integer_limits<wchar_t, INT_MIN, INT_MAX>
|
||||
#endif
|
||||
#else
|
||||
// we have WCHAR_MIN and WCHAR_MAX defined, so use it
|
||||
: public _Integer_limits<wchar_t, WCHAR_MIN, WCHAR_MAX>
|
||||
#endif
|
||||
{};
|
||||
#endif
|
||||
|
||||
template<>
|
||||
class numeric_limits<short>
|
||||
: public _Integer_limits<short, SHRT_MIN, SHRT_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<unsigned short>
|
||||
: public _Integer_limits<unsigned short, 0, USHRT_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<int>
|
||||
: public _Integer_limits<int, INT_MIN, INT_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<unsigned int>
|
||||
: public _Integer_limits<unsigned int, 0, UINT_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<long>
|
||||
: public _Integer_limits<long, LONG_MIN, LONG_MAX>
|
||||
{};
|
||||
|
||||
template<>
|
||||
class numeric_limits<unsigned long>
|
||||
: public _Integer_limits<unsigned long, 0, ULONG_MAX>
|
||||
{};
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
// Some compilers have long long, but don't define the
|
||||
// LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This
|
||||
// assumes that long long is 64 bits.
|
||||
#if !defined(LONGLONG_MAX) && !defined(ULONGLONG_MAX)
|
||||
|
||||
# define ULONGLONG_MAX 0xffffffffffffffffLLU
|
||||
# define LONGLONG_MAX 0x7fffffffffffffffLL
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(LONGLONG_MIN)
|
||||
# define LONGLONG_MIN (-LONGLONG_MAX - 1)
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ULONGLONG_MIN)
|
||||
# define ULONGLONG_MIN 0
|
||||
#endif
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
// Specializations for all built-in floating-point type.
|
||||
|
||||
template<> class numeric_limits<float>
|
||||
: public _Floating_limits<float,
|
||||
FLT_MANT_DIG, // Binary digits of precision
|
||||
FLT_DIG, // Decimal digits of precision
|
||||
FLT_MIN_EXP, // Minimum exponent
|
||||
FLT_MAX_EXP, // Maximum exponent
|
||||
FLT_MIN_10_EXP, // Minimum base 10 exponent
|
||||
FLT_MAX_10_EXP, // Maximum base 10 exponent
|
||||
#if defined(BOOST_BIG_ENDIAN)
|
||||
0x7f80 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
|
||||
0x7f81 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
|
||||
0x7fc1 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
|
||||
#else
|
||||
0x7f800000u, // Last word of +infinity
|
||||
0x7f810000u, // Last word of quiet NaN
|
||||
0x7fc10000u, // Last word of signaling NaN
|
||||
#endif
|
||||
true, // conforms to iec559
|
||||
round_to_nearest>
|
||||
{
|
||||
public:
|
||||
static float min() throw() { return FLT_MIN; }
|
||||
static float denorm_min() throw() { return FLT_MIN; }
|
||||
static float max() throw() { return FLT_MAX; }
|
||||
static float epsilon() throw() { return FLT_EPSILON; }
|
||||
static float round_error() throw() { return 0.5f; } // Units: ulps.
|
||||
};
|
||||
|
||||
template<> class numeric_limits<double>
|
||||
: public _Floating_limits<double,
|
||||
DBL_MANT_DIG, // Binary digits of precision
|
||||
DBL_DIG, // Decimal digits of precision
|
||||
DBL_MIN_EXP, // Minimum exponent
|
||||
DBL_MAX_EXP, // Maximum exponent
|
||||
DBL_MIN_10_EXP, // Minimum base 10 exponent
|
||||
DBL_MAX_10_EXP, // Maximum base 10 exponent
|
||||
#if defined(BOOST_BIG_ENDIAN)
|
||||
0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
|
||||
0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
|
||||
0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
|
||||
#else
|
||||
0x7ff00000u, // Last word of +infinity
|
||||
0x7ff10000u, // Last word of quiet NaN
|
||||
0x7ff90000u, // Last word of signaling NaN
|
||||
#endif
|
||||
true, // conforms to iec559
|
||||
round_to_nearest>
|
||||
{
|
||||
public:
|
||||
static double min() throw() { return DBL_MIN; }
|
||||
static double denorm_min() throw() { return DBL_MIN; }
|
||||
static double max() throw() { return DBL_MAX; }
|
||||
static double epsilon() throw() { return DBL_EPSILON; }
|
||||
static double round_error() throw() { return 0.5; } // Units: ulps.
|
||||
};
|
||||
|
||||
template<> class numeric_limits<long double>
|
||||
: public _Floating_limits<long double,
|
||||
LDBL_MANT_DIG, // Binary digits of precision
|
||||
LDBL_DIG, // Decimal digits of precision
|
||||
LDBL_MIN_EXP, // Minimum exponent
|
||||
LDBL_MAX_EXP, // Maximum exponent
|
||||
LDBL_MIN_10_EXP,// Minimum base 10 exponent
|
||||
LDBL_MAX_10_EXP,// Maximum base 10 exponent
|
||||
#if defined(BOOST_BIG_ENDIAN)
|
||||
0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
|
||||
0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
|
||||
0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
|
||||
#else
|
||||
0x7fff8000u, // Last word of +infinity
|
||||
0x7fffc000u, // Last word of quiet NaN
|
||||
0x7fff9000u, // Last word of signaling NaN
|
||||
#endif
|
||||
false, // Doesn't conform to iec559
|
||||
round_to_nearest>
|
||||
{
|
||||
public:
|
||||
static long double min() throw() { return LDBL_MIN; }
|
||||
static long double denorm_min() throw() { return LDBL_MIN; }
|
||||
static long double max() throw() { return LDBL_MAX; }
|
||||
static long double epsilon() throw() { return LDBL_EPSILON; }
|
||||
static long double round_error() throw() { return 4; } // Units: ulps.
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif /* BOOST_SGI_CPP_LIMITS */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright David Abrahams 2002.
|
||||
// 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 WORKAROUND_DWA2002126_HPP
|
||||
# define WORKAROUND_DWA2002126_HPP
|
||||
|
||||
// Compiler/library version workaround macro
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// // workaround for eVC4 and VC6
|
||||
// ... // workaround code here
|
||||
// #endif
|
||||
//
|
||||
// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
|
||||
// first argument must be undefined or expand to a numeric
|
||||
// value. The above expands to:
|
||||
//
|
||||
// (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
|
||||
//
|
||||
// When used for workarounds that apply to the latest known version
|
||||
// and all earlier versions of a compiler, the following convention
|
||||
// should be observed:
|
||||
//
|
||||
// #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
|
||||
//
|
||||
// The version number in this case corresponds to the last version in
|
||||
// which the workaround was known to have been required. When
|
||||
// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
|
||||
// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
|
||||
// the workaround for any version of the compiler. When
|
||||
// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
|
||||
// error will be issued if the compiler version exceeds the argument
|
||||
// to BOOST_TESTED_AT(). This can be used to locate workarounds which
|
||||
// may be obsoleted by newer versions.
|
||||
|
||||
# ifndef BOOST_STRICT_CONFIG
|
||||
|
||||
# define BOOST_WORKAROUND(symbol, test) \
|
||||
((symbol != 0) && (1 % (( (symbol test) ) + 1)))
|
||||
// ^ ^ ^ ^
|
||||
// The extra level of parenthesis nesting above, along with the
|
||||
// BOOST_OPEN_PAREN indirection below, is required to satisfy the
|
||||
// broken preprocessor in MWCW 8.3 and earlier.
|
||||
//
|
||||
// The basic mechanism works as follows:
|
||||
// (symbol test) + 1 => if (symbol test) then 2 else 1
|
||||
// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0
|
||||
//
|
||||
// The complication with % is for cooperation with BOOST_TESTED_AT().
|
||||
// When "test" is BOOST_TESTED_AT(x) and
|
||||
// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
|
||||
//
|
||||
// symbol test => if (symbol <= x) then 1 else -1
|
||||
// (symbol test) + 1 => if (symbol <= x) then 2 else 0
|
||||
// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero
|
||||
//
|
||||
|
||||
# ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
|
||||
# define BOOST_OPEN_PAREN (
|
||||
# define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1
|
||||
# else
|
||||
# define BOOST_TESTED_AT(value) != ((value)-(value))
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_WORKAROUND(symbol, test) 0
|
||||
|
||||
# endif
|
||||
|
||||
#endif // WORKAROUND_DWA2002126_HPP
|
||||
139
Server/RylServerProject/BaseLibrary/boost/limits.hpp
Normal file
139
Server/RylServerProject/BaseLibrary/boost/limits.hpp
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// use this header as a workaround for missing <limits>
|
||||
|
||||
#ifndef BOOST_LIMITS
|
||||
#define BOOST_LIMITS
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_NO_LIMITS
|
||||
# include <boost/detail/limits.hpp>
|
||||
#else
|
||||
# include <limits>
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_HAS_LONG_LONG) && defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \
|
||||
|| (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS))
|
||||
// Add missing specializations for numeric_limits:
|
||||
#ifdef BOOST_HAS_MS_INT64
|
||||
# define BOOST_LLT __int64
|
||||
#else
|
||||
# define BOOST_LLT long long
|
||||
#endif
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
class numeric_limits<BOOST_LLT>
|
||||
{
|
||||
public:
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
|
||||
#ifdef BOOST_HAS_MS_INT64
|
||||
static BOOST_LLT min(){ return 0x8000000000000000i64; }
|
||||
static BOOST_LLT max(){ return 0x7FFFFFFFFFFFFFFFi64; }
|
||||
#elif defined(LLONG_MAX)
|
||||
static BOOST_LLT min(){ return LLONG_MIN; }
|
||||
static BOOST_LLT max(){ return LLONG_MAX; }
|
||||
#elif defined(LONGLONG_MAX)
|
||||
static BOOST_LLT min(){ return LONGLONG_MIN; }
|
||||
static BOOST_LLT max(){ return LONGLONG_MAX; }
|
||||
#else
|
||||
static BOOST_LLT min(){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
|
||||
static BOOST_LLT max(){ return ~min(); }
|
||||
#endif
|
||||
BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);
|
||||
BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);
|
||||
BOOST_STATIC_CONSTANT(bool, is_signed = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_integer = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_exact = true);
|
||||
BOOST_STATIC_CONSTANT(int, radix = 2);
|
||||
static BOOST_LLT epsilon() throw() { return 0; };
|
||||
static BOOST_LLT round_error() throw() { return 0; };
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, min_exponent = 0);
|
||||
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
|
||||
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
|
||||
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
|
||||
static BOOST_LLT infinity() throw() { return 0; };
|
||||
static BOOST_LLT quiet_NaN() throw() { return 0; };
|
||||
static BOOST_LLT signaling_NaN() throw() { return 0; };
|
||||
static BOOST_LLT denorm_min() throw() { return 0; };
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_bounded = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_modulo = false);
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, traps = false);
|
||||
BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
|
||||
BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
|
||||
|
||||
};
|
||||
|
||||
template<>
|
||||
class numeric_limits<unsigned BOOST_LLT>
|
||||
{
|
||||
public:
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
|
||||
#ifdef BOOST_HAS_MS_INT64
|
||||
static unsigned BOOST_LLT min(){ return 0ui64; }
|
||||
static unsigned BOOST_LLT max(){ return 0xFFFFFFFFFFFFFFFFui64; }
|
||||
#elif defined(ULLONG_MAX) && defined(ULLONG_MIN)
|
||||
static unsigned BOOST_LLT min(){ return ULLONG_MIN; }
|
||||
static unsigned BOOST_LLT max(){ return ULLONG_MAX; }
|
||||
#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)
|
||||
static unsigned BOOST_LLT min(){ return ULONGLONG_MIN; }
|
||||
static unsigned BOOST_LLT max(){ return ULONGLONG_MAX; }
|
||||
#else
|
||||
static unsigned BOOST_LLT min(){ return 0uLL; }
|
||||
static unsigned BOOST_LLT max(){ return ~0uLL; }
|
||||
#endif
|
||||
BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);
|
||||
BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);
|
||||
BOOST_STATIC_CONSTANT(bool, is_signed = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_integer = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_exact = true);
|
||||
BOOST_STATIC_CONSTANT(int, radix = 2);
|
||||
static unsigned BOOST_LLT epsilon() throw() { return 0; };
|
||||
static unsigned BOOST_LLT round_error() throw() { return 0; };
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, min_exponent = 0);
|
||||
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
|
||||
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
|
||||
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
|
||||
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
|
||||
static unsigned BOOST_LLT infinity() throw() { return 0; };
|
||||
static unsigned BOOST_LLT quiet_NaN() throw() { return 0; };
|
||||
static unsigned BOOST_LLT signaling_NaN() throw() { return 0; };
|
||||
static unsigned BOOST_LLT denorm_min() throw() { return 0; };
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_bounded = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_modulo = false);
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, traps = false);
|
||||
BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
|
||||
BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,105 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_CT_GCD_LCM_HPP
|
||||
#define BOOST_POOL_CT_GCD_LCM_HPP
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace details {
|
||||
namespace pool {
|
||||
|
||||
// Compile-time calculation of greatest common divisor and least common multiple
|
||||
|
||||
//
|
||||
// ct_gcd is a compile-time algorithm that calculates the greatest common
|
||||
// divisor of two unsigned integers, using Euclid's algorithm.
|
||||
//
|
||||
// assumes: A != 0 && B != 0
|
||||
//
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
namespace details {
|
||||
template <unsigned A, unsigned B, bool Bis0>
|
||||
struct ct_gcd_helper;
|
||||
template <unsigned A, unsigned B>
|
||||
struct ct_gcd_helper<A, B, false>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned, A_mod_B_ = A % B);
|
||||
BOOST_STATIC_CONSTANT(unsigned, value =
|
||||
(::boost::details::pool::details::ct_gcd_helper<
|
||||
B, static_cast<unsigned>(A_mod_B_),
|
||||
::boost::type_traits::ice_eq<A_mod_B_, 0>::value
|
||||
>::value) );
|
||||
};
|
||||
template <unsigned A, unsigned B>
|
||||
struct ct_gcd_helper<A, B, true>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned, value = A);
|
||||
};
|
||||
} // namespace details
|
||||
|
||||
template <unsigned A, unsigned B>
|
||||
struct ct_gcd
|
||||
{
|
||||
BOOST_STATIC_ASSERT(A != 0 && B != 0);
|
||||
BOOST_STATIC_CONSTANT(unsigned, value =
|
||||
(::boost::details::pool::details::ct_gcd_helper<A, B, false>::value) );
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// Thanks to Peter Dimov for providing this workaround!
|
||||
namespace details {
|
||||
template<unsigned A> struct ct_gcd2
|
||||
{
|
||||
template<unsigned B>
|
||||
struct helper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned, value = ct_gcd2<B>::helper<A % B>::value);
|
||||
};
|
||||
template<>
|
||||
struct helper<0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned, value = A);
|
||||
};
|
||||
};
|
||||
} // namespace details
|
||||
|
||||
template<unsigned A, unsigned B> struct ct_gcd
|
||||
{
|
||||
BOOST_STATIC_ASSERT(A != 0 && B != 0);
|
||||
enum { value = details::ct_gcd2<A>::helper<B>::value };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// ct_lcm is a compile-time algorithm that calculates the least common
|
||||
// multiple of two unsigned integers.
|
||||
//
|
||||
// assumes: A != 0 && B != 0
|
||||
//
|
||||
template <unsigned A, unsigned B>
|
||||
struct ct_lcm
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned, value =
|
||||
(A / ::boost::details::pool::ct_gcd<A, B>::value * B) );
|
||||
};
|
||||
|
||||
} // namespace pool
|
||||
} // namespace details
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_GCD_LCM_HPP
|
||||
#define BOOST_POOL_GCD_LCM_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace details {
|
||||
namespace pool {
|
||||
|
||||
// Greatest common divisor and least common multiple
|
||||
|
||||
//
|
||||
// gcd is an algorithm that calculates the greatest common divisor of two
|
||||
// integers, using Euclid's algorithm.
|
||||
//
|
||||
// Pre: A > 0 && B > 0
|
||||
// Recommended: A > B
|
||||
template <typename Integer>
|
||||
Integer gcd(Integer A, Integer B)
|
||||
{
|
||||
do
|
||||
{
|
||||
const Integer tmp(B);
|
||||
B = A % B;
|
||||
A = tmp;
|
||||
} while (B != 0);
|
||||
|
||||
return A;
|
||||
}
|
||||
|
||||
//
|
||||
// lcm is an algorithm that calculates the least common multiple of two
|
||||
// integers.
|
||||
//
|
||||
// Pre: A > 0 && B > 0
|
||||
// Recommended: A > B
|
||||
template <typename Integer>
|
||||
Integer lcm(const Integer & A, const Integer & B)
|
||||
{
|
||||
Integer ret = A;
|
||||
ret /= gcd(A, B);
|
||||
ret *= B;
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace pool
|
||||
} // namespace details
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_GUARD_HPP
|
||||
#define BOOST_POOL_GUARD_HPP
|
||||
|
||||
// Extremely Light-Weight guard glass
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace details {
|
||||
namespace pool {
|
||||
|
||||
template <typename Mutex>
|
||||
class guard
|
||||
{
|
||||
private:
|
||||
Mutex & mtx;
|
||||
|
||||
guard(const guard &);
|
||||
void operator=(const guard &);
|
||||
|
||||
public:
|
||||
explicit guard(Mutex & nmtx)
|
||||
:mtx(nmtx) { mtx.lock(); }
|
||||
|
||||
~guard() { mtx.unlock(); }
|
||||
};
|
||||
|
||||
} // namespace pool
|
||||
} // namespace details
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
141
Server/RylServerProject/BaseLibrary/boost/pool/detail/mutex.hpp
Normal file
141
Server/RylServerProject/BaseLibrary/boost/pool/detail/mutex.hpp
Normal file
@@ -0,0 +1,141 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_MUTEX_HPP
|
||||
#define BOOST_POOL_MUTEX_HPP
|
||||
|
||||
// Extremely Light-Weight wrapper classes for OS thread synchronization
|
||||
|
||||
// Configuration: for now, we just choose between pthread or Win32 mutexes or none
|
||||
|
||||
#define BOOST_MUTEX_HELPER_NONE 0
|
||||
#define BOOST_MUTEX_HELPER_WIN32 1
|
||||
#define BOOST_MUTEX_HELPER_PTHREAD 2
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_MT
|
||||
// No multithreading -> make locks into no-ops
|
||||
#define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_NONE
|
||||
#else
|
||||
#ifdef __WIN32__
|
||||
#define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_WIN32
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#ifdef _POSIX_THREADS
|
||||
#define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_PTHREAD
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_MUTEX_HELPER
|
||||
#error Unable to determine platform mutex type; define BOOST_NO_MT to assume single-threaded
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __WIN32__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifdef _POSIX_THREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace details {
|
||||
namespace pool {
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
class win32_mutex
|
||||
{
|
||||
private:
|
||||
CRITICAL_SECTION mtx;
|
||||
|
||||
win32_mutex(const win32_mutex &);
|
||||
void operator=(const win32_mutex &);
|
||||
|
||||
public:
|
||||
win32_mutex()
|
||||
{ InitializeCriticalSection(&mtx); }
|
||||
|
||||
~win32_mutex()
|
||||
{ DeleteCriticalSection(&mtx); }
|
||||
|
||||
void lock()
|
||||
{ EnterCriticalSection(&mtx); }
|
||||
|
||||
void unlock()
|
||||
{ LeaveCriticalSection(&mtx); }
|
||||
};
|
||||
|
||||
#endif // defined(__WIN32__)
|
||||
|
||||
#ifdef _POSIX_THREADS
|
||||
|
||||
class pthread_mutex
|
||||
{
|
||||
private:
|
||||
pthread_mutex_t mtx;
|
||||
|
||||
pthread_mutex(const pthread_mutex &);
|
||||
void operator=(const pthread_mutex &);
|
||||
|
||||
public:
|
||||
pthread_mutex()
|
||||
{ pthread_mutex_init(&mtx, 0); }
|
||||
|
||||
~pthread_mutex()
|
||||
{ pthread_mutex_destroy(&mtx); }
|
||||
|
||||
void lock()
|
||||
{ pthread_mutex_lock(&mtx); }
|
||||
|
||||
void unlock()
|
||||
{ pthread_mutex_unlock(&mtx); }
|
||||
};
|
||||
|
||||
#endif // defined(_POSIX_THREADS)
|
||||
|
||||
class null_mutex
|
||||
{
|
||||
private:
|
||||
null_mutex(const null_mutex &);
|
||||
void operator=(const null_mutex &);
|
||||
|
||||
public:
|
||||
null_mutex() { }
|
||||
|
||||
static void lock() { }
|
||||
static void unlock() { }
|
||||
};
|
||||
|
||||
#if BOOST_MUTEX_HELPER == BOOST_MUTEX_HELPER_NONE
|
||||
typedef null_mutex default_mutex;
|
||||
#elif BOOST_MUTEX_HELPER == BOOST_MUTEX_HELPER_WIN32
|
||||
typedef win32_mutex default_mutex;
|
||||
#elif BOOST_MUTEX_HELPER == BOOST_MUTEX_HELPER_PTHREAD
|
||||
typedef pthread_mutex default_mutex;
|
||||
#endif
|
||||
|
||||
} // namespace pool
|
||||
} // namespace details
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_MUTEX_HELPER_WIN32
|
||||
#undef BOOST_MUTEX_HELPER_PTHREAD
|
||||
#undef BOOST_MUTEX_HELPER_NONE
|
||||
#undef BOOST_MUTEX_HELPER
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,858 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// Permission to copy, use, and distribute this software is granted, provided
|
||||
// that this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted,
|
||||
// provided that this copyright notice appears in all copies, and a notice
|
||||
// that the code was modified is included with the copyright notice.
|
||||
//
|
||||
// This software is provided "as is" without express or implied warranty, and
|
||||
// with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
// This file was AUTOMATICALLY GENERATED from "pool_c~1.m4"
|
||||
// Do NOT include directly!
|
||||
// Do NOT edit!
|
||||
|
||||
template <typename T0>
|
||||
element_type * construct(T0 & a0)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0>
|
||||
element_type * construct(const T0 & a0)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0>
|
||||
element_type * construct(volatile T0 & a0)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0>
|
||||
element_type * construct(const volatile T0 & a0)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(T0 & a0, T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const T0 & a0, T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(volatile T0 & a0, T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const volatile T0 & a0, T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(T0 & a0, const T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const T0 & a0, const T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(volatile T0 & a0, const T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const volatile T0 & a0, const T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(T0 & a0, volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const T0 & a0, volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(volatile T0 & a0, volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const volatile T0 & a0, volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(T0 & a0, const volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const T0 & a0, const volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(volatile T0 & a0, const volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const volatile T0 & a0, const volatile T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(volatile T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
// This file was AUTOMATICALLY GENERATED from "stdin"
|
||||
// Do NOT include directly!
|
||||
// Do NOT edit!
|
||||
|
||||
template <typename T0>
|
||||
element_type * construct(const T0 & a0)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1>
|
||||
element_type * construct(const T0 & a0, const T1 & a1)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
template <typename T0, typename T1, typename T2>
|
||||
element_type * construct(const T0 & a0, const T1 & a1, const T2 & a2)
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(a0, a1, a2); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
// Copyright (C) 2000 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_SINGLETON_HPP
|
||||
#define BOOST_POOL_SINGLETON_HPP
|
||||
|
||||
// The following code might be put into some Boost.Config header in a later revision
|
||||
#ifdef __BORLANDC__
|
||||
# pragma option push -w-inl
|
||||
#endif
|
||||
|
||||
//
|
||||
// The following helper classes are placeholders for a generic "singleton"
|
||||
// class. The classes below support usage of singletons, including use in
|
||||
// program startup/shutdown code, AS LONG AS there is only one thread
|
||||
// running before main() begins, and only one thread running after main()
|
||||
// exits.
|
||||
//
|
||||
// This class is also limited in that it can only provide singleton usage for
|
||||
// classes with default constructors.
|
||||
//
|
||||
|
||||
// The design of this class is somewhat twisted, but can be followed by the
|
||||
// calling inheritance. Let us assume that there is some user code that
|
||||
// calls "singleton_default<T>::instance()". The following (convoluted)
|
||||
// sequence ensures that the same function will be called before main():
|
||||
// instance() contains a call to create_object.do_nothing()
|
||||
// Thus, object_creator is implicitly instantiated, and create_object
|
||||
// must exist.
|
||||
// Since create_object is a static member, its constructor must be
|
||||
// called before main().
|
||||
// The constructor contains a call to instance(), thus ensuring that
|
||||
// instance() will be called before main().
|
||||
// The first time instance() is called (i.e., before main()) is the
|
||||
// latest point in program execution where the object of type T
|
||||
// can be created.
|
||||
// Thus, any call to instance() will auto-magically result in a call to
|
||||
// instance() before main(), unless already present.
|
||||
// Furthermore, since the instance() function contains the object, instead
|
||||
// of the singleton_default class containing a static instance of the
|
||||
// object, that object is guaranteed to be constructed (at the latest) in
|
||||
// the first call to instance(). This permits calls to instance() from
|
||||
// static code, even if that code is called before the file-scope objects
|
||||
// in this file have been initialized.
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace details {
|
||||
namespace pool {
|
||||
|
||||
// T must be: no-throw default constructible and no-throw destructible
|
||||
template <typename T>
|
||||
struct singleton_default
|
||||
{
|
||||
private:
|
||||
struct object_creator
|
||||
{
|
||||
// This constructor does nothing more than ensure that instance()
|
||||
// is called before main() begins, thus creating the static
|
||||
// T object before multithreading race issues can come up.
|
||||
object_creator() { singleton_default<T>::instance(); }
|
||||
inline void do_nothing() const { }
|
||||
};
|
||||
static object_creator create_object;
|
||||
|
||||
singleton_default();
|
||||
|
||||
public:
|
||||
typedef T object_type;
|
||||
|
||||
// If, at any point (in user code), singleton_default<T>::instance()
|
||||
// is called, then the following function is instantiated.
|
||||
static object_type & instance()
|
||||
{
|
||||
// This is the object that we return a reference to.
|
||||
// It is guaranteed to be created before main() begins because of
|
||||
// the next line.
|
||||
static object_type obj;
|
||||
|
||||
// The following line does nothing else than force the instantiation
|
||||
// of singleton_default<T>::create_object, whose constructor is
|
||||
// called before main() begins.
|
||||
create_object.do_nothing();
|
||||
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
template <typename T>
|
||||
typename singleton_default<T>::object_creator
|
||||
singleton_default<T>::create_object;
|
||||
|
||||
} // namespace pool
|
||||
} // namespace details
|
||||
|
||||
} // namespace boost
|
||||
|
||||
// The following code might be put into some Boost.Config header in a later revision
|
||||
#ifdef __BORLANDC__
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
158
Server/RylServerProject/BaseLibrary/boost/pool/object_pool.hpp
Normal file
158
Server/RylServerProject/BaseLibrary/boost/pool/object_pool.hpp
Normal file
@@ -0,0 +1,158 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_OBJECT_POOL_HPP
|
||||
#define BOOST_OBJECT_POOL_HPP
|
||||
|
||||
#include <boost/pool/poolfwd.hpp>
|
||||
|
||||
// boost::pool
|
||||
#include <boost/pool/pool.hpp>
|
||||
|
||||
// The following code will be put into Boost.Config in a later revision
|
||||
#if defined(BOOST_MSVC) || defined(__KCC)
|
||||
# define BOOST_NO_TEMPLATE_CV_REF_OVERLOADS
|
||||
#endif
|
||||
|
||||
// The following code might be put into some Boost.Config header in a later revision
|
||||
#ifdef __BORLANDC__
|
||||
# pragma option push -w-inl
|
||||
#endif
|
||||
|
||||
// There are a few places in this file where the expression "this->m" is used.
|
||||
// This expression is used to force instantiation-time name lookup, which I am
|
||||
// informed is required for strict Standard compliance. It's only necessary
|
||||
// if "m" is a member of a base class that is dependent on a template
|
||||
// parameter.
|
||||
// Thanks to Jens Maurer for pointing this out!
|
||||
|
||||
namespace boost {
|
||||
|
||||
// T must have a non-throwing destructor
|
||||
template <typename T, typename UserAllocator>
|
||||
class object_pool: protected pool<UserAllocator>
|
||||
{
|
||||
public:
|
||||
typedef T element_type;
|
||||
typedef UserAllocator user_allocator;
|
||||
typedef typename pool<UserAllocator>::size_type size_type;
|
||||
typedef typename pool<UserAllocator>::difference_type difference_type;
|
||||
|
||||
protected:
|
||||
pool<UserAllocator> & store() { return *this; }
|
||||
const pool<UserAllocator> & store() const { return *this; }
|
||||
|
||||
// for the sake of code readability :)
|
||||
static void * & nextof(void * const ptr)
|
||||
{ return *(static_cast<void **>(ptr)); }
|
||||
|
||||
public:
|
||||
// This constructor parameter is an extension!
|
||||
explicit object_pool(const size_type next_size = 32)
|
||||
:pool<UserAllocator>(sizeof(T), next_size) { }
|
||||
|
||||
~object_pool();
|
||||
|
||||
// Returns 0 if out-of-memory
|
||||
element_type * malloc()
|
||||
{ return static_cast<element_type *>(store().ordered_malloc()); }
|
||||
void free(element_type * const chunk)
|
||||
{ store().ordered_free(chunk); }
|
||||
bool is_from(element_type * const chunk) const
|
||||
{ return store().is_from(chunk); }
|
||||
|
||||
element_type * construct()
|
||||
{
|
||||
element_type * const ret = malloc();
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
try { new (ret) element_type(); }
|
||||
catch (...) { free(ret); throw; }
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Include automatically-generated file for family of template construct()
|
||||
// functions
|
||||
#ifndef BOOST_NO_TEMPLATE_CV_REF_OVERLOADS
|
||||
# include <boost/pool/detail/pool_construct.inc>
|
||||
#else
|
||||
# include <boost/pool/detail/pool_construct_simple.inc>
|
||||
#endif
|
||||
|
||||
void destroy(element_type * const chunk)
|
||||
{
|
||||
chunk->~T();
|
||||
free(chunk);
|
||||
}
|
||||
|
||||
// These functions are extensions!
|
||||
size_type get_next_size() const { return store().get_next_size(); }
|
||||
void set_next_size(const size_type x) { store().set_next_size(x); }
|
||||
};
|
||||
|
||||
template <typename T, typename UserAllocator>
|
||||
object_pool<T, UserAllocator>::~object_pool()
|
||||
{
|
||||
// handle trivial case
|
||||
if (!this->list.valid())
|
||||
return;
|
||||
|
||||
details::PODptr<size_type> iter = this->list;
|
||||
details::PODptr<size_type> next = iter;
|
||||
|
||||
// Start 'freed_iter' at beginning of free list
|
||||
void * freed_iter = this->first;
|
||||
|
||||
const size_type partition_size = this->alloc_size();
|
||||
|
||||
do
|
||||
{
|
||||
// increment next
|
||||
next = next.next();
|
||||
|
||||
// delete all contained objects that aren't freed
|
||||
|
||||
// Iterate 'i' through all chunks in the memory block
|
||||
for (char * i = iter.begin(); i != iter.end(); i += partition_size)
|
||||
{
|
||||
// If this chunk is free
|
||||
if (i == freed_iter)
|
||||
{
|
||||
// Increment freed_iter to point to next in free list
|
||||
freed_iter = nextof(freed_iter);
|
||||
|
||||
// Continue searching chunks in the memory block
|
||||
continue;
|
||||
}
|
||||
|
||||
// This chunk is not free (allocated), so call its destructor
|
||||
static_cast<T *>(static_cast<void *>(i))->~T();
|
||||
// and continue searching chunks in the memory block
|
||||
}
|
||||
|
||||
// free storage
|
||||
UserAllocator::free(iter.begin());
|
||||
|
||||
// increment iter
|
||||
iter = next;
|
||||
} while (iter.valid());
|
||||
|
||||
// Make the block list empty so that the inherited destructor doesn't try to
|
||||
// free it again.
|
||||
this->list.invalidate();
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
// The following code might be put into some Boost.Config header in a later revision
|
||||
#ifdef __BORLANDC__
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
568
Server/RylServerProject/BaseLibrary/boost/pool/pool.hpp
Normal file
568
Server/RylServerProject/BaseLibrary/boost/pool/pool.hpp
Normal file
@@ -0,0 +1,568 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_HPP
|
||||
#define BOOST_POOL_HPP
|
||||
|
||||
#include <boost/config.hpp> // for workarounds
|
||||
|
||||
// std::less, std::less_equal, std::greater
|
||||
#include <functional>
|
||||
// new[], delete[], std::nothrow
|
||||
#include <new>
|
||||
// std::size_t, std::ptrdiff_t
|
||||
#include <cstddef>
|
||||
// std::malloc, std::free
|
||||
#include <cstdlib>
|
||||
// std::invalid_argument
|
||||
#include <exception>
|
||||
// std::max
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/pool/poolfwd.hpp>
|
||||
|
||||
// boost::details::pool::ct_lcm
|
||||
#include <boost/pool/detail/ct_gcd_lcm.hpp>
|
||||
// boost::details::pool::lcm
|
||||
#include <boost/pool/detail/gcd_lcm.hpp>
|
||||
// boost::simple_segregated_storage
|
||||
#include <boost/pool/simple_segregated_storage.hpp>
|
||||
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std { using ::malloc; using ::free; }
|
||||
#endif
|
||||
|
||||
// There are a few places in this file where the expression "this->m" is used.
|
||||
// This expression is used to force instantiation-time name lookup, which I am
|
||||
// informed is required for strict Standard compliance. It's only necessary
|
||||
// if "m" is a member of a base class that is dependent on a template
|
||||
// parameter.
|
||||
// Thanks to Jens Maurer for pointing this out!
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct default_user_allocator_new_delete
|
||||
{
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
static char * malloc(const size_type bytes)
|
||||
{ return new (std::nothrow) char[bytes]; }
|
||||
static void free(char * const block)
|
||||
{ delete [] block; }
|
||||
};
|
||||
|
||||
struct default_user_allocator_malloc_free
|
||||
{
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
static char * malloc(const size_type bytes)
|
||||
{ return reinterpret_cast<char *>(std::malloc(bytes)); }
|
||||
static void free(char * const block)
|
||||
{ std::free(block); }
|
||||
};
|
||||
|
||||
namespace details {
|
||||
|
||||
// PODptr is a class that pretends to be a "pointer" to different class types
|
||||
// that don't really exist. It provides member functions to access the "data"
|
||||
// of the "object" it points to. Since these "class" types are of variable
|
||||
// size, and contains some information at the *end* of its memory (for
|
||||
// alignment reasons), PODptr must contain the size of this "class" as well as
|
||||
// the pointer to this "object".
|
||||
template <typename SizeType>
|
||||
class PODptr
|
||||
{
|
||||
public:
|
||||
typedef SizeType size_type;
|
||||
|
||||
private:
|
||||
char * ptr;
|
||||
size_type sz;
|
||||
|
||||
char * ptr_next_size() const
|
||||
{ return (ptr + sz - sizeof(size_type)); }
|
||||
char * ptr_next_ptr() const
|
||||
{
|
||||
return (ptr_next_size() -
|
||||
pool::ct_lcm<sizeof(size_type), sizeof(void *)>::value);
|
||||
}
|
||||
|
||||
public:
|
||||
PODptr(char * const nptr, const size_type nsize)
|
||||
:ptr(nptr), sz(nsize) { }
|
||||
PODptr()
|
||||
:ptr(0), sz(0) { }
|
||||
|
||||
bool valid() const { return (begin() != 0); }
|
||||
void invalidate() { begin() = 0; }
|
||||
char * & begin() { return ptr; }
|
||||
char * begin() const { return ptr; }
|
||||
char * end() const { return ptr_next_ptr(); }
|
||||
size_type total_size() const { return sz; }
|
||||
size_type element_size() const
|
||||
{
|
||||
return (sz - sizeof(size_type) -
|
||||
pool::ct_lcm<sizeof(size_type), sizeof(void *)>::value);
|
||||
}
|
||||
|
||||
size_type & next_size() const
|
||||
{ return *(reinterpret_cast<size_type *>(ptr_next_size())); }
|
||||
char * & next_ptr() const
|
||||
{ return *(reinterpret_cast<char **>(ptr_next_ptr())); }
|
||||
|
||||
PODptr next() const
|
||||
{ return PODptr<size_type>(next_ptr(), next_size()); }
|
||||
void next(const PODptr & arg) const
|
||||
{
|
||||
next_ptr() = arg.begin();
|
||||
next_size() = arg.total_size();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace details
|
||||
|
||||
template <typename UserAllocator>
|
||||
class pool: protected simple_segregated_storage<
|
||||
typename UserAllocator::size_type>
|
||||
{
|
||||
public:
|
||||
typedef UserAllocator user_allocator;
|
||||
typedef typename UserAllocator::size_type size_type;
|
||||
typedef typename UserAllocator::difference_type difference_type;
|
||||
|
||||
private:
|
||||
BOOST_STATIC_CONSTANT(unsigned, min_alloc_size =
|
||||
(::boost::details::pool::ct_lcm<sizeof(void *), sizeof(size_type)>::value) );
|
||||
|
||||
// Returns 0 if out-of-memory
|
||||
// Called if malloc/ordered_malloc needs to resize the free list
|
||||
void * malloc_need_resize();
|
||||
void * ordered_malloc_need_resize();
|
||||
|
||||
protected:
|
||||
details::PODptr<size_type> list;
|
||||
|
||||
simple_segregated_storage<size_type> & store() { return *this; }
|
||||
const simple_segregated_storage<size_type> & store() const { return *this; }
|
||||
const size_type requested_size;
|
||||
size_type next_size;
|
||||
|
||||
// finds which POD in the list 'chunk' was allocated from
|
||||
details::PODptr<size_type> find_POD(void * const chunk) const;
|
||||
|
||||
// is_from() tests a chunk to determine if it belongs in a block
|
||||
static bool is_from(void * const chunk, char * const i,
|
||||
const size_type sizeof_i)
|
||||
{
|
||||
// We use std::less_equal and std::less to test 'chunk'
|
||||
// against the array bounds because standard operators
|
||||
// may return unspecified results.
|
||||
// This is to ensure portability. The operators < <= > >= are only
|
||||
// defined for pointers to objects that are 1) in the same array, or
|
||||
// 2) subobjects of the same object [5.9/2].
|
||||
// The functor objects guarantee a total order for any pointer [20.3.3/8]
|
||||
//WAS:
|
||||
// return (std::less_equal<void *>()(static_cast<void *>(i), chunk)
|
||||
// && std::less<void *>()(chunk,
|
||||
// static_cast<void *>(i + sizeof_i)));
|
||||
std::less_equal<void *> lt_eq;
|
||||
std::less<void *> lt;
|
||||
return (lt_eq(i, chunk) && lt(chunk, i + sizeof_i));
|
||||
}
|
||||
|
||||
size_type alloc_size() const
|
||||
{
|
||||
const unsigned min_size = min_alloc_size;
|
||||
return details::pool::lcm<size_type>(requested_size, min_size);
|
||||
}
|
||||
|
||||
// for the sake of code readability :)
|
||||
static void * & nextof(void * const ptr)
|
||||
{ return *(static_cast<void **>(ptr)); }
|
||||
|
||||
public:
|
||||
// The second parameter here is an extension!
|
||||
// pre: npartition_size != 0 && nnext_size != 0
|
||||
explicit pool(const size_type nrequested_size,
|
||||
const size_type nnext_size = 32)
|
||||
:list(0, 0), requested_size(nrequested_size), next_size(nnext_size)
|
||||
{ }
|
||||
|
||||
~pool() { purge_memory(); }
|
||||
|
||||
size_type get_requested_size() const { return requested_size; }
|
||||
|
||||
// Releases memory blocks that don't have chunks allocated
|
||||
// pre: lists are ordered
|
||||
// Returns true if memory was actually deallocated
|
||||
bool release_memory();
|
||||
|
||||
// Releases *all* memory blocks, even if chunks are still allocated
|
||||
// Returns true if memory was actually deallocated
|
||||
bool purge_memory();
|
||||
|
||||
// These functions are extensions!
|
||||
size_type get_next_size() const { return next_size; }
|
||||
void set_next_size(const size_type nnext_size) { next_size = nnext_size; }
|
||||
|
||||
// Both malloc and ordered_malloc do a quick inlined check first for any
|
||||
// free chunks. Only if we need to get another memory block do we call
|
||||
// the non-inlined *_need_resize() functions.
|
||||
// Returns 0 if out-of-memory
|
||||
void * malloc()
|
||||
{
|
||||
// Look for a non-empty storage
|
||||
if (!store().empty())
|
||||
return store().malloc();
|
||||
return malloc_need_resize();
|
||||
}
|
||||
|
||||
void * ordered_malloc()
|
||||
{
|
||||
// Look for a non-empty storage
|
||||
if (!store().empty())
|
||||
return store().malloc();
|
||||
return ordered_malloc_need_resize();
|
||||
}
|
||||
|
||||
// Returns 0 if out-of-memory
|
||||
// Allocate a contiguous section of n chunks
|
||||
void * ordered_malloc(size_type n);
|
||||
|
||||
// pre: 'chunk' must have been previously
|
||||
// returned by *this.malloc().
|
||||
void free(void * const chunk)
|
||||
{ store().free(chunk); }
|
||||
|
||||
// pre: 'chunk' must have been previously
|
||||
// returned by *this.malloc().
|
||||
void ordered_free(void * const chunk)
|
||||
{ store().ordered_free(chunk); }
|
||||
|
||||
// pre: 'chunk' must have been previously
|
||||
// returned by *this.malloc(n).
|
||||
void free(void * const chunks, const size_type n)
|
||||
{
|
||||
const size_type partition_size = alloc_size();
|
||||
const size_type total_req_size = n * requested_size;
|
||||
const size_type num_chunks = total_req_size / partition_size +
|
||||
static_cast<bool>(total_req_size % partition_size);
|
||||
|
||||
store().free_n(chunks, num_chunks, partition_size);
|
||||
}
|
||||
|
||||
// pre: 'chunk' must have been previously
|
||||
// returned by *this.malloc(n).
|
||||
void ordered_free(void * const chunks, const size_type n)
|
||||
{
|
||||
const size_type partition_size = alloc_size();
|
||||
const size_type total_req_size = n * requested_size;
|
||||
const size_type num_chunks = total_req_size / partition_size +
|
||||
static_cast<bool>(total_req_size % partition_size);
|
||||
|
||||
store().ordered_free_n(chunks, num_chunks, partition_size);
|
||||
}
|
||||
|
||||
// is_from() tests a chunk to determine if it was allocated from *this
|
||||
bool is_from(void * const chunk) const
|
||||
{
|
||||
return (find_POD(chunk).valid());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename UserAllocator>
|
||||
bool pool<UserAllocator>::release_memory()
|
||||
{
|
||||
// This is the return value: it will be set to true when we actually call
|
||||
// UserAllocator::free(..)
|
||||
bool ret = false;
|
||||
|
||||
// This is a current & previous iterator pair over the memory block list
|
||||
details::PODptr<size_type> ptr = list;
|
||||
details::PODptr<size_type> prev;
|
||||
|
||||
// This is a current & previous iterator pair over the free memory chunk list
|
||||
// Note that "prev_free" in this case does NOT point to the previous memory
|
||||
// chunk in the free list, but rather the last free memory chunk before the
|
||||
// current block.
|
||||
void * free = this->first;
|
||||
void * prev_free = 0;
|
||||
|
||||
const size_type partition_size = alloc_size();
|
||||
|
||||
// Search through all the all the allocated memory blocks
|
||||
while (ptr.valid())
|
||||
{
|
||||
// At this point:
|
||||
// ptr points to a valid memory block
|
||||
// free points to either:
|
||||
// 0 if there are no more free chunks
|
||||
// the first free chunk in this or some next memory block
|
||||
// prev_free points to either:
|
||||
// the last free chunk in some previous memory block
|
||||
// 0 if there is no such free chunk
|
||||
|
||||
// If there are no more free memory chunks, then every remaining
|
||||
// block is allocated out to its fullest capacity, and we can't
|
||||
// release any more memory
|
||||
if (free == 0)
|
||||
return ret;
|
||||
|
||||
// We have to check all the chunks. If they are *all* free (i.e., present
|
||||
// in the free list), then we can free the block.
|
||||
bool all_chunks_free = true;
|
||||
|
||||
// Iterate 'i' through all chunks in the memory block
|
||||
for (char * i = ptr.begin(); i != ptr.end(); i += partition_size)
|
||||
{
|
||||
// If this chunk is not free
|
||||
if (i != free)
|
||||
{
|
||||
// We won't be able to free this block
|
||||
all_chunks_free = false;
|
||||
|
||||
// Abort searching the chunks; we won't be able to free this
|
||||
// block because a chunk is not free.
|
||||
break;
|
||||
}
|
||||
|
||||
// We do not increment prev_free because we are in the same block
|
||||
free = nextof(free);
|
||||
}
|
||||
|
||||
const details::PODptr<size_type> next = ptr.next();
|
||||
|
||||
if (!all_chunks_free)
|
||||
{
|
||||
// Rush through all free chunks from this block
|
||||
std::less<void *> lt;
|
||||
void * const last = ptr.end() - partition_size;
|
||||
do
|
||||
{
|
||||
free = nextof(free);
|
||||
} while (lt(free, last));
|
||||
|
||||
// Increment free one more time and set prev_free to maintain the
|
||||
// invariants:
|
||||
// free points to the first free chunk in some next memory block, or
|
||||
// 0 if there is no such chunk.
|
||||
// prev_free points to the last free chunk in this memory block.
|
||||
prev_free = free;
|
||||
free = nextof(free);
|
||||
}
|
||||
else
|
||||
{
|
||||
// All chunks from this block are free
|
||||
|
||||
// Remove block from list
|
||||
if (prev.valid())
|
||||
prev.next(next);
|
||||
else
|
||||
list = next;
|
||||
|
||||
// Remove all entries in the free list from this block
|
||||
if (prev_free != 0)
|
||||
nextof(prev_free) = free;
|
||||
else
|
||||
this->first = free;
|
||||
|
||||
// And release memory
|
||||
UserAllocator::free(ptr.begin());
|
||||
ret = true;
|
||||
}
|
||||
|
||||
// Increment ptr
|
||||
ptr = next;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename UserAllocator>
|
||||
bool pool<UserAllocator>::purge_memory()
|
||||
{
|
||||
details::PODptr<size_type> iter = list;
|
||||
|
||||
if (!iter.valid())
|
||||
return false;
|
||||
|
||||
do
|
||||
{
|
||||
// hold "next" pointer
|
||||
const details::PODptr<size_type> next = iter.next();
|
||||
|
||||
// delete the storage
|
||||
UserAllocator::free(iter.begin());
|
||||
|
||||
// increment iter
|
||||
iter = next;
|
||||
} while (iter.valid());
|
||||
|
||||
list.invalidate();
|
||||
this->first = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename UserAllocator>
|
||||
void * pool<UserAllocator>::malloc_need_resize()
|
||||
{
|
||||
// No memory in any of our storages; make a new storage,
|
||||
const size_type partition_size = alloc_size();
|
||||
const size_type POD_size = next_size * partition_size +
|
||||
details::pool::ct_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
|
||||
char * const ptr = UserAllocator::malloc(POD_size);
|
||||
if (ptr == 0)
|
||||
return 0;
|
||||
const details::PODptr<size_type> node(ptr, POD_size);
|
||||
next_size <<= 1;
|
||||
|
||||
// initialize it,
|
||||
store().add_block(node.begin(), node.element_size(), partition_size);
|
||||
|
||||
// insert it into the list,
|
||||
node.next(list);
|
||||
list = node;
|
||||
|
||||
// and return a chunk from it.
|
||||
return store().malloc();
|
||||
}
|
||||
|
||||
template <typename UserAllocator>
|
||||
void * pool<UserAllocator>::ordered_malloc_need_resize()
|
||||
{
|
||||
// No memory in any of our storages; make a new storage,
|
||||
const size_type partition_size = alloc_size();
|
||||
const size_type POD_size = next_size * partition_size +
|
||||
details::pool::ct_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
|
||||
char * const ptr = UserAllocator::malloc(POD_size);
|
||||
if (ptr == 0)
|
||||
return 0;
|
||||
const details::PODptr<size_type> node(ptr, POD_size);
|
||||
next_size <<= 1;
|
||||
|
||||
// initialize it,
|
||||
// (we can use "add_block" here because we know that
|
||||
// the free list is empty, so we don't have to use
|
||||
// the slower ordered version)
|
||||
store().add_block(node.begin(), node.element_size(), partition_size);
|
||||
|
||||
// insert it into the list,
|
||||
// handle border case
|
||||
if (!list.valid() || std::greater<void *>()(list.begin(), node.begin()))
|
||||
{
|
||||
node.next(list);
|
||||
list = node;
|
||||
}
|
||||
else
|
||||
{
|
||||
details::PODptr<size_type> prev = list;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// if we're about to hit the end or
|
||||
// if we've found where "node" goes
|
||||
if (prev.next_ptr() == 0
|
||||
|| std::greater<void *>()(prev.next_ptr(), node.begin()))
|
||||
break;
|
||||
|
||||
prev = prev.next();
|
||||
}
|
||||
|
||||
node.next(prev.next());
|
||||
prev.next(node);
|
||||
}
|
||||
|
||||
// and return a chunk from it.
|
||||
return store().malloc();
|
||||
}
|
||||
|
||||
template <typename UserAllocator>
|
||||
void * pool<UserAllocator>::ordered_malloc(const size_type n)
|
||||
{
|
||||
const size_type partition_size = alloc_size();
|
||||
const size_type total_req_size = n * requested_size;
|
||||
const size_type num_chunks = total_req_size / partition_size +
|
||||
static_cast<bool>(total_req_size % partition_size);
|
||||
|
||||
void * ret = store().malloc_n(num_chunks, partition_size);
|
||||
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
// Not enougn memory in our storages; make a new storage,
|
||||
next_size = std::max(next_size, num_chunks);
|
||||
const size_type POD_size = next_size * partition_size +
|
||||
details::pool::ct_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
|
||||
char * const ptr = UserAllocator::malloc(POD_size);
|
||||
if (ptr == 0)
|
||||
return 0;
|
||||
const details::PODptr<size_type> node(ptr, POD_size);
|
||||
|
||||
// Split up block so we can use what wasn't requested
|
||||
// (we can use "add_block" here because we know that
|
||||
// the free list is empty, so we don't have to use
|
||||
// the slower ordered version)
|
||||
if (next_size > num_chunks)
|
||||
store().add_block(node.begin() + num_chunks * partition_size,
|
||||
node.element_size() - num_chunks * partition_size, partition_size);
|
||||
|
||||
next_size <<= 1;
|
||||
|
||||
// insert it into the list,
|
||||
// handle border case
|
||||
if (!list.valid() || std::greater<void *>()(list.begin(), node.begin()))
|
||||
{
|
||||
node.next(list);
|
||||
list = node;
|
||||
}
|
||||
else
|
||||
{
|
||||
details::PODptr<size_type> prev = list;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// if we're about to hit the end or
|
||||
// if we've found where "node" goes
|
||||
if (prev.next_ptr() == 0
|
||||
|| std::greater<void *>()(prev.next_ptr(), node.begin()))
|
||||
break;
|
||||
|
||||
prev = prev.next();
|
||||
}
|
||||
|
||||
node.next(prev.next());
|
||||
prev.next(node);
|
||||
}
|
||||
|
||||
// and return it.
|
||||
return node.begin();
|
||||
}
|
||||
|
||||
template <typename UserAllocator>
|
||||
details::PODptr<typename pool<UserAllocator>::size_type>
|
||||
pool<UserAllocator>::find_POD(void * const chunk) const
|
||||
{
|
||||
// We have to find which storage this chunk is from.
|
||||
details::PODptr<size_type> iter = list;
|
||||
while (iter.valid())
|
||||
{
|
||||
if (is_from(chunk, iter.begin(), iter.element_size()))
|
||||
return iter;
|
||||
iter = iter.next();
|
||||
}
|
||||
|
||||
return iter;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
220
Server/RylServerProject/BaseLibrary/boost/pool/pool_alloc.hpp
Normal file
220
Server/RylServerProject/BaseLibrary/boost/pool/pool_alloc.hpp
Normal file
@@ -0,0 +1,220 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOL_ALLOC_HPP
|
||||
#define BOOST_POOL_ALLOC_HPP
|
||||
|
||||
// std::numeric_limits
|
||||
#include <boost/limits.hpp>
|
||||
// new, std::bad_alloc
|
||||
#include <new>
|
||||
|
||||
#include <boost/pool/poolfwd.hpp>
|
||||
|
||||
// boost::singleton_pool
|
||||
#include <boost/pool/singleton_pool.hpp>
|
||||
|
||||
// The following code will be put into Boost.Config in a later revision
|
||||
#if defined(_RWSTD_VER) || defined(__SGI_STL_PORT)
|
||||
// Needed, as of bcc 5.5 and STLPort 4.5b8
|
||||
#define BOOST_NO_PROPER_STL_DEALLOCATE
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct pool_allocator_tag { };
|
||||
|
||||
template <typename T,
|
||||
typename UserAllocator,
|
||||
typename Mutex,
|
||||
unsigned NextSize>
|
||||
class pool_allocator
|
||||
{
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef UserAllocator user_allocator;
|
||||
typedef Mutex mutex;
|
||||
BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize);
|
||||
|
||||
typedef value_type * pointer;
|
||||
typedef const value_type * const_pointer;
|
||||
typedef value_type & reference;
|
||||
typedef const value_type & const_reference;
|
||||
typedef typename pool<UserAllocator>::size_type size_type;
|
||||
typedef typename pool<UserAllocator>::difference_type difference_type;
|
||||
|
||||
template <typename U>
|
||||
struct rebind
|
||||
{
|
||||
typedef pool_allocator<U, UserAllocator, Mutex, NextSize> other;
|
||||
};
|
||||
|
||||
public:
|
||||
pool_allocator() { }
|
||||
|
||||
// default copy constructor
|
||||
|
||||
// default assignment operator
|
||||
|
||||
// not explicit, mimicking std::allocator [20.4.1]
|
||||
template <typename U>
|
||||
pool_allocator(const pool_allocator<U, UserAllocator, Mutex, NextSize> &)
|
||||
{ }
|
||||
|
||||
// default destructor
|
||||
|
||||
static pointer address(reference r)
|
||||
{ return &r; }
|
||||
static const_pointer address(const_reference s)
|
||||
{ return &s; }
|
||||
static size_type max_size()
|
||||
{ return std::numeric_limits<size_type>::max(); }
|
||||
static void construct(const pointer ptr, const value_type & t)
|
||||
{ new (ptr) T(t); }
|
||||
static void destroy(const pointer ptr)
|
||||
{
|
||||
ptr->~T();
|
||||
(void) ptr; // avoid unused variable warning
|
||||
}
|
||||
|
||||
bool operator==(const pool_allocator &) const
|
||||
{ return true; }
|
||||
bool operator!=(const pool_allocator &) const
|
||||
{ return false; }
|
||||
|
||||
static pointer allocate(const size_type n)
|
||||
{
|
||||
const pointer ret = static_cast<pointer>(
|
||||
singleton_pool<pool_allocator_tag, sizeof(T), UserAllocator, Mutex,
|
||||
NextSize>::ordered_malloc(n) );
|
||||
if (ret == 0)
|
||||
throw std::bad_alloc();
|
||||
return ret;
|
||||
}
|
||||
static pointer allocate(const size_type n, const void * const)
|
||||
{ return allocate(n); }
|
||||
static void deallocate(const pointer ptr, const size_type n)
|
||||
{
|
||||
#ifdef BOOST_NO_PROPER_STL_DEALLOCATE
|
||||
if (ptr == 0 || n == 0)
|
||||
return;
|
||||
#endif
|
||||
singleton_pool<pool_allocator_tag, sizeof(T), UserAllocator, Mutex,
|
||||
NextSize>::ordered_free(ptr, n);
|
||||
}
|
||||
};
|
||||
|
||||
struct fast_pool_allocator_tag { };
|
||||
|
||||
template <typename T,
|
||||
typename UserAllocator,
|
||||
typename Mutex,
|
||||
unsigned NextSize>
|
||||
class fast_pool_allocator
|
||||
{
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef UserAllocator user_allocator;
|
||||
typedef Mutex mutex;
|
||||
BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize);
|
||||
|
||||
typedef value_type * pointer;
|
||||
typedef const value_type * const_pointer;
|
||||
typedef value_type & reference;
|
||||
typedef const value_type & const_reference;
|
||||
typedef typename pool<UserAllocator>::size_type size_type;
|
||||
typedef typename pool<UserAllocator>::difference_type difference_type;
|
||||
|
||||
template <typename U>
|
||||
struct rebind
|
||||
{
|
||||
typedef fast_pool_allocator<U, UserAllocator, Mutex, NextSize> other;
|
||||
};
|
||||
|
||||
public:
|
||||
fast_pool_allocator() { }
|
||||
|
||||
// default copy constructor
|
||||
|
||||
// default assignment operator
|
||||
|
||||
// not explicit, mimicking std::allocator [20.4.1]
|
||||
template <typename U>
|
||||
fast_pool_allocator(
|
||||
const fast_pool_allocator<U, UserAllocator, Mutex, NextSize> &)
|
||||
{ }
|
||||
|
||||
// default destructor
|
||||
|
||||
static pointer address(reference r)
|
||||
{ return &r; }
|
||||
static const_pointer address(const_reference s)
|
||||
{ return &s; }
|
||||
static size_type max_size()
|
||||
{ return std::numeric_limits<size_type>::max(); }
|
||||
void construct(const pointer ptr, const value_type & t)
|
||||
{ new (ptr) T(t); }
|
||||
void destroy(const pointer ptr)
|
||||
{
|
||||
ptr->~T();
|
||||
(void) ptr; // avoid unused variable warning
|
||||
}
|
||||
|
||||
bool operator==(const fast_pool_allocator &) const
|
||||
{ return true; }
|
||||
bool operator!=(const fast_pool_allocator &) const
|
||||
{ return false; }
|
||||
|
||||
static pointer allocate(const size_type n)
|
||||
{
|
||||
const pointer ret = (n == 1) ?
|
||||
static_cast<pointer>(
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::malloc() ) :
|
||||
static_cast<pointer>(
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::ordered_malloc(n) );
|
||||
if (ret == 0)
|
||||
throw std::bad_alloc();
|
||||
return ret;
|
||||
}
|
||||
static pointer allocate(const size_type n, const void * const)
|
||||
{ return allocate(n); }
|
||||
static pointer allocate()
|
||||
{
|
||||
const pointer ret = static_cast<pointer>(
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::malloc() );
|
||||
if (ret == 0)
|
||||
throw std::bad_alloc();
|
||||
return ret;
|
||||
}
|
||||
static void deallocate(const pointer ptr, const size_type n)
|
||||
{
|
||||
#ifdef BOOST_NO_PROPER_STL_DEALLOCATE
|
||||
if (ptr == 0 || n == 0)
|
||||
return;
|
||||
#endif
|
||||
if (n == 1)
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::free(ptr);
|
||||
else
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::free(ptr, n);
|
||||
}
|
||||
static void deallocate(const pointer ptr)
|
||||
{
|
||||
singleton_pool<fast_pool_allocator_tag, sizeof(T),
|
||||
UserAllocator, Mutex, NextSize>::free(ptr);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
74
Server/RylServerProject/BaseLibrary/boost/pool/poolfwd.hpp
Normal file
74
Server/RylServerProject/BaseLibrary/boost/pool/poolfwd.hpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_POOLFWD_HPP
|
||||
#define BOOST_POOLFWD_HPP
|
||||
|
||||
#include <boost/config.hpp> // for workarounds
|
||||
|
||||
// std::size_t
|
||||
#include <cstddef>
|
||||
|
||||
// boost::details::pool::default_mutex
|
||||
#include <boost/pool/detail/mutex.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
//
|
||||
// Location: <boost/pool/simple_segregated_storage.hpp>
|
||||
//
|
||||
template <typename SizeType = std::size_t>
|
||||
class simple_segregated_storage;
|
||||
|
||||
//
|
||||
// Location: <boost/pool/pool.hpp>
|
||||
//
|
||||
struct default_user_allocator_new_delete;
|
||||
struct default_user_allocator_malloc_free;
|
||||
|
||||
template <typename UserAllocator = default_user_allocator_new_delete>
|
||||
class pool;
|
||||
|
||||
//
|
||||
// Location: <boost/pool/object_pool.hpp>
|
||||
//
|
||||
template <typename T, typename UserAllocator = default_user_allocator_new_delete>
|
||||
class object_pool;
|
||||
|
||||
//
|
||||
// Location: <boost/pool/singleton_pool.hpp>
|
||||
//
|
||||
template <typename Tag, unsigned RequestedSize,
|
||||
typename UserAllocator = default_user_allocator_new_delete,
|
||||
typename Mutex = details::pool::default_mutex,
|
||||
unsigned NextSize = 32>
|
||||
struct singleton_pool;
|
||||
|
||||
//
|
||||
// Location: <boost/pool/pool_alloc.hpp>
|
||||
//
|
||||
struct pool_allocator_tag;
|
||||
|
||||
template <typename T,
|
||||
typename UserAllocator = default_user_allocator_new_delete,
|
||||
typename Mutex = details::pool::default_mutex,
|
||||
unsigned NextSize = 32>
|
||||
class pool_allocator;
|
||||
|
||||
struct fast_pool_allocator_tag;
|
||||
|
||||
template <typename T,
|
||||
typename UserAllocator = default_user_allocator_new_delete,
|
||||
typename Mutex = details::pool::default_mutex,
|
||||
unsigned NextSize = 32>
|
||||
class fast_pool_allocator;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,266 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_SIMPLE_SEGREGATED_STORAGE_HPP
|
||||
#define BOOST_SIMPLE_SEGREGATED_STORAGE_HPP
|
||||
|
||||
// std::greater
|
||||
#include <functional>
|
||||
|
||||
#include <boost/pool/poolfwd.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename SizeType>
|
||||
class simple_segregated_storage
|
||||
{
|
||||
public:
|
||||
typedef SizeType size_type;
|
||||
|
||||
private:
|
||||
simple_segregated_storage(const simple_segregated_storage &);
|
||||
void operator=(const simple_segregated_storage &);
|
||||
|
||||
// pre: (n > 0), (start != 0), (nextof(start) != 0)
|
||||
// post: (start != 0)
|
||||
static void * try_malloc_n(void * & start, size_type n,
|
||||
size_type partition_size);
|
||||
|
||||
protected:
|
||||
void * first;
|
||||
|
||||
// Traverses the free list referred to by "first",
|
||||
// and returns the iterator previous to where
|
||||
// "ptr" would go if it was in the free list.
|
||||
// Returns 0 if "ptr" would go at the beginning
|
||||
// of the free list (i.e., before "first")
|
||||
void * find_prev(void * ptr);
|
||||
|
||||
// for the sake of code readability :)
|
||||
static void * & nextof(void * const ptr)
|
||||
{ return *(static_cast<void **>(ptr)); }
|
||||
|
||||
public:
|
||||
// Post: empty()
|
||||
simple_segregated_storage()
|
||||
:first(0) { }
|
||||
|
||||
// pre: npartition_sz >= sizeof(void *)
|
||||
// npartition_sz = sizeof(void *) * i, for some integer i
|
||||
// nsz >= npartition_sz
|
||||
// block is properly aligned for an array of object of
|
||||
// size npartition_sz and array of void *
|
||||
// The requirements above guarantee that any pointer to a chunk
|
||||
// (which is a pointer to an element in an array of npartition_sz)
|
||||
// may be cast to void **.
|
||||
static void * segregate(void * block,
|
||||
size_type nsz, size_type npartition_sz,
|
||||
void * end = 0);
|
||||
|
||||
// Same preconditions as 'segregate'
|
||||
// Post: !empty()
|
||||
void add_block(void * const block,
|
||||
const size_type nsz, const size_type npartition_sz)
|
||||
{
|
||||
// Segregate this block and merge its free list into the
|
||||
// free list referred to by "first"
|
||||
first = segregate(block, nsz, npartition_sz, first);
|
||||
}
|
||||
|
||||
// Same preconditions as 'segregate'
|
||||
// Post: !empty()
|
||||
void add_ordered_block(void * const block,
|
||||
const size_type nsz, const size_type npartition_sz)
|
||||
{
|
||||
// This (slower) version of add_block segregates the
|
||||
// block and merges its free list into our free list
|
||||
// in the proper order
|
||||
|
||||
// Find where "block" would go in the free list
|
||||
void * const loc = find_prev(block);
|
||||
|
||||
// Place either at beginning or in middle/end
|
||||
if (loc == 0)
|
||||
add_block(block, nsz, npartition_sz);
|
||||
else
|
||||
nextof(loc) = segregate(block, nsz, npartition_sz, nextof(loc));
|
||||
}
|
||||
|
||||
// default destructor
|
||||
|
||||
bool empty() const { return (first == 0); }
|
||||
|
||||
// pre: !empty()
|
||||
void * malloc()
|
||||
{
|
||||
void * const ret = first;
|
||||
|
||||
// Increment the "first" pointer to point to the next chunk
|
||||
first = nextof(first);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// pre: chunk was previously returned from a malloc() referring to the
|
||||
// same free list
|
||||
// post: !empty()
|
||||
void free(void * const chunk)
|
||||
{
|
||||
nextof(chunk) = first;
|
||||
first = chunk;
|
||||
}
|
||||
|
||||
// pre: chunk was previously returned from a malloc() referring to the
|
||||
// same free list
|
||||
// post: !empty()
|
||||
void ordered_free(void * const chunk)
|
||||
{
|
||||
// This (slower) implementation of 'free' places the memory
|
||||
// back in the list in its proper order.
|
||||
|
||||
// Find where "chunk" goes in the free list
|
||||
void * const loc = find_prev(chunk);
|
||||
|
||||
// Place either at beginning or in middle/end
|
||||
if (loc == 0)
|
||||
free(chunk);
|
||||
else
|
||||
{
|
||||
nextof(chunk) = nextof(loc);
|
||||
nextof(loc) = chunk;
|
||||
}
|
||||
}
|
||||
|
||||
// Note: if you're allocating/deallocating n a lot, you should
|
||||
// be using an ordered pool.
|
||||
void * malloc_n(size_type n, size_type partition_size);
|
||||
|
||||
// pre: chunks was previously allocated from *this with the same
|
||||
// values for n and partition_size
|
||||
// post: !empty()
|
||||
// Note: if you're allocating/deallocating n a lot, you should
|
||||
// be using an ordered pool.
|
||||
void free_n(void * const chunks, const size_type n,
|
||||
const size_type partition_size)
|
||||
{
|
||||
add_block(chunks, n * partition_size, partition_size);
|
||||
}
|
||||
|
||||
// pre: chunks was previously allocated from *this with the same
|
||||
// values for n and partition_size
|
||||
// post: !empty()
|
||||
void ordered_free_n(void * const chunks, const size_type n,
|
||||
const size_type partition_size)
|
||||
{
|
||||
add_ordered_block(chunks, n * partition_size, partition_size);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename SizeType>
|
||||
void * simple_segregated_storage<SizeType>::find_prev(void * const ptr)
|
||||
{
|
||||
// Handle border case
|
||||
if (first == 0 || std::greater<void *>()(first, ptr))
|
||||
return 0;
|
||||
|
||||
void * iter = first;
|
||||
while (true)
|
||||
{
|
||||
// if we're about to hit the end or
|
||||
// if we've found where "ptr" goes
|
||||
if (nextof(iter) == 0 || std::greater<void *>()(nextof(iter), ptr))
|
||||
return iter;
|
||||
|
||||
iter = nextof(iter);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SizeType>
|
||||
void * simple_segregated_storage<SizeType>::segregate(
|
||||
void * const block,
|
||||
const size_type sz,
|
||||
const size_type partition_sz,
|
||||
void * const end)
|
||||
{
|
||||
// Get pointer to last valid chunk, preventing overflow on size calculations
|
||||
// The division followed by the multiplication just makes sure that
|
||||
// old == block + partition_sz * i, for some integer i, even if the
|
||||
// block size (sz) is not a multiple of the partition size.
|
||||
char * old = static_cast<char *>(block)
|
||||
+ ((sz - partition_sz) / partition_sz) * partition_sz;
|
||||
|
||||
// Set it to point to the end
|
||||
nextof(old) = end;
|
||||
|
||||
// Handle border case where sz == partition_sz (i.e., we're handling an array
|
||||
// of 1 element)
|
||||
if (old == block)
|
||||
return block;
|
||||
|
||||
// Iterate backwards, building a singly-linked list of pointers
|
||||
for (char * iter = old - partition_sz; iter != block;
|
||||
old = iter, iter -= partition_sz)
|
||||
nextof(iter) = old;
|
||||
|
||||
// Point the first pointer, too
|
||||
nextof(block) = old;
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// The following function attempts to find n contiguous chunks
|
||||
// of size partition_size in the free list, starting at start.
|
||||
// If it succeds, it returns the last chunk in that contiguous
|
||||
// sequence, so that the sequence is known by [start, {retval}]
|
||||
// If it fails, it does do either because it's at the end of the
|
||||
// free list or hits a non-contiguous chunk. In either case,
|
||||
// it will return 0, and set start to the last considered
|
||||
// chunk. You are at the end of the free list if
|
||||
// nextof(start) == 0. Otherwise, start points to the last
|
||||
// chunk in the contiguous sequence, and nextof(start) points
|
||||
// to the first chunk in the next contiguous sequence (assuming
|
||||
// an ordered free list)
|
||||
template <typename SizeType>
|
||||
void * simple_segregated_storage<SizeType>::try_malloc_n(
|
||||
void * & start, size_type n, const size_type partition_size)
|
||||
{
|
||||
void * iter = nextof(start);
|
||||
while (--n != 0)
|
||||
{
|
||||
void * next = nextof(iter);
|
||||
if (next != static_cast<char *>(iter) + partition_size)
|
||||
{
|
||||
// next == 0 (end-of-list) or non-contiguous chunk found
|
||||
start = iter;
|
||||
return 0;
|
||||
}
|
||||
iter = next;
|
||||
}
|
||||
return iter;
|
||||
}
|
||||
|
||||
template <typename SizeType>
|
||||
void * simple_segregated_storage<SizeType>::malloc_n(const size_type n,
|
||||
const size_type partition_size)
|
||||
{
|
||||
void * start = &first;
|
||||
void * iter;
|
||||
do
|
||||
{
|
||||
if (nextof(start) == 0)
|
||||
return 0;
|
||||
iter = try_malloc_n(start, n, partition_size);
|
||||
} while (iter == 0);
|
||||
void * const ret = nextof(start);
|
||||
nextof(start) = nextof(iter);
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,120 @@
|
||||
// Copyright (C) 2000, 2001 Stephen Cleary (shammah@voyager.net)
|
||||
//
|
||||
// This file can be redistributed and/or modified under the terms found
|
||||
// in "copyright.html"
|
||||
// This software and its documentation is provided "as is" without express or
|
||||
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_SINGLETON_POOL_HPP
|
||||
#define BOOST_SINGLETON_POOL_HPP
|
||||
|
||||
#include <boost/pool/poolfwd.hpp>
|
||||
|
||||
// boost::pool
|
||||
#include <boost/pool/pool.hpp>
|
||||
// boost::details::pool::singleton_default
|
||||
#include <boost/pool/detail/singleton.hpp>
|
||||
// boost::details::pool::guard
|
||||
#include <boost/pool/detail/guard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
//
|
||||
// The singleton_pool class allows other pool interfaces for types of the same
|
||||
// size to share the same pool
|
||||
//
|
||||
template <typename Tag, unsigned RequestedSize,
|
||||
typename UserAllocator,
|
||||
typename Mutex,
|
||||
unsigned NextSize>
|
||||
struct singleton_pool
|
||||
{
|
||||
public:
|
||||
typedef Tag tag;
|
||||
typedef Mutex mutex;
|
||||
typedef UserAllocator user_allocator;
|
||||
typedef typename pool<UserAllocator>::size_type size_type;
|
||||
typedef typename pool<UserAllocator>::difference_type difference_type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(unsigned, requested_size = RequestedSize);
|
||||
BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize);
|
||||
|
||||
private:
|
||||
struct pool_type: Mutex
|
||||
{
|
||||
pool<UserAllocator> p;
|
||||
pool_type():p(RequestedSize, NextSize) { }
|
||||
};
|
||||
|
||||
typedef details::pool::singleton_default<pool_type> singleton;
|
||||
|
||||
singleton_pool();
|
||||
|
||||
public:
|
||||
static void * malloc()
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.malloc();
|
||||
}
|
||||
static void * ordered_malloc()
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.ordered_malloc();
|
||||
}
|
||||
static void * ordered_malloc(const size_type n)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.ordered_malloc(n);
|
||||
}
|
||||
static bool is_from(void * const ptr)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.is_from(ptr);
|
||||
}
|
||||
static void free(void * const ptr)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
p.p.free(ptr);
|
||||
}
|
||||
static void ordered_free(void * const ptr)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
p.p.ordered_free(ptr);
|
||||
}
|
||||
static void free(void * const ptr, const size_type n)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
p.p.free(ptr, n);
|
||||
}
|
||||
static void ordered_free(void * const ptr, const size_type n)
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
p.p.ordered_free(ptr, n);
|
||||
}
|
||||
static bool release_memory()
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.release_memory();
|
||||
}
|
||||
static bool purge_memory()
|
||||
{
|
||||
pool_type & p = singleton::instance();
|
||||
details::pool::guard<Mutex> g(p);
|
||||
return p.p.purge_memory();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
91
Server/RylServerProject/BaseLibrary/boost/static_assert.hpp
Normal file
91
Server/RylServerProject/BaseLibrary/boost/static_assert.hpp
Normal file
@@ -0,0 +1,91 @@
|
||||
// (C) Copyright John Maddock 2000.
|
||||
// Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org/libs/static_assert for documentation.
|
||||
|
||||
/*
|
||||
Revision history:
|
||||
02 August 2000
|
||||
Initial version.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_STATIC_ASSERT_HPP
|
||||
#define BOOST_STATIC_ASSERT_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
//
|
||||
// workaround for buggy integral-constant expression support:
|
||||
#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
// HP aCC cannot deal with missing names for template value parameters
|
||||
template <bool x> struct STATIC_ASSERTION_FAILURE;
|
||||
|
||||
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
|
||||
|
||||
// HP aCC cannot deal with missing names for template value parameters
|
||||
template<int x> struct static_assert_test{};
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Implicit instantiation requires that all member declarations be
|
||||
// instantiated, but that the definitions are *not* instantiated.
|
||||
//
|
||||
// It's not particularly clear how this applies to enum's or typedefs;
|
||||
// both are described as declarations [7.1.3] and [7.2] in the standard,
|
||||
// however some compilers use "delayed evaluation" of one or more of
|
||||
// these when implicitly instantiating templates. We use typedef declarations
|
||||
// by default, but try defining BOOST_USE_ENUM_STATIC_ASSERT if the enum
|
||||
// version gets better results from your compiler...
|
||||
//
|
||||
// Implementation:
|
||||
// Both of these versions rely on sizeof(incomplete_type) generating an error
|
||||
// message containing the name of the incomplete type. We use
|
||||
// "STATIC_ASSERTION_FAILURE" as the type name here to generate
|
||||
// an eye catching error message. The result of the sizeof expression is either
|
||||
// used as an enum initialiser, or as a template argument depending which version
|
||||
// is in use...
|
||||
// Note that the argument to the assert is explicitly cast to bool using old-
|
||||
// style casts: too many compilers currently have problems with static_cast
|
||||
// when used inside integral constant expressions.
|
||||
//
|
||||
#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) && !defined(__MWERKS__)
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
// __LINE__ macro broken when -ZI is used see Q199057
|
||||
// fortunately MSVC ignores duplicate typedef's.
|
||||
#define BOOST_STATIC_ASSERT( B ) \
|
||||
typedef ::boost::static_assert_test<\
|
||||
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\
|
||||
> boost_static_assert_typedef_
|
||||
#elif defined(BOOST_INTEL_CXX_VERSION)
|
||||
// agurt 15/sep/02: a special care is needed to force Intel C++ issue an error
|
||||
// instead of warning in case of failure
|
||||
# define BOOST_STATIC_ASSERT( B ) \
|
||||
typedef char BOOST_JOIN(boost_static_assert_typedef_, __LINE__) \
|
||||
[ ::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >::value ]
|
||||
#else
|
||||
// generic version
|
||||
#define BOOST_STATIC_ASSERT( B ) \
|
||||
typedef ::boost::static_assert_test<\
|
||||
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
|
||||
BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
|
||||
#endif
|
||||
|
||||
#else
|
||||
// alternative enum based implementation:
|
||||
#define BOOST_STATIC_ASSERT( B ) \
|
||||
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
|
||||
= sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
|
||||
#endif
|
||||
|
||||
|
||||
#endif // BOOST_STATIC_ASSERT_HPP
|
||||
@@ -0,0 +1,36 @@
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
//
|
||||
// Permission to copy, use, modify, sell and distribute this software is
|
||||
// granted provided this copyright notice appears in all copies. This software
|
||||
// is provided "as is" without express or implied warranty, and with no claim
|
||||
// as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
|
||||
#define BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true>
|
||||
struct ice_and;
|
||||
|
||||
template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
|
||||
struct ice_and
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ice_and<true, true, true, true, true, true, true>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
} // namespace type_traits
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
|
||||
@@ -0,0 +1,38 @@
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
//
|
||||
// Permission to copy, use, modify, sell and distribute this software is
|
||||
// granted provided this copyright notice appears in all copies. This software
|
||||
// is provided "as is" without express or implied warranty, and with no claim
|
||||
// as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
|
||||
#define BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
template <int b1, int b2>
|
||||
struct ice_eq
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = (b1 == b2));
|
||||
};
|
||||
|
||||
template <int b1, int b2>
|
||||
struct ice_ne
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = (b1 != b2));
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
template <int b1, int b2> bool const ice_eq<b1,b2>::value;
|
||||
template <int b1, int b2> bool const ice_ne<b1,b2>::value;
|
||||
#endif
|
||||
|
||||
} // namespace type_traits
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
|
||||
@@ -0,0 +1,33 @@
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
//
|
||||
// Permission to copy, use, modify, sell and distribute this software is
|
||||
// granted provided this copyright notice appears in all copies. This software
|
||||
// is provided "as is" without express or implied warranty, and with no claim
|
||||
// as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
|
||||
#define BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
template <bool b>
|
||||
struct ice_not
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ice_not<true>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
} // namespace type_traits
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
|
||||
@@ -0,0 +1,36 @@
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
//
|
||||
// Permission to copy, use, modify, sell and distribute this software is
|
||||
// granted provided this copyright notice appears in all copies. This software
|
||||
// is provided "as is" without express or implied warranty, and with no claim
|
||||
// as to its suitability for any purpose.
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
|
||||
#define BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false>
|
||||
struct ice_or;
|
||||
|
||||
template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
|
||||
struct ice_or
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ice_or<false, false, false, false, false, false, false>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
} // namespace type_traits
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
// Permission to copy, use, modify, sell and distribute this software is
|
||||
// granted provided this copyright notice appears in all copies. This software
|
||||
// is provided "as is" without express or implied warranty, and with no claim
|
||||
// as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
//
|
||||
// macros and helpers for working with integral-constant-expressions.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED
|
||||
#define BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
typedef char yes_type;
|
||||
struct no_type
|
||||
{
|
||||
char padding[8];
|
||||
};
|
||||
|
||||
} // namespace type_traits
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
// (C) Copyright John Maddock and Steve Cleary 2000.
|
||||
// Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
//
|
||||
// macros and helpers for working with integral-constant-expressions.
|
||||
|
||||
#ifndef BOOST_TT_ICE_HPP_INCLUDED
|
||||
#define BOOST_TT_ICE_HPP_INCLUDED
|
||||
|
||||
#include "boost/type_traits/detail/yes_no_type.hpp"
|
||||
#include "boost/type_traits/detail/ice_or.hpp"
|
||||
#include "boost/type_traits/detail/ice_and.hpp"
|
||||
#include "boost/type_traits/detail/ice_not.hpp"
|
||||
#include "boost/type_traits/detail/ice_eq.hpp"
|
||||
|
||||
#endif // BOOST_TT_ICE_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user