forked from boostorg/function
Initial comit
[SVN r10368]
This commit is contained in:
96
.gitattributes
vendored
Normal file
96
.gitattributes
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
* text=auto !eol svneol=native#text/plain
|
||||
*.gitattributes text svneol=native#text/plain
|
||||
|
||||
# Scriptish formats
|
||||
*.bat text svneol=native#text/plain
|
||||
*.bsh text svneol=native#text/x-beanshell
|
||||
*.cgi text svneol=native#text/plain
|
||||
*.cmd text svneol=native#text/plain
|
||||
*.js text svneol=native#text/javascript
|
||||
*.php text svneol=native#text/x-php
|
||||
*.pl text svneol=native#text/x-perl
|
||||
*.pm text svneol=native#text/x-perl
|
||||
*.py text svneol=native#text/x-python
|
||||
*.sh eol=lf svneol=LF#text/x-sh
|
||||
configure eol=lf svneol=LF#text/x-sh
|
||||
|
||||
# Image formats
|
||||
*.bmp binary svneol=unset#image/bmp
|
||||
*.gif binary svneol=unset#image/gif
|
||||
*.ico binary svneol=unset#image/ico
|
||||
*.jpeg binary svneol=unset#image/jpeg
|
||||
*.jpg binary svneol=unset#image/jpeg
|
||||
*.png binary svneol=unset#image/png
|
||||
*.tif binary svneol=unset#image/tiff
|
||||
*.tiff binary svneol=unset#image/tiff
|
||||
*.svg text svneol=native#image/svg%2Bxml
|
||||
|
||||
# Data formats
|
||||
*.pdf binary svneol=unset#application/pdf
|
||||
*.avi binary svneol=unset#video/avi
|
||||
*.doc binary svneol=unset#application/msword
|
||||
*.dsp text svneol=crlf#text/plain
|
||||
*.dsw text svneol=crlf#text/plain
|
||||
*.eps binary svneol=unset#application/postscript
|
||||
*.gz binary svneol=unset#application/gzip
|
||||
*.mov binary svneol=unset#video/quicktime
|
||||
*.mp3 binary svneol=unset#audio/mpeg
|
||||
*.ppt binary svneol=unset#application/vnd.ms-powerpoint
|
||||
*.ps binary svneol=unset#application/postscript
|
||||
*.psd binary svneol=unset#application/photoshop
|
||||
*.rdf binary svneol=unset#text/rdf
|
||||
*.rss text svneol=unset#text/xml
|
||||
*.rtf binary svneol=unset#text/rtf
|
||||
*.sln text svneol=native#text/plain
|
||||
*.swf binary svneol=unset#application/x-shockwave-flash
|
||||
*.tgz binary svneol=unset#application/gzip
|
||||
*.vcproj text svneol=native#text/xml
|
||||
*.vcxproj text svneol=native#text/xml
|
||||
*.vsprops text svneol=native#text/xml
|
||||
*.wav binary svneol=unset#audio/wav
|
||||
*.xls binary svneol=unset#application/vnd.ms-excel
|
||||
*.zip binary svneol=unset#application/zip
|
||||
|
||||
# Text formats
|
||||
.htaccess text svneol=native#text/plain
|
||||
*.bbk text svneol=native#text/xml
|
||||
*.cmake text svneol=native#text/plain
|
||||
*.css text svneol=native#text/css
|
||||
*.dtd text svneol=native#text/xml
|
||||
*.htm text svneol=native#text/html
|
||||
*.html text svneol=native#text/html
|
||||
*.ini text svneol=native#text/plain
|
||||
*.log text svneol=native#text/plain
|
||||
*.mak text svneol=native#text/plain
|
||||
*.qbk text svneol=native#text/plain
|
||||
*.rst text svneol=native#text/plain
|
||||
*.sql text svneol=native#text/x-sql
|
||||
*.txt text svneol=native#text/plain
|
||||
*.xhtml text svneol=native#text/xhtml%2Bxml
|
||||
*.xml text svneol=native#text/xml
|
||||
*.xsd text svneol=native#text/xml
|
||||
*.xsl text svneol=native#text/xml
|
||||
*.xslt text svneol=native#text/xml
|
||||
*.xul text svneol=native#text/xul
|
||||
*.yml text svneol=native#text/plain
|
||||
boost-no-inspect text svneol=native#text/plain
|
||||
CHANGES text svneol=native#text/plain
|
||||
COPYING text svneol=native#text/plain
|
||||
INSTALL text svneol=native#text/plain
|
||||
Jamfile text svneol=native#text/plain
|
||||
Jamroot text svneol=native#text/plain
|
||||
Jamfile.v2 text svneol=native#text/plain
|
||||
Jamrules text svneol=native#text/plain
|
||||
Makefile* text svneol=native#text/plain
|
||||
README text svneol=native#text/plain
|
||||
TODO text svneol=native#text/plain
|
||||
|
||||
# Code formats
|
||||
*.c text svneol=native#text/plain
|
||||
*.cpp text svneol=native#text/plain
|
||||
*.h text svneol=native#text/plain
|
||||
*.hpp text svneol=native#text/plain
|
||||
*.ipp text svneol=native#text/plain
|
||||
*.tpp text svneol=native#text/plain
|
||||
*.jam text svneol=native#text/plain
|
||||
*.java text svneol=native#text/plain
|
521
include/boost/function.hpp
Normal file
521
include/boost/function.hpp
Normal file
@ -0,0 +1,521 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
|
||||
// design of this library.
|
||||
|
||||
#ifndef BOOST_FUNCTION_HPP
|
||||
#define BOOST_FUNCTION_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
#include <boost/function/function0.hpp>
|
||||
#include <boost/function/function1.hpp>
|
||||
#include <boost/function/function2.hpp>
|
||||
#include <boost/function/function3.hpp>
|
||||
#include <boost/function/function4.hpp>
|
||||
#include <boost/function/function5.hpp>
|
||||
#include <boost/function/function6.hpp>
|
||||
#include <boost/function/function7.hpp>
|
||||
#include <boost/function/function8.hpp>
|
||||
#include <boost/function/function9.hpp>
|
||||
#include <boost/function/function10.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace function {
|
||||
// Choose the appropriate underlying implementation
|
||||
template<int Args> struct real_get_function_impl {};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<0>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function0<R, Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<1>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function1<R, T1, Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<2>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function2<R, T1, T2, Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<3>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function3<R, T1, T2, T3, Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<4>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function4<R, T1, T2, T3, T4, Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<5>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function5<R, T1, T2, T3, T4, T5, Policy, Mixin, Allocator>
|
||||
type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<6>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function6<R, T1, T2, T3, T4, T5, T6, Policy, Mixin, Allocator>
|
||||
type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<7>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function7<R, T1, T2, T3, T4, T5, T6, T7, Policy, Mixin,
|
||||
Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<8>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function8<R, T1, T2, T3, T4, T5, T6, T7, T8, Policy, Mixin,
|
||||
Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<9>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function9<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, Policy,
|
||||
Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct real_get_function_impl<10>
|
||||
{
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct params
|
||||
{
|
||||
typedef function10<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
|
||||
Policy, Mixin, Allocator> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename Policy = empty_function_policy,
|
||||
typename Mixin = empty_function_mixin,
|
||||
typename Allocator = std::allocator<function_base>
|
||||
>
|
||||
struct get_function_impl
|
||||
{
|
||||
typedef typename real_get_function_impl<
|
||||
(count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value)
|
||||
>::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
|
||||
Policy, Mixin, Allocator>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10,
|
||||
typename MyPolicy = empty_function_policy,
|
||||
typename MyMixin = empty_function_mixin,
|
||||
typename MyAllocator = std::allocator<function_base>
|
||||
>
|
||||
struct function_traits_builder
|
||||
{
|
||||
typedef typename get_function_impl<R, T1, T2, T3, T4, T5, T6, T7,
|
||||
T8, T9, T10, MyPolicy, MyMixin,
|
||||
MyAllocator>::type
|
||||
type;
|
||||
|
||||
typedef MyPolicy policy_type;
|
||||
typedef MyMixin mixin_type;
|
||||
typedef MyAllocator allocator_type;
|
||||
|
||||
#ifndef BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
|
||||
template<typename Policy>
|
||||
struct policy :
|
||||
public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
|
||||
T10, Policy, mixin_type,
|
||||
allocator_type> {};
|
||||
|
||||
template<typename Mixin>
|
||||
struct mixin :
|
||||
public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
|
||||
T10, policy_type, Mixin,
|
||||
allocator_type> {};
|
||||
|
||||
template<typename Allocator>
|
||||
struct allocator :
|
||||
public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
|
||||
T10, policy_type, mixin_type,
|
||||
Allocator> {};
|
||||
#else
|
||||
template<typename Policy>
|
||||
struct policy
|
||||
{
|
||||
typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
|
||||
T8, T9, T10, Policy,
|
||||
mixin_type,
|
||||
allocator_type>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template<typename Mixin>
|
||||
struct mixin
|
||||
{
|
||||
typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
|
||||
T8, T9, T10, policy_type, Mixin,
|
||||
allocator_type>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template<typename Allocator>
|
||||
struct allocator
|
||||
{
|
||||
typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
|
||||
T8, T9, T10, policy_type,
|
||||
mixin_type, Allocator>::type
|
||||
type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace function
|
||||
} // end namespace detail
|
||||
|
||||
template<
|
||||
typename R,
|
||||
typename T1 = detail::function::unusable,
|
||||
typename T2 = detail::function::unusable,
|
||||
typename T3 = detail::function::unusable,
|
||||
typename T4 = detail::function::unusable,
|
||||
typename T5 = detail::function::unusable,
|
||||
typename T6 = detail::function::unusable,
|
||||
typename T7 = detail::function::unusable,
|
||||
typename T8 = detail::function::unusable,
|
||||
typename T9 = detail::function::unusable,
|
||||
typename T10 = detail::function::unusable
|
||||
>
|
||||
class function :
|
||||
public detail::function::get_function_impl<R, T1, T2, T3, T4, T5, T6, T7,
|
||||
T8, T9, T10>::type,
|
||||
public detail::function::function_traits_builder<R, T1, T2, T3, T4, T5, T6,
|
||||
T7, T8, T9, T10>
|
||||
{
|
||||
typedef typename detail::function::get_function_impl<R, T1, T2, T3, T4, T5,
|
||||
T6, T7, T8, T9, T10
|
||||
>::type
|
||||
base_type;
|
||||
|
||||
public:
|
||||
typedef typename base_type::policy_type policy_type;
|
||||
typedef typename base_type::mixin_type mixin_type;
|
||||
typedef typename base_type::allocator_type allocator_type;
|
||||
typedef function self_type;
|
||||
|
||||
function() : base_type() {}
|
||||
|
||||
template<typename Functor>
|
||||
function(Functor BOOST_MSVC_INCLUDE(const &) f) : base_type(f) {}
|
||||
|
||||
function(const function& f) : base_type(static_cast<const base_type&>(f)){}
|
||||
|
||||
function& operator=(const function& f)
|
||||
{
|
||||
const base_type& bf = static_cast<const base_type&>(f);
|
||||
base_type* self = this;
|
||||
self->set(bf);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void set(const function& f)
|
||||
{
|
||||
const base_type& bf = static_cast<const base_type&>(f);
|
||||
base_type* self = this;
|
||||
self->set(bf);
|
||||
}
|
||||
|
||||
void swap(function& other)
|
||||
{
|
||||
#ifndef BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
std::swap(this->manager, other.manager);
|
||||
std::swap(this->functor, other.functor);
|
||||
std::swap(this->invoker, other.invoker);
|
||||
#else
|
||||
std::swap(this->impl, other.impl);
|
||||
#endif // BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
}
|
||||
|
||||
#ifdef BOOST_NO_DEPENDENT_BASE_LOOKUP
|
||||
template<typename Functor>
|
||||
function& operator=(Functor BOOST_MSVC_INCLUDE(const &) f)
|
||||
{
|
||||
this->set(f);
|
||||
return *this;
|
||||
}
|
||||
|
||||
base_type& operator=(const base_type& f)
|
||||
{
|
||||
this->set(f);
|
||||
return *this;
|
||||
}
|
||||
#endif // BOOST_NO_DEPENDENT_BASE_LOOKUP
|
||||
};
|
||||
|
||||
template<typename R,
|
||||
typename T1,
|
||||
typename T2,
|
||||
typename T3,
|
||||
typename T4,
|
||||
typename T5,
|
||||
typename T6,
|
||||
typename T7,
|
||||
typename T8,
|
||||
typename T9,
|
||||
typename T10>
|
||||
inline void swap(function<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& f1,
|
||||
function<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& f2)
|
||||
{
|
||||
f1.swap(f2);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
55
include/boost/function/function0.hpp
Normal file
55
include/boost/function/function0.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION0_HPP
|
||||
#define BOOST_FUNCTION0_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 0
|
||||
#define BOOST_FUNCTION_COMMA
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#define BOOST_FUNCTION_PARMS
|
||||
#define BOOST_FUNCTION_ARGS
|
||||
#define BOOST_FUNCTION_FUNCTION function0
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base0
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker0
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker0
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker0
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker0
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker0
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker0
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION0_HPP
|
55
include/boost/function/function1.hpp
Normal file
55
include/boost/function/function1.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION1_HPP
|
||||
#define BOOST_FUNCTION1_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 1
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1
|
||||
#define BOOST_FUNCTION_PARMS T1 a1
|
||||
#define BOOST_FUNCTION_ARGS a1
|
||||
#define BOOST_FUNCTION_FUNCTION function1
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base1
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker1
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker1
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker1
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker1
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker1
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker1
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION1_HPP
|
55
include/boost/function/function10.hpp
Normal file
55
include/boost/function/function10.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION10_HPP
|
||||
#define BOOST_FUNCTION10_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 10
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5, typename OtherT6, typename OtherT7, typename OtherT8, typename OtherT9, typename OtherT10
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5, OtherT6, OtherT7, OtherT8, OtherT9, OtherT10
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
|
||||
#define BOOST_FUNCTION_FUNCTION function10
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base10
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker10
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker10
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker10
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker10
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker10
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker10
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION10_HPP
|
55
include/boost/function/function2.hpp
Normal file
55
include/boost/function/function2.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION2_HPP
|
||||
#define BOOST_FUNCTION2_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 2
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2
|
||||
#define BOOST_FUNCTION_ARGS a1, a2
|
||||
#define BOOST_FUNCTION_FUNCTION function2
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base2
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker2
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker2
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker2
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker2
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker2
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker2
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION2_HPP
|
55
include/boost/function/function3.hpp
Normal file
55
include/boost/function/function3.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION3_HPP
|
||||
#define BOOST_FUNCTION3_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 3
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3
|
||||
#define BOOST_FUNCTION_FUNCTION function3
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base3
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker3
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker3
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker3
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker3
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker3
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker3
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION3_HPP
|
55
include/boost/function/function4.hpp
Normal file
55
include/boost/function/function4.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION4_HPP
|
||||
#define BOOST_FUNCTION4_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 4
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4
|
||||
#define BOOST_FUNCTION_FUNCTION function4
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base4
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker4
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker4
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker4
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker4
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker4
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker4
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION4_HPP
|
55
include/boost/function/function5.hpp
Normal file
55
include/boost/function/function5.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION5_HPP
|
||||
#define BOOST_FUNCTION5_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 5
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5
|
||||
#define BOOST_FUNCTION_FUNCTION function5
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base5
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker5
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker5
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker5
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker5
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker5
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker5
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION5_HPP
|
55
include/boost/function/function6.hpp
Normal file
55
include/boost/function/function6.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION6_HPP
|
||||
#define BOOST_FUNCTION6_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 6
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5, typename OtherT6
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5, OtherT6
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5, a6
|
||||
#define BOOST_FUNCTION_FUNCTION function6
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base6
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker6
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker6
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker6
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker6
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker6
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker6
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION6_HPP
|
55
include/boost/function/function7.hpp
Normal file
55
include/boost/function/function7.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION7_HPP
|
||||
#define BOOST_FUNCTION7_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 7
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5, typename OtherT6, typename OtherT7
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5, OtherT6, OtherT7
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5, a6, a7
|
||||
#define BOOST_FUNCTION_FUNCTION function7
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base7
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker7
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker7
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker7
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker7
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker7
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker7
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION7_HPP
|
55
include/boost/function/function8.hpp
Normal file
55
include/boost/function/function8.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION8_HPP
|
||||
#define BOOST_FUNCTION8_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 8
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5, typename OtherT6, typename OtherT7, typename OtherT8
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5, OtherT6, OtherT7, OtherT8
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5, a6, a7, a8
|
||||
#define BOOST_FUNCTION_FUNCTION function8
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base8
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker8
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker8
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker8
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker8
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker8
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker8
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION8_HPP
|
55
include/boost/function/function9.hpp
Normal file
55
include/boost/function/function9.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION9_HPP
|
||||
#define BOOST_FUNCTION9_HPP
|
||||
|
||||
#include <boost/function/function_base.hpp>
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 9
|
||||
#define BOOST_FUNCTION_COMMA ,
|
||||
#define BOOST_FUNCTION_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
#define BOOST_FUNCTION_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_PARMS typename OtherT1, typename OtherT2, typename OtherT3, typename OtherT4, typename OtherT5, typename OtherT6, typename OtherT7, typename OtherT8, typename OtherT9
|
||||
#define BOOST_FUNCTION_OTHER_TEMPLATE_ARGS OtherT1, OtherT2, OtherT3, OtherT4, OtherT5, OtherT6, OtherT7, OtherT8, OtherT9
|
||||
#define BOOST_FUNCTION_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9
|
||||
#define BOOST_FUNCTION_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9
|
||||
#define BOOST_FUNCTION_FUNCTION function9
|
||||
#define BOOST_FUNCTION_INVOKER_BASE invoker_base9
|
||||
#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker9
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker9
|
||||
#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker9
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker9
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker9
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker9
|
||||
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_OTHER_TEMPLATE_ARGS
|
||||
#undef BOOST_FUNCTION_PARMS
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
#undef BOOST_FUNCTION_INVOKER_BASE
|
||||
#undef BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
|
||||
#endif // BOOST_FUNCTION9_HPP
|
416
include/boost/function/function_base.hpp
Normal file
416
include/boost/function/function_base.hpp
Normal file
@ -0,0 +1,416 @@
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided 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.
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION_BASE_HEADER
|
||||
#define BOOST_FUNCTION_BASE_HEADER
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <memory>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
// Microsoft Visual C++ 6.0sp5 has lots of quirks
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_MSVC_INCLUDE(x) x
|
||||
#else
|
||||
# define BOOST_MSVC_INCLUDE(x)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace function {
|
||||
/*
|
||||
* The IF implementation is temporary code. When a Boost metaprogramming
|
||||
* library is introduced, Boost.Function will use it instead.
|
||||
*/
|
||||
namespace intimate {
|
||||
struct SelectThen
|
||||
{
|
||||
template<typename Then, typename Else>
|
||||
struct Result
|
||||
{
|
||||
typedef Then RET;
|
||||
};
|
||||
};
|
||||
|
||||
struct SelectElse
|
||||
{
|
||||
template<typename Then, typename Else>
|
||||
struct Result
|
||||
{
|
||||
typedef Else RET;
|
||||
};
|
||||
};
|
||||
|
||||
template<bool Condition>
|
||||
struct Selector
|
||||
{
|
||||
typedef SelectThen RET;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Selector<false>
|
||||
{
|
||||
typedef SelectElse RET;
|
||||
};
|
||||
} // end namespace intimate
|
||||
|
||||
template<bool Condition, typename Then, typename Else>
|
||||
struct IF
|
||||
{
|
||||
typedef typename intimate::Selector<Condition>::RET select;
|
||||
typedef typename select::template Result<Then,Else>::RET RET;
|
||||
typedef RET type;
|
||||
};
|
||||
|
||||
/**
|
||||
* A union of a function pointer and a void pointer. This is necessary
|
||||
* because 5.2.10/6 allows reinterpret_cast<> to safely cast between
|
||||
* function pointer types and 5.2.9/10 allows static_cast<> to safely
|
||||
* cast between a void pointer and an object pointer. But it is not legal
|
||||
* to cast between a function pointer and a void* (in either direction),
|
||||
* so function requires a union of the two. */
|
||||
union any_pointer
|
||||
{
|
||||
void* obj_ptr;
|
||||
void (*func_ptr)();
|
||||
|
||||
explicit any_pointer(void* p) : obj_ptr(p) {}
|
||||
explicit any_pointer(void (*p)()) : func_ptr(p) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The unusable class is a placeholder for unused function arguments
|
||||
* It is also completely unusable except that it constructable from
|
||||
* anything. This helps compilers without partial specialization to
|
||||
* handle Boost.Function objects returning void.
|
||||
*/
|
||||
struct unusable
|
||||
{
|
||||
unusable() {}
|
||||
template<typename T> unusable(const T&) {}
|
||||
};
|
||||
|
||||
/* Determine the return type. This supports compilers that do not support
|
||||
* void returns or partial specialization by silently changing the return
|
||||
* type to "unusable".
|
||||
*/
|
||||
template<typename T> struct function_return_type { typedef T type; };
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template<>
|
||||
struct function_return_type<void>
|
||||
{
|
||||
typedef unusable type;
|
||||
};
|
||||
#endif /* BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION */
|
||||
|
||||
// The operation type to perform on the given functor/function pointer
|
||||
enum functor_manager_operation_type { clone_functor, destroy_functor };
|
||||
|
||||
// Tags used to decide between function and function object pointers.
|
||||
struct function_ptr_tag {};
|
||||
struct function_obj_tag {};
|
||||
|
||||
#ifndef BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
/**
|
||||
* The functor_manager class contains a static function "manage" which
|
||||
* can clone or destroy the given function/function object pointer.
|
||||
*/
|
||||
template<typename Functor, typename Allocator>
|
||||
struct functor_manager
|
||||
{
|
||||
private:
|
||||
typedef Functor functor_type;
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
typedef typename Allocator::template rebind<functor_type>::other
|
||||
allocator_type;
|
||||
typedef typename allocator_type::pointer pointer_type;
|
||||
# else
|
||||
typedef functor_type* pointer_type;
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
// For function pointers, the manager is trivial
|
||||
static inline any_pointer
|
||||
manager(any_pointer function_ptr, functor_manager_operation_type op,
|
||||
function_ptr_tag)
|
||||
{
|
||||
if (op == clone_functor)
|
||||
return function_ptr;
|
||||
else
|
||||
return any_pointer(static_cast<void (*)()>(0));
|
||||
}
|
||||
|
||||
// For function object pointers, we clone the pointer to each
|
||||
// function has its own version.
|
||||
static inline any_pointer
|
||||
manager(any_pointer function_obj_ptr,
|
||||
functor_manager_operation_type op,
|
||||
function_obj_tag)
|
||||
{
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
allocator_type allocator;
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
if (op == clone_functor) {
|
||||
functor_type* f =
|
||||
static_cast<functor_type*>(function_obj_ptr.obj_ptr);
|
||||
|
||||
// Clone the functor
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
pointer_type copy = allocator.allocate(1);
|
||||
allocator.construct(copy, *f);
|
||||
|
||||
// Get back to the original pointer type
|
||||
functor_type* new_f = static_cast<functor_type*>(copy);
|
||||
# else
|
||||
functor_type* new_f = new functor_type(*f);
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
return any_pointer(static_cast<void*>(new_f));
|
||||
}
|
||||
else {
|
||||
/* Cast from the void pointer to the functor pointer type */
|
||||
functor_type* f =
|
||||
reinterpret_cast<functor_type*>(function_obj_ptr.obj_ptr);
|
||||
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
/* Cast from the functor pointer type to the allocator's pointer
|
||||
type */
|
||||
pointer_type victim = static_cast<pointer_type>(f);
|
||||
|
||||
|
||||
// Destroy and deallocate the functor
|
||||
allocator.destroy(victim);
|
||||
allocator.deallocate(victim, 1);
|
||||
# else
|
||||
delete f;
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
return any_pointer(static_cast<void*>(0));
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
/* Dispatch to an appropriate manager based on whether we have a
|
||||
function pointer or a function object pointer. */
|
||||
static any_pointer
|
||||
manage(any_pointer functor_ptr, functor_manager_operation_type op)
|
||||
{
|
||||
typedef typename IF<(is_pointer<functor_type>::value),
|
||||
function_ptr_tag,
|
||||
function_obj_tag>::RET tag_type;
|
||||
|
||||
return manager(functor_ptr, op, tag_type());
|
||||
}
|
||||
};
|
||||
#endif // BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
|
||||
// value=1 if the given type is not "unusable"
|
||||
template<typename T>
|
||||
struct count_if_used
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value = 1);
|
||||
};
|
||||
|
||||
// value=0 for unusable types
|
||||
template<>
|
||||
struct count_if_used<unusable>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
|
||||
// Count the number of arguments (from the given set) which are not
|
||||
// "unusable" (therefore, count those arguments that are used).
|
||||
template<typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8,
|
||||
typename T9, typename T10>
|
||||
struct count_used_args
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value =
|
||||
(count_if_used<T1>::value +
|
||||
count_if_used<T2>::value +
|
||||
count_if_used<T3>::value +
|
||||
count_if_used<T4>::value +
|
||||
count_if_used<T5>::value +
|
||||
count_if_used<T6>::value +
|
||||
count_if_used<T7>::value +
|
||||
count_if_used<T8>::value +
|
||||
count_if_used<T9>::value +
|
||||
count_if_used<T10>::value));
|
||||
};
|
||||
} // end namespace function
|
||||
} // end namespace detail
|
||||
|
||||
/**
|
||||
* The function_base class contains the basic elements needed for the
|
||||
* function1, function2, function3, etc. classes. It is common to all
|
||||
* functions (and as such can be used to tell if we have one of the
|
||||
* functionN objects).
|
||||
*/
|
||||
class function_base
|
||||
{
|
||||
#ifdef BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
public:
|
||||
function_base() : impl(0) {}
|
||||
|
||||
bool empty() const { return impl == 0; }
|
||||
|
||||
|
||||
protected:
|
||||
void* impl; // Derived class is responsible for knowing the real type
|
||||
#else
|
||||
public:
|
||||
function_base() : manager(0), functor(static_cast<void*>(0)) {}
|
||||
|
||||
// Is this function empty?
|
||||
bool empty() const { return !manager; }
|
||||
|
||||
protected:
|
||||
detail::function::any_pointer (*manager)(
|
||||
detail::function::any_pointer,
|
||||
detail::function::functor_manager_operation_type);
|
||||
detail::function::any_pointer functor;
|
||||
#endif // BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
|
||||
|
||||
#ifndef BOOST_WEAK_CONVERSION_OPERATORS
|
||||
private:
|
||||
struct dummy {
|
||||
void nonnull() {};
|
||||
};
|
||||
|
||||
typedef void (dummy::*safe_bool)();
|
||||
public:
|
||||
operator safe_bool () const
|
||||
{
|
||||
return (this->empty())? 0 : &dummy::nonnull;
|
||||
}
|
||||
#else
|
||||
public:
|
||||
operator bool() const { return !this->empty(); }
|
||||
#endif // BOOST_WEAK_CONVERSION_OPERATORS
|
||||
};
|
||||
|
||||
/* Poison comparison between Boost.Function objects (because it is
|
||||
* meaningless). The comparisons would otherwise be allowed because of the
|
||||
* conversion required to allow syntax such as:
|
||||
* boost::function<int, int> f;
|
||||
* if (f) { f(5); }
|
||||
*/
|
||||
void operator==(const function_base&, const function_base&);
|
||||
void operator!=(const function_base&, const function_base&);
|
||||
|
||||
namespace detail {
|
||||
namespace function {
|
||||
/**
|
||||
* Determine if the given target is empty.
|
||||
*/
|
||||
|
||||
// Fallback - assume target is not empty
|
||||
inline bool has_empty_target(...)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the target is a 'function', query the empty() method
|
||||
inline bool has_empty_target(const function_base* af)
|
||||
{
|
||||
return af->empty();
|
||||
}
|
||||
|
||||
// If the target is a 'function', query the empty() method
|
||||
inline bool has_empty_target(const function_base& af)
|
||||
{
|
||||
return af.empty();
|
||||
}
|
||||
|
||||
// A function pointer is empty if it is null
|
||||
template<typename R>
|
||||
inline bool has_empty_target(R (*f)())
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1>
|
||||
inline bool has_empty_target(R (*f)(T1))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2>
|
||||
inline bool has_empty_target(R (*f)(T1, T2))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4, T5))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4, T5, T6))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4, T5, T6, T7))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8, typename T9>
|
||||
inline bool has_empty_target(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8, T9))
|
||||
{
|
||||
return f == 0;
|
||||
}
|
||||
} // end namespace function
|
||||
} // end namespace detail
|
||||
|
||||
// The default function policy is to do nothing before and after the call.
|
||||
struct empty_function_policy
|
||||
{
|
||||
inline void precall(const function_base*) {}
|
||||
inline void postcall(const function_base*) {}
|
||||
};
|
||||
|
||||
// The default function mixin costs nothing
|
||||
struct empty_function_mixin {};
|
||||
}
|
||||
|
||||
#endif // BOOST_FUNCTION_BASE_HEADER
|
1808
include/boost/function/function_template.hpp
Normal file
1808
include/boost/function/function_template.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user