diff options
| author | brgayazov <[email protected]> | 2022-10-09 01:35:10 +0300 |
|---|---|---|
| committer | brgayazov <[email protected]> | 2022-10-09 01:35:10 +0300 |
| commit | ee1f58dfc0201eaf78c0a767680f3c9f9f347740 (patch) | |
| tree | 375ae9bcfa05e7fe58192c9d595a84afd997a14e /contrib/restricted/boost/python/include | |
| parent | 35b65c84fba4bca4976ace7ae00a4e4bef6e1ca8 (diff) | |
Added commands profile update and profile replace
Diffstat (limited to 'contrib/restricted/boost/python/include')
60 files changed, 0 insertions, 6473 deletions
diff --git a/contrib/restricted/boost/python/include/boost/python.hpp b/contrib/restricted/boost/python/include/boost/python.hpp deleted file mode 100644 index e4840341038..00000000000 --- a/contrib/restricted/boost/python/include/boost/python.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// 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) - -// See http://www.boost.org/libs/python for documentation. - -#ifndef PYTHON_DWA2002810_HPP -# define PYTHON_DWA2002810_HPP - -# include <boost/python/args.hpp> -# include <boost/python/args_fwd.hpp> -# include <boost/python/back_reference.hpp> -# include <boost/python/bases.hpp> -# include <boost/python/borrowed.hpp> -# include <boost/python/call.hpp> -# include <boost/python/call_method.hpp> -# include <boost/python/class.hpp> -# include <boost/python/copy_const_reference.hpp> -# include <boost/python/copy_non_const_reference.hpp> -# include <boost/python/data_members.hpp> -# include <boost/python/def.hpp> -# include <boost/python/default_call_policies.hpp> -# include <boost/python/dict.hpp> -# include <boost/python/docstring_options.hpp> -# include <boost/python/enum.hpp> -# include <boost/python/errors.hpp> -# include <boost/python/exception_translator.hpp> -# include <boost/python/exec.hpp> -# include <boost/python/extract.hpp> -# include <boost/python/handle.hpp> -# include <boost/python/has_back_reference.hpp> -# include <boost/python/implicit.hpp> -# include <boost/python/init.hpp> -# include <boost/python/import.hpp> -# include <boost/python/instance_holder.hpp> -# include <boost/python/iterator.hpp> -# include <boost/python/list.hpp> -# include <boost/python/long.hpp> -# include <boost/python/lvalue_from_pytype.hpp> -# include <boost/python/make_constructor.hpp> -# include <boost/python/make_function.hpp> -# include <boost/python/manage_new_object.hpp> -# include <boost/python/module.hpp> -# include <boost/python/object.hpp> -# include <boost/python/object_protocol.hpp> -# include <boost/python/object_protocol_core.hpp> -# include <boost/python/opaque_pointer_converter.hpp> -# include <boost/python/operators.hpp> -# include <boost/python/other.hpp> -# include <boost/python/overloads.hpp> -# include <boost/python/pointee.hpp> -# include <boost/python/pure_virtual.hpp> -# include <boost/python/ptr.hpp> -# include <boost/python/raw_function.hpp> -# include <boost/python/reference_existing_object.hpp> -# include <boost/python/register_ptr_to_python.hpp> -# include <boost/python/return_arg.hpp> -# include <boost/python/return_internal_reference.hpp> -# include <boost/python/return_opaque_pointer.hpp> -# include <boost/python/return_value_policy.hpp> -# include <boost/python/scope.hpp> -# include <boost/python/self.hpp> -# include <boost/python/slice.hpp> -# include <boost/python/slice_nil.hpp> -# include <boost/python/stl_iterator.hpp> -# include <boost/python/str.hpp> -# include <boost/python/to_python_converter.hpp> -# include <boost/python/to_python_indirect.hpp> -# include <boost/python/to_python_value.hpp> -# include <boost/python/tuple.hpp> -# include <boost/python/type_id.hpp> -# include <boost/python/with_custodian_and_ward.hpp> - -#endif // PYTHON_DWA2002810_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/bases.hpp b/contrib/restricted/boost/python/include/boost/python/bases.hpp deleted file mode 100644 index efcac3f3897..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/bases.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// 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 BASES_DWA2002321_HPP -# define BASES_DWA2002321_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/type_list.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/mpl/if.hpp> -# include <boost/mpl/bool.hpp> -# include <boost/preprocessor/enum_params_with_a_default.hpp> -# include <boost/preprocessor/enum_params.hpp> - -namespace boost { namespace python { - -# define BOOST_PYTHON_BASE_PARAMS BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, Base) - - // A type list for specifying bases - template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_MAX_BASES, typename Base, mpl::void_) > - struct bases : detail::type_list< BOOST_PYTHON_BASE_PARAMS >::type - {}; - - namespace detail - { - template <class T> struct specifies_bases - : mpl::false_ - { - }; - - template < BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, class Base) > - struct specifies_bases< bases< BOOST_PYTHON_BASE_PARAMS > > - : mpl::true_ - { - }; - template <class T, class Prev = bases<> > - struct select_bases - : mpl::if_< - specifies_bases<T> - , T - , Prev - > - { - }; - } -# undef BOOST_PYTHON_BASE_PARAMS -}} // namespace boost::python - -#endif // BASES_DWA2002321_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/call_method.hpp b/contrib/restricted/boost/python/include/boost/python/call_method.hpp deleted file mode 100644 index 424077eab42..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/call_method.hpp +++ /dev/null @@ -1,83 +0,0 @@ -#if !defined(BOOST_PP_IS_ITERATING) - -// 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 CALL_METHOD_DWA2002411_HPP -# define CALL_METHOD_DWA2002411_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/type.hpp> - -# include <boost/python/converter/arg_to_python.hpp> -# include <boost/python/converter/return_from_python.hpp> -# include <boost/python/detail/preprocessor.hpp> -# include <boost/python/detail/void_return.hpp> - -# include <boost/preprocessor/comma_if.hpp> -# include <boost/preprocessor/iterate.hpp> -# include <boost/preprocessor/repeat.hpp> -# include <boost/preprocessor/debug/line.hpp> -# include <boost/preprocessor/repetition/enum_trailing_params.hpp> -# include <boost/preprocessor/repetition/enum_binary_params.hpp> - -namespace boost { namespace python { - -# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ - , converter::arg_to_python<A##n>(a##n).get() - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/call_method.hpp>)) -# include BOOST_PP_ITERATE() - -# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET - -}} // namespace boost::python - -# endif // CALL_METHOD_DWA2002411_HPP - -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, call_method.hpp) -# endif - -# define N BOOST_PP_ITERATION() - -template < - class R - BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A) - > -typename detail::returnable<R>::type -call_method(PyObject* self, char const* name - BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a) - , boost::type<R>* = 0 - ) -{ - PyObject* const result = - PyEval_CallMethod( - self - , const_cast<char*>(name) - , const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) - ); - - // This conversion *must not* be done in the same expression as - // the call, because, in the special case where the result is a - // reference a Python object which was created by converting a C++ - // argument for passing to PyObject_CallFunction, its reference - // count will be 2 until the end of the full expression containing - // the conversion, and that interferes with dangling - // pointer/reference detection. - converter::return_from_python<R> converter; - return converter(result); -} - -# undef N - -#endif // BOOST_PP_ITERATION_DEPTH() -#endif // BOOST_PP_IS_ITERATING diff --git a/contrib/restricted/boost/python/include/boost/python/class.hpp b/contrib/restricted/boost/python/include/boost/python/class.hpp deleted file mode 100644 index 77f915ba0ae..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/class.hpp +++ /dev/null @@ -1,608 +0,0 @@ -// 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 CLASS_DWA200216_HPP -# define CLASS_DWA200216_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/noncopyable.hpp> - -# include <boost/python/class_fwd.hpp> -# include <boost/python/object/class.hpp> - -# include <boost/python/object.hpp> -# include <boost/python/type_id.hpp> -# include <boost/python/data_members.hpp> -# include <boost/python/make_function.hpp> -# include <boost/python/signature.hpp> -# include <boost/python/init.hpp> -# include <boost/python/args_fwd.hpp> - -# include <boost/python/object/class_metadata.hpp> -# include <boost/python/object/pickle_support.hpp> -# include <boost/python/object/add_to_namespace.hpp> - -# include <boost/python/detail/overloads_fwd.hpp> -# include <boost/python/detail/operator_id.hpp> -# include <boost/python/detail/def_helper.hpp> -# include <boost/python/detail/force_instantiate.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/python/detail/unwrap_type_id.hpp> -# include <boost/python/detail/unwrap_wrapper.hpp> - -# include <boost/mpl/size.hpp> -# include <boost/mpl/for_each.hpp> -# include <boost/mpl/bool.hpp> -# include <boost/mpl/not.hpp> - -# include <boost/detail/workaround.hpp> - -# if BOOST_WORKAROUND(__MWERKS__, <= 0x3004) \ - /* pro9 reintroduced the bug */ \ - || (BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) - -# define BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING 1 - -# endif - -# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING -# include <boost/mpl/and.hpp> -# endif - -namespace boost { namespace python { - -template <class DerivedVisitor> class def_visitor; - -enum no_init_t { no_init }; - -namespace detail -{ - // This function object is used with mpl::for_each to write the id - // of the type a pointer to which is passed as its 2nd compile-time - // argument. into the iterator pointed to by its runtime argument - struct write_type_id - { - write_type_id(type_info**p) : p(p) {} - - // Here's the runtime behavior - template <class T> - void operator()(T*) const - { - *(*p)++ = type_id<T>(); - } - - type_info** p; - }; - - template <class T> - struct is_data_member_pointer - : mpl::and_< - detail::is_member_pointer<T> - , mpl::not_<detail::is_member_function_pointer<T> > - > - {}; - -# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , detail::is_data_member_pointer<D>() -# define BOOST_PYTHON_YES_DATA_MEMBER , mpl::true_ -# define BOOST_PYTHON_NO_DATA_MEMBER , mpl::false_ -# elif defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , 0 -# define BOOST_PYTHON_YES_DATA_MEMBER , int -# define BOOST_PYTHON_NO_DATA_MEMBER , ... -# else -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) -# define BOOST_PYTHON_YES_DATA_MEMBER -# define BOOST_PYTHON_NO_DATA_MEMBER -# endif - - namespace error - { - // - // A meta-assertion mechanism which prints nice error messages and - // backtraces on lots of compilers. Usage: - // - // assertion<C>::failed - // - // where C is an MPL metafunction class - // - - template <class C> struct assertion_failed { }; - template <class C> struct assertion_ok { typedef C failed; }; - - template <class C> - struct assertion - : mpl::if_<C, assertion_ok<C>, assertion_failed<C> >::type - {}; - - // - // Checks for validity of arguments used to define virtual - // functions with default implementations. - // - - template <class Default> - void not_a_derived_class_member(Default) {} - - template <class T, class Fn> - struct virtual_function_default - { - template <class Default> - static void - must_be_derived_class_member(Default const&) - { - // https://svn.boost.org/trac/boost/ticket/5803 - //typedef typename assertion<mpl::not_<detail::is_same<Default,Fn> > >::failed test0; -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - typedef typename assertion<detail::is_polymorphic<T> >::failed test1 BOOST_ATTRIBUTE_UNUSED; -# endif - typedef typename assertion<detail::is_member_function_pointer<Fn> >::failed test2 BOOST_ATTRIBUTE_UNUSED; - not_a_derived_class_member<Default>(Fn()); - } - }; - } -} - -// This is the primary mechanism through which users will expose -// C++ classes to Python. -template < - class W // class being wrapped - , class X1 // = detail::not_specified - , class X2 // = detail::not_specified - , class X3 // = detail::not_specified - > -class class_ : public objects::class_base -{ - public: // types - typedef objects::class_base base; - typedef class_<W,X1,X2,X3> self; - typedef typename objects::class_metadata<W,X1,X2,X3> metadata; - typedef W wrapped_type; - - private: // types - - // A helper class which will contain an array of id objects to be - // passed to the base class constructor - struct id_vector - { - typedef typename metadata::bases bases; - - id_vector() - { - // Stick the derived class id into the first element of the array - ids[0] = detail::unwrap_type_id((W*)0, (W*)0); - - // Write the rest of the elements into succeeding positions. - type_info* p = ids + 1; - mpl::for_each(detail::write_type_id(&p), (bases*)0, (add_pointer<mpl::_>*)0); - } - - BOOST_STATIC_CONSTANT( - std::size_t, size = mpl::size<bases>::value + 1); - type_info ids[size]; - }; - friend struct id_vector; - - public: // constructors - - // Construct with the class name, with or without docstring, and default __init__() function - class_(char const* name, char const* doc = 0); - - // Construct with class name, no docstring, and an uncallable __init__ function - class_(char const* name, no_init_t); - - // Construct with class name, docstring, and an uncallable __init__ function - class_(char const* name, char const* doc, no_init_t); - - // Construct with class name and init<> function - template <class DerivedT> - inline class_(char const* name, init_base<DerivedT> const& i) - : base(name, id_vector::size, id_vector().ids) - { - this->initialize(i); - } - - // Construct with class name, docstring and init<> function - template <class DerivedT> - inline class_(char const* name, char const* doc, init_base<DerivedT> const& i) - : base(name, id_vector::size, id_vector().ids, doc) - { - this->initialize(i); - } - - public: // member functions - - // Generic visitation - template <class Derived> - self& def(def_visitor<Derived> const& visitor) - { - visitor.visit(*this); - return *this; - } - - // Wrap a member function or a non-member function which can take - // a T, T cv&, or T cv* as its first parameter, a callable - // python object, or a generic visitor. - template <class F> - self& def(char const* name, F f) - { - this->def_impl( - detail::unwrap_wrapper((W*)0) - , name, f, detail::def_helper<char const*>(0), &f); - return *this; - } - - template <class A1, class A2> - self& def(char const* name, A1 a1, A2 const& a2) - { - this->def_maybe_overloads(name, a1, a2, &a2); - return *this; - } - - template <class Fn, class A1, class A2> - self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2) - { - // The arguments are definitely: - // def(name, function, policy, doc_string) - // def(name, function, doc_string, policy) - - this->def_impl( - detail::unwrap_wrapper((W*)0) - , name, fn - , detail::def_helper<A1,A2>(a1,a2) - , &fn); - - return *this; - } - - template <class Fn, class A1, class A2, class A3> - self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2, A3 const& a3) - { - this->def_impl( - detail::unwrap_wrapper((W*)0) - , name, fn - , detail::def_helper<A1,A2,A3>(a1,a2,a3) - , &fn); - - return *this; - } - - // - // Data member access - // - template <class D> - self& def_readonly(char const* name, D const& d, char const* doc=0) - { - return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); - } - - template <class D> - self& def_readwrite(char const* name, D const& d, char const* doc=0) - { - return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); - } - - template <class D> - self& def_readonly(char const* name, D& d, char const* doc=0) - { - return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); - } - - template <class D> - self& def_readwrite(char const* name, D& d, char const* doc=0) - { - return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); - } - - // Property creation - template <class Get> - self& add_property(char const* name, Get fget, char const* docstr = 0) - { - base::add_property(name, this->make_getter(fget), docstr); - return *this; - } - - template <class Get, class Set> - self& add_property(char const* name, Get fget, Set fset, char const* docstr = 0) - { - base::add_property( - name, this->make_getter(fget), this->make_setter(fset), docstr); - return *this; - } - - template <class Get> - self& add_static_property(char const* name, Get fget) - { - base::add_static_property(name, object(fget)); - return *this; - } - - template <class Get, class Set> - self& add_static_property(char const* name, Get fget, Set fset) - { - base::add_static_property(name, object(fget), object(fset)); - return *this; - } - - template <class U> - self& setattr(char const* name, U const& x) - { - this->base::setattr(name, object(x)); - return *this; - } - - // Pickle support - template <typename PickleSuiteType> - self& def_pickle(PickleSuiteType const& x) - { - error_messages::must_be_derived_from_pickle_suite(x); - detail::pickle_suite_finalize<PickleSuiteType>::register_( - *this, - &PickleSuiteType::getinitargs, - &PickleSuiteType::getstate, - &PickleSuiteType::setstate, - PickleSuiteType::getstate_manages_dict()); - return *this; - } - - self& enable_pickling() - { - this->base::enable_pickling_(false); - return *this; - } - - self& staticmethod(char const* name) - { - this->make_method_static(name); - return *this; - } - private: // helper functions - - // Builds a method for this class around the given [member] - // function pointer or object, appropriately adjusting the type of - // the first signature argument so that if f is a member of a - // (possibly not wrapped) base class of T, an lvalue argument of - // type T will be required. - // - // @group PropertyHelpers { - template <class F> - object make_getter(F f) - { - typedef typename api::is_object_operators<F>::type is_obj_or_proxy; - - return this->make_fn_impl( - detail::unwrap_wrapper((W*)0) - , f, is_obj_or_proxy(), (char*)0, detail::is_data_member_pointer<F>() - ); - } - - template <class F> - object make_setter(F f) - { - typedef typename api::is_object_operators<F>::type is_obj_or_proxy; - - return this->make_fn_impl( - detail::unwrap_wrapper((W*)0) - , f, is_obj_or_proxy(), (int*)0, detail::is_data_member_pointer<F>() - ); - } - - template <class T, class F> - object make_fn_impl(T*, F const& f, mpl::false_, void*, mpl::false_) - { - return python::make_function(f, default_call_policies(), detail::get_signature(f, (T*)0)); - } - - template <class T, class D, class B> - object make_fn_impl(T*, D B::*pm_, mpl::false_, char*, mpl::true_) - { - D T::*pm = pm_; - return python::make_getter(pm); - } - - template <class T, class D, class B> - object make_fn_impl(T*, D B::*pm_, mpl::false_, int*, mpl::true_) - { - D T::*pm = pm_; - return python::make_setter(pm); - } - - template <class T, class F> - object make_fn_impl(T*, F const& x, mpl::true_, void*, mpl::false_) - { - return x; - } - // } - - template <class D, class B> - self& def_readonly_impl( - char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) - { - return this->add_property(name, pm_, doc); - } - - template <class D, class B> - self& def_readwrite_impl( - char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) - { - return this->add_property(name, pm_, pm_, doc); - } - - template <class D> - self& def_readonly_impl( - char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) - { - return this->add_static_property(name, python::make_getter(d)); - } - - template <class D> - self& def_readwrite_impl( - char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) - { - return this->add_static_property(name, python::make_getter(d), python::make_setter(d)); - } - - template <class DefVisitor> - inline void initialize(DefVisitor const& i) - { - metadata::register_(); // set up runtime metadata/conversions - - typedef typename metadata::holder holder; - this->set_instance_size( objects::additional_instance_size<holder>::value ); - - this->def(i); - } - - inline void initialize(no_init_t) - { - metadata::register_(); // set up runtime metadata/conversions - this->def_no_init(); - } - - // - // These two overloads discriminate between def() as applied to a - // generic visitor and everything else. - // - // @group def_impl { - template <class T, class Helper, class LeafVisitor, class Visitor> - inline void def_impl( - T* - , char const* name - , LeafVisitor - , Helper const& helper - , def_visitor<Visitor> const* v - ) - { - v->visit(*this, name, helper); - } - - template <class T, class Fn, class Helper> - inline void def_impl( - T* - , char const* name - , Fn fn - , Helper const& helper - , ... - ) - { - objects::add_to_namespace( - *this - , name - , make_function( - fn - , helper.policies() - , helper.keywords() - , detail::get_signature(fn, (T*)0) - ) - , helper.doc() - ); - - this->def_default(name, fn, helper, mpl::bool_<Helper::has_default_implementation>()); - } - // } - - // - // These two overloads handle the definition of default - // implementation overloads for virtual functions. The second one - // handles the case where no default implementation was specified. - // - // @group def_default { - template <class Fn, class Helper> - inline void def_default( - char const* name - , Fn - , Helper const& helper - , mpl::bool_<true>) - { - detail::error::virtual_function_default<W,Fn>::must_be_derived_class_member( - helper.default_implementation()); - - objects::add_to_namespace( - *this, name, - make_function( - helper.default_implementation(), helper.policies(), helper.keywords()) - ); - } - - template <class Fn, class Helper> - inline void def_default(char const*, Fn, Helper const&, mpl::bool_<false>) - { } - // } - - // - // These two overloads discriminate between def() as applied to - // regular functions and def() as applied to the result of - // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to - // discriminate. - // - // @group def_maybe_overloads { - template <class OverloadsT, class SigT> - void def_maybe_overloads( - char const* name - , SigT sig - , OverloadsT const& overloads - , detail::overloads_base const*) - - { - // convert sig to a type_list (see detail::get_signature in signature.hpp) - // before calling detail::define_with_defaults. - detail::define_with_defaults( - name, overloads, *this, detail::get_signature(sig)); - } - - template <class Fn, class A1> - void def_maybe_overloads( - char const* name - , Fn fn - , A1 const& a1 - , ...) - { - this->def_impl( - detail::unwrap_wrapper((W*)0) - , name - , fn - , detail::def_helper<A1>(a1) - , &fn - ); - - } - // } -}; - - -// -// implementations -// - -template <class W, class X1, class X2, class X3> -inline class_<W,X1,X2,X3>::class_(char const* name, char const* doc) - : base(name, id_vector::size, id_vector().ids, doc) -{ - this->initialize(init<>()); -// select_holder::assert_default_constructible(); -} - -template <class W, class X1, class X2, class X3> -inline class_<W,X1,X2,X3>::class_(char const* name, no_init_t) - : base(name, id_vector::size, id_vector().ids) -{ - this->initialize(no_init); -} - -template <class W, class X1, class X2, class X3> -inline class_<W,X1,X2,X3>::class_(char const* name, char const* doc, no_init_t) - : base(name, id_vector::size, id_vector().ids, doc) -{ - this->initialize(no_init); -} - -}} // namespace boost::python - -# undef BOOST_PYTHON_DATA_MEMBER_HELPER -# undef BOOST_PYTHON_YES_DATA_MEMBER -# undef BOOST_PYTHON_NO_DATA_MEMBER -# undef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING - -#endif // CLASS_DWA200216_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/class_fwd.hpp b/contrib/restricted/boost/python/include/boost/python/class_fwd.hpp deleted file mode 100644 index 528e18a1dc5..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/class_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// 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 CLASS_FWD_DWA200222_HPP -# define CLASS_FWD_DWA200222_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/not_specified.hpp> - -namespace boost { namespace python { - -template < - class T // class being wrapped - // arbitrarily-ordered optional arguments. Full qualification needed for MSVC6 - , class X1 = ::boost::python::detail::not_specified - , class X2 = ::boost::python::detail::not_specified - , class X3 = ::boost::python::detail::not_specified - > -class class_; - -}} // namespace boost::python - -#endif // CLASS_FWD_DWA200222_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/converter/as_to_python_function.hpp b/contrib/restricted/boost/python/include/boost/python/converter/as_to_python_function.hpp deleted file mode 100644 index 19a3efaafc6..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/converter/as_to_python_function.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// 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 AS_TO_PYTHON_FUNCTION_DWA2002121_HPP -# define AS_TO_PYTHON_FUNCTION_DWA2002121_HPP -# include <boost/python/converter/to_python_function_type.hpp> - -namespace boost { namespace python { namespace converter { - -// Given a typesafe to_python conversion function, produces a -// to_python_function_t which can be registered in the usual way. -template <class T, class ToPython> -struct as_to_python_function -{ - // Assertion functions used to prevent wrapping of converters - // which take non-const reference parameters. The T* argument in - // the first overload ensures it isn't used in case T is a - // reference. - template <class U> - static void convert_function_must_take_value_or_const_reference(U(*)(T), int, T* = 0) {} - template <class U> - static void convert_function_must_take_value_or_const_reference(U(*)(T const&), long ...) {} - - static PyObject* convert(void const* x) - { - convert_function_must_take_value_or_const_reference(&ToPython::convert, 1L); - - // Yes, the const_cast below opens a hole in const-correctness, - // but it's needed to convert auto_ptr<U> to python. - // - // How big a hole is it? It allows ToPython::convert() to be - // a function which modifies its argument. The upshot is that - // client converters applied to const objects may invoke - // undefined behavior. The damage, however, is limited by the - // use of the assertion function. Thus, the only way this can - // modify its argument is if T is an auto_ptr-like type. There - // is still a const-correctness hole w.r.t. auto_ptr<U> const, - // but c'est la vie. - return ToPython::convert(*const_cast<T*>(static_cast<T const*>(x))); - } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - static PyTypeObject const * get_pytype() { return ToPython::get_pytype(); } -#endif -}; - -}}} // namespace boost::python::converter - -#endif // AS_TO_PYTHON_FUNCTION_DWA2002121_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/converter/implicit.hpp b/contrib/restricted/boost/python/include/boost/python/converter/implicit.hpp deleted file mode 100644 index 8bbbfd5ac16..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/converter/implicit.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// 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 IMPLICIT_DWA2002326_HPP -# define IMPLICIT_DWA2002326_HPP - -# include <boost/python/converter/rvalue_from_python_data.hpp> -# include <boost/python/converter/registrations.hpp> -# include <boost/python/converter/registered.hpp> - -# include <boost/python/extract.hpp> - -namespace boost { namespace python { namespace converter { - -template <class Source, class Target> -struct implicit -{ - static void* convertible(PyObject* obj) - { - // Find a converter which can produce a Source instance from - // obj. The user has told us that Source can be converted to - // Target, and instantiating construct() below, ensures that - // at compile-time. - return implicit_rvalue_convertible_from_python(obj, registered<Source>::converters) - ? obj : 0; - } - - static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) - { - void* storage = ((rvalue_from_python_storage<Target>*)data)->storage.bytes; - - arg_from_python<Source> get_source(obj); - bool convertible = get_source.convertible(); - BOOST_VERIFY(convertible); - - new (storage) Target(get_source()); - - // record successful construction - data->convertible = storage; - } -}; - -}}} // namespace boost::python::converter - -#endif // IMPLICIT_DWA2002326_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/converter/shared_ptr_from_python.hpp b/contrib/restricted/boost/python/include/boost/python/converter/shared_ptr_from_python.hpp deleted file mode 100644 index b5c62ba9407..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/converter/shared_ptr_from_python.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright David Abrahams 2002. -// Copyright Stefan Seefeld 2016. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef boost_python_converter_shared_ptr_from_python_hpp_ -#define boost_python_converter_shared_ptr_from_python_hpp_ - -#include <boost/python/handle.hpp> -#include <boost/python/converter/shared_ptr_deleter.hpp> -#include <boost/python/converter/from_python.hpp> -#include <boost/python/converter/rvalue_from_python_data.hpp> -#include <boost/python/converter/registered.hpp> -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif -#include <boost/shared_ptr.hpp> -#include <memory> - -namespace boost { namespace python { namespace converter { - -template <class T, template <typename> class SP> -struct shared_ptr_from_python -{ - shared_ptr_from_python() - { - converter::registry::insert(&convertible, &construct, type_id<SP<T> >() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - , &converter::expected_from_python_type_direct<T>::get_pytype -#endif - ); - } - - private: - static void* convertible(PyObject* p) - { - if (p == Py_None) - return p; - - return converter::get_lvalue_from_python(p, registered<T>::converters); - } - - static void construct(PyObject* source, rvalue_from_python_stage1_data* data) - { - void* const storage = ((converter::rvalue_from_python_storage<SP<T> >*)data)->storage.bytes; - // Deal with the "None" case. - if (data->convertible == source) - new (storage) SP<T>(); - else - { - void *const storage = ((converter::rvalue_from_python_storage<SP<T> >*)data)->storage.bytes; - // Deal with the "None" case. - if (data->convertible == source) - new (storage) SP<T>(); - else - { - SP<void> hold_convertible_ref_count((void*)0, shared_ptr_deleter(handle<>(borrowed(source))) ); - // use aliasing constructor - new (storage) SP<T>(hold_convertible_ref_count, static_cast<T*>(data->convertible)); - } - } - data->convertible = storage; - } -}; - -}}} // namespace boost::python::converter - -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/copy_const_reference.hpp b/contrib/restricted/boost/python/include/boost/python/copy_const_reference.hpp deleted file mode 100644 index 55bede136f2..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/copy_const_reference.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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 COPY_CONST_REFERENCE_DWA2002131_HPP -# define COPY_CONST_REFERENCE_DWA2002131_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/mpl/if.hpp> -# include <boost/python/to_python_value.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class R> - struct copy_const_reference_expects_a_const_reference_return_type -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; -} - -template <class T> struct to_python_value; - -struct copy_const_reference -{ - template <class T> - struct apply - { - typedef typename mpl::if_c< - indirect_traits::is_reference_to_const<T>::value - , to_python_value<T> - , detail::copy_const_reference_expects_a_const_reference_return_type<T> - >::type type; - }; -}; - - -}} // namespace boost::python - -#endif // COPY_CONST_REFERENCE_DWA2002131_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/copy_non_const_reference.hpp b/contrib/restricted/boost/python/include/boost/python/copy_non_const_reference.hpp deleted file mode 100644 index 15fef62d67e..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/copy_non_const_reference.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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 COPY_NON_CONST_REFERENCE_DWA2002131_HPP -# define COPY_NON_CONST_REFERENCE_DWA2002131_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/mpl/if.hpp> -# include <boost/python/to_python_value.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class R> - struct copy_non_const_reference_expects_a_non_const_reference_return_type -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; -} - -template <class T> struct to_python_value; - -struct copy_non_const_reference -{ - template <class T> - struct apply - { - typedef typename mpl::if_c< - indirect_traits::is_reference_to_non_const<T>::value - , to_python_value<T> - , detail::copy_non_const_reference_expects_a_non_const_reference_return_type<T> - >::type type; - }; -}; - - -}} // namespace boost::python - -#endif // COPY_NON_CONST_REFERENCE_DWA2002131_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/data_members.hpp b/contrib/restricted/boost/python/include/boost/python/data_members.hpp deleted file mode 100644 index 989f7d7f934..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/data_members.hpp +++ /dev/null @@ -1,311 +0,0 @@ -// 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 DATA_MEMBERS_DWA2002328_HPP -# define DATA_MEMBERS_DWA2002328_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/handle.hpp> - -# include <boost/python/return_value_policy.hpp> -# include <boost/python/return_by_value.hpp> -# include <boost/python/return_internal_reference.hpp> -# include <boost/python/make_function.hpp> - -# include <boost/python/converter/builtin_converters.hpp> - -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/python/detail/not_specified.hpp> -# include <boost/python/detail/value_arg.hpp> -# include <boost/python/detail/type_traits.hpp> - -# include <boost/mpl/eval_if.hpp> -# include <boost/mpl/if.hpp> -# include <boost/mpl/vector/vector10.hpp> - -# include <boost/detail/workaround.hpp> - -namespace boost { namespace python { - -// -// This file defines the make_getter and make_setter function -// families, which are responsible for turning pointers, references, -// and pointers-to-data-members into callable Python objects which -// can be used for attribute access on wrapped classes. -// - -namespace detail -{ - - // A small function object which handles the getting and setting of - // data members. - template <class Data, class Class> - struct member - { - public: - member(Data Class::*which) : m_which(which) {} - - Data& operator()(Class& c) const - { - return c.*m_which; - } - - void operator()(Class& c, typename value_arg<Data>::type d) const - { - c.*m_which = d; - } - private: - Data Class::*m_which; - }; - - // A small function object which handles the getting and setting of - // non-member objects. - template <class Data> - struct datum - { - public: - datum(Data *which) : m_which(which) {} - - Data& operator()() const - { - return *m_which; - } - - void operator()(typename value_arg<Data>::type d) const - { - *m_which = d; - } - private: - Data *m_which; - }; - - // - // Helper metafunction for determining the default CallPolicy to use - // for attribute access. If T is a [reference to a] class type X - // whose conversion to python would normally produce a new copy of X - // in a wrapped X class instance (as opposed to types such as - // std::string, which are converted to native Python types, and - // smart pointer types which produce a wrapped class instance of the - // pointee type), to-python conversions will attempt to produce an - // object which refers to the original C++ object, rather than a - // copy. See default_member_getter_policy for rationale. - // - template <class T> - struct default_getter_by_ref - : mpl::and_< - mpl::bool_< - to_python_value< - typename value_arg<T>::type - >::uses_registry - > - , indirect_traits::is_reference_to_class< - typename value_arg<T>::type - > - > - { - }; - - // Metafunction computing the default CallPolicy to use for reading - // data members - // - // If it's a regular class type (not an object manager or other - // type for which we have to_python specializations, use - // return_internal_reference so that we can do things like - // x.y.z = 1 - // and get the right result. - template <class T> - struct default_member_getter_policy - : mpl::if_< - default_getter_by_ref<T> - , return_internal_reference<> - , return_value_policy<return_by_value> - > - {}; - - // Metafunction computing the default CallPolicy to use for reading - // non-member data. - template <class T> - struct default_datum_getter_policy - : mpl::if_< - default_getter_by_ref<T> - , return_value_policy<reference_existing_object> - , return_value_policy<return_by_value> - > - {}; - - // - // make_getter helper function family -- These helpers to - // boost::python::make_getter are used to dispatch behavior. The - // third argument is a workaround for a CWPro8 partial ordering bug - // with pointers to data members. It should be convertible to - // detail::true_ iff the first argument is a pointer-to-member, and - // detail::false_ otherwise. The fourth argument is for compilers - // which don't support partial ordering at all and should always be - // passed 0L. - - -#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - template <class D, class P> - inline object make_getter(D& d, P& p, detail::false_, ...); -#endif - - // Handle non-member pointers with policies - template <class D, class Policies> - inline object make_getter(D* d, Policies const& policies, detail::false_, int) - { - return python::make_function( - detail::datum<D>(d), policies, mpl::vector1<D&>() - ); - } - - // Handle non-member pointers without policies - template <class D> - inline object make_getter(D* d, not_specified, detail::false_, long) - { - typedef typename default_datum_getter_policy<D>::type policies; - return detail::make_getter(d, policies(), detail::false_(), 0); - } - - // Handle pointers-to-members with policies - template <class C, class D, class Policies> - inline object make_getter(D C::*pm, Policies const& policies, detail::true_, int) - { -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) - typedef typename detail::remove_cv<C>::type Class; -#else - typedef C Class; -#endif - return python::make_function( - detail::member<D,Class>(pm) - , policies - , mpl::vector2<D&,Class&>() - ); - } - - // Handle pointers-to-members without policies - template <class C, class D> - inline object make_getter(D C::*pm, not_specified, detail::true_, long) - { - typedef typename default_member_getter_policy<D>::type policies; - return detail::make_getter(pm, policies(), detail::true_(), 0); - } - - // Handle references - template <class D, class P> - inline object make_getter(D& d, P& p, detail::false_, ...) - { - // Just dispatch to the handler for pointer types. - return detail::make_getter(&d, p, detail::false_(), 0L); - } - - // - // make_setter helper function family -- These helpers to - // boost::python::make_setter are used to dispatch behavior. The - // third argument is for compilers which don't support partial - // ordering at all and should always be passed 0. - // - - - // Handle non-member pointers - template <class D, class Policies> - inline object make_setter(D* p, Policies const& policies, detail::false_, int) - { - return python::make_function( - detail::datum<D>(p), policies, mpl::vector2<void,D const&>() - ); - } - - // Handle pointers-to-members - template <class C, class D, class Policies> - inline object make_setter(D C::*pm, Policies const& policies, detail::true_, int) - { - return python::make_function( - detail::member<D,C>(pm) - , policies - , mpl::vector3<void, C&, D const&>() - ); - } - - // Handle references - template <class D, class Policies> - inline object make_setter(D& x, Policies const& policies, detail::false_, ...) - { - return detail::make_setter(&x, policies, detail::false_(), 0L); - } -} - -// -// make_getter function family -- build a callable object which -// retrieves data through the first argument and is appropriate for -// use as the `get' function in Python properties . The second, -// policies argument, is optional. We need both D& and D const& -// overloads in order be able to handle rvalues. -// -template <class D, class Policies> -inline object make_getter(D& d, Policies const& policies) -{ - return detail::make_getter(d, policies, detail::is_member_pointer<D>(), 0L); -} - -template <class D, class Policies> -inline object make_getter(D const& d, Policies const& policies) -{ - return detail::make_getter(d, policies, detail::is_member_pointer<D>(), 0L); -} - -template <class D> -inline object make_getter(D& x) -{ - detail::not_specified policy - = detail::not_specified(); // suppress a SunPro warning - return detail::make_getter(x, policy, detail::is_member_pointer<D>(), 0L); -} - -# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) -template <class D> -inline object make_getter(D const& d) -{ - detail::not_specified policy - = detail::not_specified(); // Suppress a SunPro warning - return detail::make_getter(d, policy, detail::is_member_pointer<D>(), 0L); -} -# endif - -// -// make_setter function family -- build a callable object which -// writes data through the first argument and is appropriate for -// use as the `set' function in Python properties . The second, -// policies argument, is optional. We need both D& and D const& -// overloads in order be able to handle rvalues. -// -template <class D, class Policies> -inline object make_setter(D& x, Policies const& policies) -{ - return detail::make_setter(x, policies, detail::is_member_pointer<D>(), 0); -} - -template <class D, class Policies> -inline object make_setter(D const& x, Policies const& policies) -{ - return detail::make_setter(x, policies, detail::is_member_pointer<D>(), 0); -} - -template <class D> -inline object make_setter(D& x) -{ - return detail::make_setter(x, default_call_policies(), detail::is_member_pointer<D>(), 0); -} - -# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) -template <class D> -inline object make_setter(D const& x) -{ - return detail::make_setter(x, default_call_policies(), detail::is_member_pointer<D>(), 0); -} -# endif - -}} // namespace boost::python - -#endif // DATA_MEMBERS_DWA2002328_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/def.hpp b/contrib/restricted/boost/python/include/boost/python/def.hpp deleted file mode 100644 index fe2c65f938a..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/def.hpp +++ /dev/null @@ -1,114 +0,0 @@ -// 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 DEF_DWA200292_HPP -# define DEF_DWA200292_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/object_fwd.hpp> -# include <boost/python/make_function.hpp> -# include <boost/python/detail/def_helper.hpp> -# include <boost/python/detail/overloads_fwd.hpp> -# include <boost/python/scope.hpp> -# include <boost/python/signature.hpp> -# include <boost/python/detail/scope.hpp> - -namespace boost { namespace python { - -namespace detail -{ - namespace error - { - // Compile-time error messages - template <bool> struct multiple_functions_passed_to_def; - template <> struct multiple_functions_passed_to_def<false> { typedef char type; }; - } - - // - // def_from_helper -- - // - // Use a def_helper to define a regular wrapped function in the current scope. - template <class F, class Helper> - void def_from_helper( - char const* name, F const& fn, Helper const& helper) - { - // Must not try to use default implementations except with method definitions. - typedef typename error::multiple_functions_passed_to_def< - Helper::has_default_implementation - >::type assertion BOOST_ATTRIBUTE_UNUSED; - - detail::scope_setattr_doc( - name, boost::python::make_function( - fn - , helper.policies() - , helper.keywords()) - , helper.doc() - ); - } - - // - // These two overloads discriminate between def() as applied to - // regular functions and def() as applied to the result of - // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to - // discriminate. - // - template <class Fn, class A1> - void - def_maybe_overloads( - char const* name - , Fn fn - , A1 const& a1 - , ...) - { - detail::def_from_helper(name, fn, def_helper<A1>(a1)); - } - - template <class StubsT, class SigT> - void def_maybe_overloads( - char const* name - , SigT sig - , StubsT const& stubs - , detail::overloads_base const*) - { - scope current; - - detail::define_with_defaults( - name, stubs, current, detail::get_signature(sig)); - } - - template <class T> - object make_function1(T fn, ...) { return make_function(fn); } - - inline - object make_function1(object const& x, object const*) { return x; } -} - -template <class Fn> -void def(char const* name, Fn fn) -{ - detail::scope_setattr_doc(name, detail::make_function1(fn, &fn), 0); -} - -template <class Arg1T, class Arg2T> -void def(char const* name, Arg1T arg1, Arg2T const& arg2) -{ - detail::def_maybe_overloads(name, arg1, arg2, &arg2); -} - -template <class F, class A1, class A2> -void def(char const* name, F f, A1 const& a1, A2 const& a2) -{ - detail::def_from_helper(name, f, detail::def_helper<A1,A2>(a1,a2)); -} - -template <class F, class A1, class A2, class A3> -void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3) -{ - detail::def_from_helper(name, f, detail::def_helper<A1,A2,A3>(a1,a2,a3)); -} - -}} // namespace boost::python - -#endif // DEF_DWA200292_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/dealloc.hpp b/contrib/restricted/boost/python/include/boost/python/detail/dealloc.hpp deleted file mode 100644 index ce07926ee12..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/dealloc.hpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright Gottfried Ganßauge 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -# ifndef BOOST_PYTHON_DETAIL_DEALLOC_HPP_ -# define BOOST_PYTHON_DETAIL_DEALLOC_HPP_ -namespace boost { namespace python { namespace detail { - extern "C" - { - inline void dealloc(PyObject* self) - { - PyObject_Del(self); - } - } -}}} // namespace boost::python::detail -# endif // BOOST_PYTHON_DETAIL_DEALLOC_HPP_ diff --git a/contrib/restricted/boost/python/include/boost/python/detail/def_helper.hpp b/contrib/restricted/boost/python/include/boost/python/detail/def_helper.hpp deleted file mode 100644 index 24f9c5cdb21..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/def_helper.hpp +++ /dev/null @@ -1,211 +0,0 @@ -// 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 DEF_HELPER_DWA200287_HPP -# define DEF_HELPER_DWA200287_HPP - -# include <boost/python/args.hpp> -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/mpl/not.hpp> -# include <boost/mpl/and.hpp> -# include <boost/mpl/or.hpp> -# include <boost/mpl/lambda.hpp> -# include <boost/mpl/apply.hpp> -# include <boost/tuple/tuple.hpp> -# include <boost/python/detail/not_specified.hpp> -# include <boost/python/detail/def_helper_fwd.hpp> - -namespace boost { namespace python { - -struct default_call_policies; - -namespace detail -{ - // tuple_extract<Tuple,Predicate>::extract(t) returns the first - // element of a Tuple whose type E satisfies the given Predicate - // applied to add_reference<E>. The Predicate must be an MPL - // metafunction class. - template <class Tuple, class Predicate> - struct tuple_extract; - - // Implementation class for when the tuple's head type does not - // satisfy the Predicate - template <bool matched> - struct tuple_extract_impl - { - template <class Tuple, class Predicate> - struct apply - { - typedef typename Tuple::head_type result_type; - - static typename Tuple::head_type extract(Tuple const& x) - { - return x.get_head(); - } - }; - }; - - // Implementation specialization for when the tuple's head type - // satisfies the predicate - template <> - struct tuple_extract_impl<false> - { - template <class Tuple, class Predicate> - struct apply - { - // recursive application of tuple_extract on the tail of the tuple - typedef tuple_extract<typename Tuple::tail_type, Predicate> next; - typedef typename next::result_type result_type; - - static result_type extract(Tuple const& x) - { - return next::extract(x.get_tail()); - } - }; - }; - - // A metafunction which selects a version of tuple_extract_impl to - // use for the implementation of tuple_extract - template <class Tuple, class Predicate> - struct tuple_extract_base_select - { - typedef typename Tuple::head_type head_type; - typedef typename mpl::apply1<Predicate, - typename add_lvalue_reference<head_type>::type>::type match_t; - BOOST_STATIC_CONSTANT(bool, match = match_t::value); - typedef typename tuple_extract_impl<match>::template apply<Tuple,Predicate> type; - }; - - template <class Tuple, class Predicate> - struct tuple_extract - : tuple_extract_base_select< - Tuple - , typename mpl::lambda<Predicate>::type - >::type - { - }; - - - // - // Specialized extractors for the docstring, keywords, CallPolicies, - // and default implementation of virtual functions - // - - template <class Tuple> - struct doc_extract - : tuple_extract< - Tuple - , mpl::not_< - mpl::or_< - indirect_traits::is_reference_to_class<mpl::_1> - , indirect_traits::is_reference_to_member_function_pointer<mpl::_1 > - > - > - > - { - }; - - template <class Tuple> - struct keyword_extract - : tuple_extract<Tuple, is_reference_to_keywords<mpl::_1 > > - { - }; - - template <class Tuple> - struct policy_extract - : tuple_extract< - Tuple - , mpl::and_< - mpl::not_<is_same<not_specified const&,mpl::_1> > - , indirect_traits::is_reference_to_class<mpl::_1 > - , mpl::not_<is_reference_to_keywords<mpl::_1 > > - > - > - { - }; - - template <class Tuple> - struct default_implementation_extract - : tuple_extract< - Tuple - , indirect_traits::is_reference_to_member_function_pointer<mpl::_1 > - > - { - }; - - // - // A helper class for decoding the optional arguments to def() - // invocations, which can be supplied in any order and are - // discriminated by their type properties. The template parameters - // are expected to be the types of the actual (optional) arguments - // passed to def(). - // - template <class T1, class T2, class T3, class T4> - struct def_helper - { - // A tuple type which begins with references to the supplied - // arguments and ends with actual representatives of the default - // types. - typedef boost::tuples::tuple< - T1 const& - , T2 const& - , T3 const& - , T4 const& - , default_call_policies - , detail::keywords<0> - , char const* - , void(not_specified::*)() // A function pointer type which is never an - // appropriate default implementation - > all_t; - - // Constructors; these initialize an member of the tuple type - // shown above. - def_helper(T1 const& a1) : m_all(a1,m_nil,m_nil,m_nil) {} - def_helper(T1 const& a1, T2 const& a2) : m_all(a1,a2,m_nil,m_nil) {} - def_helper(T1 const& a1, T2 const& a2, T3 const& a3) : m_all(a1,a2,a3,m_nil) {} - def_helper(T1 const& a1, T2 const& a2, T3 const& a3, T4 const& a4) : m_all(a1,a2,a3,a4) {} - - private: // types - typedef typename default_implementation_extract<all_t>::result_type default_implementation_t; - - public: // Constants which can be used for static assertions. - - // Users must not supply a default implementation for non-class - // methods. - BOOST_STATIC_CONSTANT( - bool, has_default_implementation = ( - !is_same<default_implementation_t, void(not_specified::*)()>::value)); - - public: // Extractor functions which pull the appropriate value out - // of the tuple - char const* doc() const - { - return doc_extract<all_t>::extract(m_all); - } - - typename keyword_extract<all_t>::result_type keywords() const - { - return keyword_extract<all_t>::extract(m_all); - } - - typename policy_extract<all_t>::result_type policies() const - { - return policy_extract<all_t>::extract(m_all); - } - - default_implementation_t default_implementation() const - { - return default_implementation_extract<all_t>::extract(m_all); - } - - private: // data members - all_t m_all; - not_specified m_nil; // for filling in not_specified slots - }; -} - -}} // namespace boost::python::detail - -#endif // DEF_HELPER_DWA200287_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/defaults_def.hpp b/contrib/restricted/boost/python/include/boost/python/detail/defaults_def.hpp deleted file mode 100644 index 607775842b9..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/defaults_def.hpp +++ /dev/null @@ -1,291 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Copyright David Abrahams 2002, Joel de Guzman, 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) -// -/////////////////////////////////////////////////////////////////////////////// -#if !defined(BOOST_PP_IS_ITERATING) - -#ifndef DEFAULTS_DEF_JDG20020811_HPP -#define DEFAULTS_DEF_JDG20020811_HPP - -#include <boost/python/detail/defaults_gen.hpp> -#include <boost/python/detail/type_traits.hpp> -#include <boost/mpl/front.hpp> -#include <boost/mpl/size.hpp> -#include <boost/static_assert.hpp> -#include <boost/preprocessor/iterate.hpp> -#include <boost/python/class_fwd.hpp> -#include <boost/python/scope.hpp> -#include <boost/preprocessor/debug/line.hpp> -#include <boost/python/detail/scope.hpp> -#include <boost/python/detail/make_keyword_range_fn.hpp> -#include <boost/python/object/add_to_namespace.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace python { - -struct module; - -namespace objects -{ - struct class_base; -} - -namespace detail -{ - // Called as:: - // - // name_space_def(ns, "func", func, kw, policies, docstring, &ns) - // - // Dispatch to properly add f to namespace ns. - // - // @group define_stub_function helpers { - template <class Func, class CallPolicies, class NameSpaceT> - static void name_space_def( - NameSpaceT& name_space - , char const* name - , Func f - , keyword_range const& kw - , CallPolicies const& policies - , char const* doc - , objects::class_base* - ) - { - typedef typename NameSpaceT::wrapped_type wrapped_type; - - objects::add_to_namespace( - name_space, name, - detail::make_keyword_range_function( - f, policies, kw, get_signature(f, (wrapped_type*)0)) - , doc - ); - } - - template <class Func, class CallPolicies> - static void name_space_def( - object& name_space - , char const* name - , Func f - , keyword_range const& kw - , CallPolicies const& policies - , char const* doc - , ... - ) - { - scope within(name_space); - - detail::scope_setattr_doc( - name - , detail::make_keyword_range_function(f, policies, kw) - , doc); - } - - // For backward compatibility -- is this obsolete? - template <class Func, class CallPolicies, class NameSpaceT> - static void name_space_def( - NameSpaceT& name_space - , char const* name - , Func f - , keyword_range const& /* kw */ // ignored - , CallPolicies const& policies - , char const* doc - , module* - ) - { - name_space.def(name, f, policies, doc); - } - // } - - - // Expansions of :: - // - // template <typename OverloadsT, typename NameSpaceT> - // inline void - // define_stub_function( - // char const* name, OverloadsT s, NameSpaceT& name_space, mpl::int_<N>) - // { - // name_space.def(name, &OverloadsT::func_N); - // } - // - // where N runs from 0 to BOOST_PYTHON_MAX_ARITY. - // - // The set of overloaded functions (define_stub_function) expects: - // - // 1. char const* name: function name that will be visible to python - // 2. OverloadsT: a function overloads struct (see defaults_gen.hpp) - // 3. NameSpaceT& name_space: a python::class_ or python::module instance - // 4. int_t<N>: the Nth overloaded function (OverloadsT::func_N) - // (see defaults_gen.hpp) - // 5. char const* name: doc string - // - // @group define_stub_function<N> { - template <int N> - struct define_stub_function {}; - -#define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/defaults_def.hpp>)) - -#include BOOST_PP_ITERATE() - - // } - - // This helper template struct does the actual recursive - // definition. There's a generic version - // define_with_defaults_helper<N> and a terminal case - // define_with_defaults_helper<0>. The struct and its - // specialization has a sole static member function def that - // expects: - // - // 1. char const* name: function name that will be - // visible to python - // - // 2. OverloadsT: a function overloads struct - // (see defaults_gen.hpp) - // - // 3. NameSpaceT& name_space: a python::class_ or - // python::module instance - // - // 4. char const* name: doc string - // - // The def static member function calls a corresponding - // define_stub_function<N>. The general case recursively calls - // define_with_defaults_helper<N-1>::def until it reaches the - // terminal case case define_with_defaults_helper<0>. - template <int N> - struct define_with_defaults_helper { - - template <class StubsT, class CallPolicies, class NameSpaceT> - static void - def( - char const* name, - StubsT stubs, - keyword_range kw, - CallPolicies const& policies, - NameSpaceT& name_space, - char const* doc) - { - // define the NTH stub function of stubs - define_stub_function<N>::define(name, stubs, kw, policies, name_space, doc); - - if (kw.second > kw.first) - --kw.second; - - // call the next define_with_defaults_helper - define_with_defaults_helper<N-1>::def(name, stubs, kw, policies, name_space, doc); - } - }; - - template <> - struct define_with_defaults_helper<0> { - - template <class StubsT, class CallPolicies, class NameSpaceT> - static void - def( - char const* name, - StubsT stubs, - keyword_range const& kw, - CallPolicies const& policies, - NameSpaceT& name_space, - char const* doc) - { - // define the Oth stub function of stubs - define_stub_function<0>::define(name, stubs, kw, policies, name_space, doc); - // return - } - }; - - // define_with_defaults - // - // 1. char const* name: function name that will be - // visible to python - // - // 2. OverloadsT: a function overloads struct - // (see defaults_gen.hpp) - // - // 3. CallPolicies& policies: Call policies - // 4. NameSpaceT& name_space: a python::class_ or - // python::module instance - // - // 5. SigT sig: Function signature typelist - // (see defaults_gen.hpp) - // - // 6. char const* name: doc string - // - // This is the main entry point. This function recursively - // defines all stub functions of StubT (see defaults_gen.hpp) in - // NameSpaceT name_space which can be either a python::class_ or - // a python::module. The sig argument is a typelist that - // specifies the return type, the class (for member functions, - // and the arguments. Here are some SigT examples: - // - // int foo(int) mpl::vector<int, int> - // void bar(int, int) mpl::vector<void, int, int> - // void C::foo(int) mpl::vector<void, C, int> - // - template <class OverloadsT, class NameSpaceT, class SigT> - inline void - define_with_defaults( - char const* name, - OverloadsT const& overloads, - NameSpaceT& name_space, - SigT const&) - { - typedef typename mpl::front<SigT>::type return_type; - typedef typename OverloadsT::void_return_type void_return_type; - typedef typename OverloadsT::non_void_return_type non_void_return_type; - - typedef typename mpl::if_c< - is_same<void, return_type>::value - , void_return_type - , non_void_return_type - >::type stubs_type; - - BOOST_STATIC_ASSERT( - (stubs_type::max_args) <= mpl::size<SigT>::value); - - typedef typename stubs_type::template gen<SigT> gen_type; - define_with_defaults_helper<stubs_type::n_funcs-1>::def( - name - , gen_type() - , overloads.keywords() - , overloads.call_policies() - , name_space - , overloads.doc_string()); - } - -} // namespace detail - -}} // namespace boost::python - -#endif // DEFAULTS_DEF_JDG20020811_HPP - -#else // defined(BOOST_PP_IS_ITERATING) -// PP vertical iteration code - - -template <> -struct define_stub_function<BOOST_PP_ITERATION()> { - template <class StubsT, class CallPolicies, class NameSpaceT> - static void define( - char const* name - , StubsT const& - , keyword_range const& kw - , CallPolicies const& policies - , NameSpaceT& name_space - , char const* doc) - { - detail::name_space_def( - name_space - , name - , &StubsT::BOOST_PP_CAT(func_, BOOST_PP_ITERATION()) - , kw - , policies - , doc - , &name_space); - } -}; - -#endif // !defined(BOOST_PP_IS_ITERATING) diff --git a/contrib/restricted/boost/python/include/boost/python/detail/defaults_gen.hpp b/contrib/restricted/boost/python/include/boost/python/detail/defaults_gen.hpp deleted file mode 100644 index 88beeedb024..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/defaults_gen.hpp +++ /dev/null @@ -1,388 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Copyright David Abrahams 2002, Joel de Guzman, 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 DEFAULTS_GEN_JDG20020807_HPP -#define DEFAULTS_GEN_JDG20020807_HPP - -#include <boost/python/detail/preprocessor.hpp> -#include <boost/preprocessor/repeat.hpp> -#include <boost/preprocessor/repeat_from_to.hpp> -#include <boost/preprocessor/enum.hpp> -#include <boost/preprocessor/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_binary_params.hpp> -#include <boost/preprocessor/tuple.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/arithmetic/sub.hpp> -#include <boost/preprocessor/stringize.hpp> -#include <boost/preprocessor/inc.hpp> -#include <boost/preprocessor/empty.hpp> -#include <boost/preprocessor/comma_if.hpp> -#include <boost/config.hpp> -#include <boost/mpl/begin_end.hpp> -#include <boost/mpl/next.hpp> -#include <boost/mpl/deref.hpp> -#include <cstddef> - -namespace boost { namespace python { - -namespace detail -{ - // overloads_base is used as a base class for all function - // stubs. This class holds the doc_string of the stubs. - struct overloads_base - { - overloads_base(char const* doc_) - : m_doc(doc_) {} - - overloads_base(char const* doc_, detail::keyword_range const& kw) - : m_doc(doc_), m_keywords(kw) {} - - char const* doc_string() const - { - return m_doc; - } - - detail::keyword_range const& keywords() const - { - return m_keywords; - } - - private: - char const* m_doc; - detail::keyword_range m_keywords; - }; - - // overloads_proxy is generated by the overloads_common operator[] (see - // below). This class holds a user defined call policies of the stubs. - template <class CallPoliciesT, class OverloadsT> - struct overloads_proxy - : public overloads_base - { - typedef typename OverloadsT::non_void_return_type non_void_return_type; - typedef typename OverloadsT::void_return_type void_return_type; - - overloads_proxy( - CallPoliciesT const& policies_ - , char const* doc - , keyword_range const& kw - ) - : overloads_base(doc, kw) - , policies(policies_) - {} - - CallPoliciesT - call_policies() const - { - return policies; - } - - CallPoliciesT policies; - }; - - // overloads_common is our default function stubs base class. This - // class returns the default_call_policies in its call_policies() - // member function. It can generate a overloads_proxy however through - // its operator[] - template <class DerivedT> - struct overloads_common - : public overloads_base - { - overloads_common(char const* doc) - : overloads_base(doc) {} - - overloads_common(char const* doc, keyword_range const& kw) - : overloads_base(doc, kw) {} - - default_call_policies - call_policies() const - { - return default_call_policies(); - } - - template <class CallPoliciesT> - overloads_proxy<CallPoliciesT, DerivedT> - operator[](CallPoliciesT const& policies) const - { - return overloads_proxy<CallPoliciesT, DerivedT>( - policies, this->doc_string(), this->keywords()); - } - }; - -}}} // namespace boost::python::detail - - -#define BOOST_PYTHON_TYPEDEF_GEN(z, index, data) \ - typedef typename ::boost::mpl::next<BOOST_PP_CAT(iter, index)>::type \ - BOOST_PP_CAT(iter, BOOST_PP_INC(index)); \ - typedef typename ::boost::mpl::deref<BOOST_PP_CAT(iter, index)>::type \ - BOOST_PP_CAT(T, index); - -#define BOOST_PYTHON_FUNC_WRAPPER_GEN(z, index, data) \ - static RT BOOST_PP_CAT(func_, \ - BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ - BOOST_PP_ENUM_BINARY_PARAMS_Z( \ - 1, index, T, arg)) \ - { \ - BOOST_PP_TUPLE_ELEM(3, 2, data) \ - BOOST_PP_TUPLE_ELEM(3, 0, data)( \ - BOOST_PP_ENUM_PARAMS( \ - index, \ - arg)); \ - } - -#define BOOST_PYTHON_GEN_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ - struct fstubs_name \ - { \ - BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ - BOOST_STATIC_CONSTANT(int, max_args = n_funcs); \ - \ - template <typename SigT> \ - struct gen \ - { \ - typedef typename ::boost::mpl::begin<SigT>::type rt_iter; \ - typedef typename ::boost::mpl::deref<rt_iter>::type RT; \ - typedef typename ::boost::mpl::next<rt_iter>::type iter0; \ - \ - BOOST_PP_REPEAT_2ND( \ - n_args, \ - BOOST_PYTHON_TYPEDEF_GEN, \ - 0) \ - \ - BOOST_PP_REPEAT_FROM_TO_2( \ - BOOST_PP_SUB_D(1, n_args, n_dflts), \ - BOOST_PP_INC(n_args), \ - BOOST_PYTHON_FUNC_WRAPPER_GEN, \ - (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ - }; \ - }; \ - -/////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN(z, index, data) \ - static RT BOOST_PP_CAT(func_, \ - BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ - ClassT obj BOOST_PP_COMMA_IF(index) \ - BOOST_PP_ENUM_BINARY_PARAMS_Z(1, index, T, arg) \ - ) \ - { \ - BOOST_PP_TUPLE_ELEM(3, 2, data) obj.BOOST_PP_TUPLE_ELEM(3, 0, data)( \ - BOOST_PP_ENUM_PARAMS(index, arg) \ - ); \ - } - -#define BOOST_PYTHON_GEN_MEM_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ - struct fstubs_name \ - { \ - BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ - BOOST_STATIC_CONSTANT(int, max_args = n_funcs + 1); \ - \ - template <typename SigT> \ - struct gen \ - { \ - typedef typename ::boost::mpl::begin<SigT>::type rt_iter; \ - typedef typename ::boost::mpl::deref<rt_iter>::type RT; \ - \ - typedef typename ::boost::mpl::next<rt_iter>::type class_iter; \ - typedef typename ::boost::mpl::deref<class_iter>::type ClassT; \ - typedef typename ::boost::mpl::next<class_iter>::type iter0; \ - \ - BOOST_PP_REPEAT_2ND( \ - n_args, \ - BOOST_PYTHON_TYPEDEF_GEN, \ - 0) \ - \ - BOOST_PP_REPEAT_FROM_TO_2( \ - BOOST_PP_SUB_D(1, n_args, n_dflts), \ - BOOST_PP_INC(n_args), \ - BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN, \ - (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ - }; \ - }; - -#define BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ - fstubs_name(char const* doc = 0) \ - : ::boost::python::detail::overloads_common<fstubs_name>(doc) {} \ - template <std::size_t N> \ - fstubs_name(char const* doc, ::boost::python::detail::keywords<N> const& keywords) \ - : ::boost::python::detail::overloads_common<fstubs_name>( \ - doc, keywords.range()) \ - { \ - typedef typename ::boost::python::detail:: \ - error::more_keywords_than_function_arguments< \ - N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ - } \ - template <std::size_t N> \ - fstubs_name(::boost::python::detail::keywords<N> const& keywords, char const* doc = 0) \ - : ::boost::python::detail::overloads_common<fstubs_name>( \ - doc, keywords.range()) \ - { \ - typedef typename ::boost::python::detail:: \ - error::more_keywords_than_function_arguments< \ - N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ - } - -# if defined(BOOST_NO_VOID_RETURNS) - -# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ - struct fstubs_name \ - : public ::boost::python::detail::overloads_common<fstubs_name> \ - { \ - BOOST_PYTHON_GEN_FUNCTION( \ - fname, non_void_return_type, n_args, n_dflts, return) \ - BOOST_PYTHON_GEN_FUNCTION( \ - fname, void_return_type, n_args, n_dflts, ;) \ - \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ - }; - -# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ - struct fstubs_name \ - : public ::boost::python::detail::overloads_common<fstubs_name> \ - { \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ - fname, non_void_return_type, n_args, n_dflts, return) \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ - fname, void_return_type, n_args, n_dflts, ;) \ - \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ - }; - -# else // !defined(BOOST_NO_VOID_RETURNS) - -# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ - struct fstubs_name \ - : public ::boost::python::detail::overloads_common<fstubs_name> \ - { \ - BOOST_PYTHON_GEN_FUNCTION( \ - fname, non_void_return_type, n_args, n_dflts, return) \ - \ - typedef non_void_return_type void_return_type; \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ - }; - - -# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ - struct fstubs_name \ - : public ::boost::python::detail::overloads_common<fstubs_name> \ - { \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ - fname, non_void_return_type, n_args, n_dflts, return) \ - \ - typedef non_void_return_type void_return_type; \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ - }; - -# endif // !defined(BOOST_NO_VOID_RETURNS) - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN MACROS -// -// Given generator_name, fname, min_args and max_args, These macros -// generate function stubs that forward to a function or member function -// named fname. max_args is the arity of the function or member function -// fname. fname can have default arguments. min_args is the minimum -// arity that fname can accept. -// -// There are two versions: -// -// 1. BOOST_PYTHON_FUNCTION_OVERLOADS for free functions -// 2. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS for member functions. -// -// For instance, given a function: -// -// int -// foo(int a, char b = 1, unsigned c = 2, double d = 3) -// { -// return a + b + c + int(d); -// } -// -// The macro invocation: -// -// BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) -// -// Generates this code: -// -// struct foo_stubsNonVoid -// { -// static const int n_funcs = 4; -// static const int max_args = n_funcs; -// -// template <typename SigT> -// struct gen -// { -// typedef typename ::boost::mpl::begin<SigT>::type rt_iter; -// typedef typename rt_iter::type RT; -// typedef typename rt_iter::next iter0; -// typedef typename iter0::type T0; -// typedef typename iter0::next iter1; -// typedef typename iter1::type T1; -// typedef typename iter1::next iter2; -// typedef typename iter2::type T2; -// typedef typename iter2::next iter3; -// typedef typename iter3::type T3; -// typedef typename iter3::next iter4; -// -// static RT func_0(T0 arg0) -// { return foo(arg0); } -// -// static RT func_1(T0 arg0, T1 arg1) -// { return foo(arg0, arg1); } -// -// static RT func_2(T0 arg0, T1 arg1, T2 arg2) -// { return foo(arg0, arg1, arg2); } -// -// static RT func_3(T0 arg0, T1 arg1, T2 arg2, T3 arg3) -// { return foo(arg0, arg1, arg2, arg3); } -// }; -// }; -// -// struct foo_overloads -// : public boost::python::detail::overloads_common<foo_overloads> -// { -// typedef foo_overloadsNonVoid non_void_return_type; -// typedef foo_overloadsNonVoid void_return_type; -// -// foo_overloads(char const* doc = 0) -// : boost::python::detail::overloads_common<foo_overloads>(doc) {} -// }; -// -// The typedefs non_void_return_type and void_return_type are -// used to handle compilers that do not support void returns. The -// example above typedefs non_void_return_type and -// void_return_type to foo_overloadsNonVoid. On compilers that do -// not support void returns, there are two versions: -// foo_overloadsNonVoid and foo_overloadsVoid. The "Void" -// version is almost identical to the "NonVoid" version except -// for the return type (void) and the lack of the return keyword. -// -// See the overloads_common above for a description of the -// foo_overloads' base class. -// -/////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ - BOOST_PYTHON_GEN_FUNCTION_STUB( \ - fname, \ - generator_name, \ - max_args, \ - BOOST_PP_SUB_D(1, max_args, min_args)) - -#define BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ - BOOST_PYTHON_GEN_MEM_FUNCTION_STUB( \ - fname, \ - generator_name, \ - max_args, \ - BOOST_PP_SUB_D(1, max_args, min_args)) - -// deprecated macro names (to be removed) -#define BOOST_PYTHON_FUNCTION_GENERATOR BOOST_PYTHON_FUNCTION_OVERLOADS -#define BOOST_PYTHON_MEM_FUN_GENERATOR BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS - -/////////////////////////////////////////////////////////////////////////////// -#endif // DEFAULTS_GEN_JDG20020807_HPP - - diff --git a/contrib/restricted/boost/python/include/boost/python/detail/is_wrapper.hpp b/contrib/restricted/boost/python/include/boost/python/detail/is_wrapper.hpp deleted file mode 100644 index d7bce7b6273..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/is_wrapper.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright David Abrahams 2004. 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 IS_WRAPPER_DWA2004723_HPP -# define IS_WRAPPER_DWA2004723_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/mpl/bool.hpp> - -namespace boost { namespace python { - -template <class T> class wrapper; - -namespace detail -{ - typedef char (&is_not_wrapper)[2]; - is_not_wrapper is_wrapper_helper(...); - template <class T> - char is_wrapper_helper(wrapper<T> const volatile*); - - // A metafunction returning true iff T is [derived from] wrapper<U> - template <class T> - struct is_wrapper - : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)> - {}; - -}}} // namespace boost::python::detail - -#endif // IS_WRAPPER_DWA2004723_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/make_keyword_range_fn.hpp b/contrib/restricted/boost/python/include/boost/python/detail/make_keyword_range_fn.hpp deleted file mode 100644 index c4795cf8873..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/make_keyword_range_fn.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// 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 MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP -# define MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP - -# include <boost/python/make_function.hpp> -# include <boost/python/args_fwd.hpp> - -# include <boost/python/object/make_holder.hpp> - -# include <boost/mpl/size.hpp> - - -namespace boost { namespace python { namespace detail { - -// Think of this as a version of make_function without a compile-time -// check that the size of kw is no greater than the expected arity of -// F. This version is needed when defining functions with default -// arguments, because compile-time information about the number of -// keywords is missing for all but the initial function definition. -// -// @group make_keyword_range_function { -template <class F, class Policies> -object make_keyword_range_function( - F f - , Policies const& policies - , keyword_range const& kw) -{ - return detail::make_function_aux( - f, policies, detail::get_signature(f), kw, mpl::int_<0>()); -} - -template <class F, class Policies, class Signature> -object make_keyword_range_function( - F f - , Policies const& policies - , keyword_range const& kw - , Signature const& sig) -{ - return detail::make_function_aux( - f, policies, sig, kw, mpl::int_<0>()); -} -// } - -// Builds an '__init__' function which inserts the given Holder type -// in a wrapped C++ class instance. ArgList is an MPL type sequence -// describing the C++ argument types to be passed to Holder's -// constructor. -// -// Holder and ArgList are intended to be explicitly specified. -template <class ArgList, class Arity, class Holder, class CallPolicies> -object make_keyword_range_constructor( - CallPolicies const& policies // The CallPolicies with which to invoke the Holder's constructor - , detail::keyword_range const& kw // The (possibly empty) set of associated argument keywords - , Holder* = 0 - , ArgList* = 0, Arity* = 0) -{ -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) - python_class<BOOST_DEDUCED_TYPENAME Holder::value_type>::register_(); -#endif - return detail::make_keyword_range_function( - objects::make_holder<Arity::value> - ::template apply<Holder,ArgList>::execute - , policies - , kw); -} - -}}} // namespace boost::python::detail - -#endif // MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/nullary_function_adaptor.hpp b/contrib/restricted/boost/python/include/boost/python/detail/nullary_function_adaptor.hpp deleted file mode 100644 index 9dcc434f8e6..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/nullary_function_adaptor.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright David Abrahams 2003. -// 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 NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP -# define NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/preprocessor/iteration/local.hpp> -# include <boost/preprocessor/facilities/intercept.hpp> -# include <boost/preprocessor/repetition/enum_params.hpp> -# include <boost/preprocessor/repetition/enum_binary_params.hpp> - -namespace boost { namespace python { namespace detail { - -// nullary_function_adaptor -- a class template which ignores its -// arguments and calls a nullary function instead. Used for building -// error-reporting functions, c.f. pure_virtual -template <class NullaryFunction> -struct nullary_function_adaptor -{ - nullary_function_adaptor(NullaryFunction fn) - : m_fn(fn) - {} - - void operator()() const { m_fn(); } - -# define BOOST_PP_LOCAL_MACRO(i) \ - template <BOOST_PP_ENUM_PARAMS_Z(1, i, class A)> \ - void operator()( \ - BOOST_PP_ENUM_BINARY_PARAMS_Z(1, i, A, const& BOOST_PP_INTERCEPT) \ - ) const \ - { \ - m_fn(); \ - } - -# define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY) -# include BOOST_PP_LOCAL_ITERATE() - - private: - NullaryFunction m_fn; -}; - -}}} // namespace boost::python::detail - -#endif // NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/operator_id.hpp b/contrib/restricted/boost/python/include/boost/python/detail/operator_id.hpp deleted file mode 100644 index ecfc70f1089..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/operator_id.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// 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 OPERATOR_ID_DWA2002531_HPP -# define OPERATOR_ID_DWA2002531_HPP - -namespace boost { namespace python { namespace detail { - -enum operator_id -{ - op_add, - op_sub, - op_mul, - op_div, - op_mod, - op_divmod, - op_pow, - op_lshift, - op_rshift, - op_and, - op_xor, - op_or, - op_neg, - op_pos, - op_abs, - op_invert, - op_int, - op_long, - op_float, - op_str, - op_cmp, - op_gt, - op_ge, - op_lt, - op_le, - op_eq, - op_ne, - op_iadd, - op_isub, - op_imul, - op_idiv, - op_imod, - op_ilshift, - op_irshift, - op_iand, - op_ixor, - op_ior, - op_complex, -#if PY_VERSION_HEX >= 0x03000000 - op_bool, -#else - op_nonzero, -#endif - op_repr -#if PY_VERSION_HEX >= 0x03000000 - ,op_truediv -#endif -}; - -}}} // namespace boost::python::detail - -#endif // OPERATOR_ID_DWA2002531_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/overloads_fwd.hpp b/contrib/restricted/boost/python/include/boost/python/detail/overloads_fwd.hpp deleted file mode 100644 index 4c7fdf292bd..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/overloads_fwd.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// 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 OVERLOADS_FWD_DWA2002101_HPP -# define OVERLOADS_FWD_DWA2002101_HPP - -namespace boost { namespace python { namespace detail { - -// forward declarations -struct overloads_base; - -template <class OverloadsT, class NameSpaceT, class SigT> -inline void define_with_defaults(char const* name, OverloadsT const&, NameSpaceT&, SigT const&); - -}}} // namespace boost::python::detail - -#endif // OVERLOADS_FWD_DWA2002101_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/python_type.hpp b/contrib/restricted/boost/python/include/boost/python/detail/python_type.hpp deleted file mode 100644 index f7630c175ad..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/python_type.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright Nikolay Mladenov 2007. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_PYTHON_OBJECT_PYTHON_TYPE_H -#define BOOST_PYTHON_OBJECT_PYTHON_TYPE_H - -#include <boost/python/converter/registered.hpp> - -namespace boost {namespace python {namespace detail{ - - -template <class T> struct python_class : PyObject -{ - typedef python_class<T> this_type; - - typedef T type; - - static void *converter (PyObject *p){ - return p; - } - - static void register_() - { - static bool first_time = true; - - if ( !first_time ) return; - - first_time = false; - converter::registry::insert(&converter, boost::python::type_id<this_type>(), &converter::registered_pytype_direct<T>::get_pytype); - } -}; - - -}}} //namespace boost :: python :: detail - -#endif //BOOST_PYTHON_OBJECT_PYTHON_TYPE_H diff --git a/contrib/restricted/boost/python/include/boost/python/detail/scope.hpp b/contrib/restricted/boost/python/include/boost/python/detail/scope.hpp deleted file mode 100644 index 5367bbd35c2..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/scope.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// 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 SCOPE_DWA2002927_HPP -# define SCOPE_DWA2002927_HPP - -# include <boost/python/detail/config.hpp> - -namespace boost { namespace python { namespace detail { - -void BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& obj, char const* doc); - -}}} // namespace boost::python::detail - -#endif // SCOPE_DWA2002927_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/target.hpp b/contrib/restricted/boost/python/include/boost/python/detail/target.hpp deleted file mode 100644 index 137801bb2b0..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/target.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#if !defined(BOOST_PP_IS_ITERATING) - -// 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 TARGET_DWA2002521_HPP -# define TARGET_DWA2002521_HPP - -# include <boost/python/detail/preprocessor.hpp> - -# include <boost/type.hpp> - -# include <boost/preprocessor/comma_if.hpp> -# include <boost/preprocessor/if.hpp> -# include <boost/preprocessor/iterate.hpp> -# include <boost/preprocessor/debug/line.hpp> -# include <boost/preprocessor/enum_params.hpp> -# include <boost/preprocessor/repetition/enum_trailing_params.hpp> - -namespace boost { namespace python { namespace detail { - -# define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>, BOOST_PYTHON_FUNCTION_POINTER)) -# include BOOST_PP_ITERATE() - -# define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_CV_COUNT - 1, <boost/python/detail/target.hpp>, BOOST_PYTHON_POINTER_TO_MEMBER)) -# include BOOST_PP_ITERATE() - -template <class R, class T> -T& (* target(R (T::*)) )() { return 0; } - -}}} // namespace boost::python::detail - -# endif // TARGET_DWA2002521_HPP - -/* --------------- function pointers --------------- */ -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers)) -# endif - -# define N BOOST_PP_ITERATION() - -template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)> -BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )() -{ - return 0; -} - -# undef N - -/* --------------- pointers-to-members --------------- */ -#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER -// Outer over cv-qualifiers - -# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>)) -# include BOOST_PP_ITERATE() - -#elif BOOST_PP_ITERATION_DEPTH() == 2 -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members)) -# endif -// Inner over arities - -# define N BOOST_PP_ITERATION() -# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) - -template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)> -T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )() -{ - return 0; -} - -# undef N -# undef Q - -#endif // BOOST_PP_ITERATION_DEPTH() -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/detail/translate_exception.hpp b/contrib/restricted/boost/python/include/boost/python/detail/translate_exception.hpp deleted file mode 100644 index 877db2b2c6b..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/translate_exception.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// 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 TRANSLATE_EXCEPTION_TDS20091020_HPP -# define TRANSLATE_EXCEPTION_TDS20091020_HPP - -# include <boost/python/detail/exception_handler.hpp> -# include <boost/python/detail/type_traits.hpp> - -# include <boost/call_traits.hpp> - -# include <boost/function/function0.hpp> - -namespace boost { namespace python { namespace detail { - -// A ternary function object used to translate C++ exceptions of type -// ExceptionType into Python exceptions by invoking an object of type -// Translate. Typically the translate function will be curried with -// boost::bind(). -template <class ExceptionType, class Translate> -struct translate_exception -{ -// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 -# if defined(__linux__) && defined(__GNUC__) \ - && BOOST_WORKAROUND(__GNUC__, == 3) \ - && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ - && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ - || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) - typedef typename remove_reference< - typename add_const<ExceptionType>::type - >::type exception_non_ref; -# else - typedef typename add_lvalue_reference< - typename add_const<ExceptionType>::type - >::type exception_cref; -# endif - - inline bool operator()( - exception_handler const& handler - , function0<void> const& f - , typename call_traits<Translate>::param_type translate) const - { - try - { - return handler(f); - } -// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 -# if defined(__linux__) && defined(__GNUC__) \ - && BOOST_WORKAROUND(__GNUC__, == 3) \ - && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ - && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ - || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) - catch(exception_non_ref& e) -# else - catch(exception_cref e) -# endif - { - translate(e); - return true; - } - } -}; - -}}} // namespace boost::python::detail - -#endif // TRANSLATE_EXCEPTION_DWA2002810_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/unwrap_type_id.hpp b/contrib/restricted/boost/python/include/boost/python/detail/unwrap_type_id.hpp deleted file mode 100644 index 96c1f530133..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/unwrap_type_id.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright David Abrahams 2004. 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 UNWRAP_TYPE_ID_DWA2004722_HPP -# define UNWRAP_TYPE_ID_DWA2004722_HPP - -# include <boost/python/type_id.hpp> - -# include <boost/mpl/bool.hpp> - -namespace boost { namespace python { - -template <class T> class wrapper; - -namespace detail { - -template <class T> -inline type_info unwrap_type_id(T*, ...) -{ - return type_id<T>(); -} - -template <class U, class T> -inline type_info unwrap_type_id(U*, wrapper<T>*) -{ - return type_id<T>(); -} - -}}} // namespace boost::python::detail - -#endif // UNWRAP_TYPE_ID_DWA2004722_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/detail/unwrap_wrapper.hpp b/contrib/restricted/boost/python/include/boost/python/detail/unwrap_wrapper.hpp deleted file mode 100644 index 95bc233a728..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/detail/unwrap_wrapper.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright David Abrahams 2004. 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 UNWRAP_WRAPPER_DWA2004723_HPP -# define UNWRAP_WRAPPER_DWA2004723_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/is_wrapper.hpp> -# include <boost/mpl/eval_if.hpp> -# include <boost/mpl/identity.hpp> - -namespace boost { namespace python { namespace detail { - -template <class T> -struct unwrap_wrapper_helper -{ - typedef typename T::_wrapper_wrapped_type_ type; -}; - -template <class T> -struct unwrap_wrapper_ - : mpl::eval_if<is_wrapper<T>,unwrap_wrapper_helper<T>,mpl::identity<T> > -{}; - -template <class T> -typename unwrap_wrapper_<T>::type* -unwrap_wrapper(T*) -{ - return 0; -} - -}}} // namespace boost::python::detail - -#endif // UNWRAP_WRAPPER_DWA2004723_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/enum.hpp b/contrib/restricted/boost/python/include/boost/python/enum.hpp deleted file mode 100644 index 9631a0edc81..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/enum.hpp +++ /dev/null @@ -1,108 +0,0 @@ -// 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 ENUM_DWA200298_HPP -# define ENUM_DWA200298_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/object/enum_base.hpp> -# include <boost/python/converter/rvalue_from_python_data.hpp> -# include <boost/python/converter/registered.hpp> - -namespace boost { namespace python { - -template <class T> -struct enum_ : public objects::enum_base -{ - typedef objects::enum_base base; - - // Declare a new enumeration type in the current scope() - enum_(char const* name, char const* doc = 0); - - // Add a new enumeration value with the given name and value. - inline enum_<T>& value(char const* name, T); - - // Add all of the defined enumeration values to the current scope with the - // same names used here. - inline enum_<T>& export_values(); - private: - static PyObject* to_python(void const* x); - static void* convertible_from_python(PyObject* obj); - static void construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data); -}; - -template <class T> -inline enum_<T>::enum_(char const* name, char const* doc ) - : base( - name - , &enum_<T>::to_python - , &enum_<T>::convertible_from_python - , &enum_<T>::construct - , type_id<T>() - , doc - ) -{ -} - -// This is the conversion function that gets registered for converting -// these enums to Python. -template <class T> -PyObject* enum_<T>::to_python(void const* x) -{ - return base::to_python( - converter::registered<T>::converters.m_class_object - , static_cast<long>(*(T const*)x)); -} - -// -// The following two static functions serve as the elements of an -// rvalue from_python converter for the enumeration type. -// - -// This checks that a given Python object can be converted to the -// enumeration type. -template <class T> -void* enum_<T>::convertible_from_python(PyObject* obj) -{ - return PyObject_IsInstance( - obj - , upcast<PyObject>( - converter::registered<T>::converters.m_class_object)) - - ? obj : 0; -} - -// Constructs an instance of the enumeration type in the from_python -// data. -template <class T> -void enum_<T>::construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data) -{ -#if PY_VERSION_HEX >= 0x03000000 - T x = static_cast<T>(PyLong_AS_LONG(obj)); -#else - T x = static_cast<T>(PyInt_AS_LONG(obj)); -#endif - void* const storage = ((converter::rvalue_from_python_storage<T>*)data)->storage.bytes; - new (storage) T(x); - data->convertible = storage; -} - -template <class T> -inline enum_<T>& enum_<T>::value(char const* name, T x) -{ - this->add_value(name, static_cast<long>(x)); - return *this; -} - -template <class T> -inline enum_<T>& enum_<T>::export_values() -{ - this->base::export_values(); - return *this; -} - -}} // namespace boost::python - -#endif // ENUM_DWA200298_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/exception_translator.hpp b/contrib/restricted/boost/python/include/boost/python/exception_translator.hpp deleted file mode 100644 index 1aa1465bdf8..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/exception_translator.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// 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 EXCEPTION_TRANSLATOR_DWA2002810_HPP -# define EXCEPTION_TRANSLATOR_DWA2002810_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/bind/bind.hpp> -# include <boost/bind/placeholders.hpp> -# include <boost/type.hpp> -# include <boost/python/detail/translate_exception.hpp> -# include <boost/python/detail/exception_handler.hpp> - -namespace boost { namespace python { - -template <class ExceptionType, class Translate> -void register_exception_translator(Translate translate, boost::type<ExceptionType>* = 0) -{ - using namespace boost::placeholders; - detail::register_exception_handler( - boost::bind<bool>(detail::translate_exception<ExceptionType,Translate>(), _1, _2, translate) - ); -} - -}} // namespace boost::python - -#endif // EXCEPTION_TRANSLATOR_DWA2002810_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/has_back_reference.hpp b/contrib/restricted/boost/python/include/boost/python/has_back_reference.hpp deleted file mode 100644 index 67fe24c5cff..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/has_back_reference.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// 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 HAS_BACK_REFERENCE_DWA2002323_HPP -# define HAS_BACK_REFERENCE_DWA2002323_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/mpl/bool.hpp> - -namespace boost { namespace python { - -// traits class which users can specialize to indicate that a class -// contains a back-reference to its owning PyObject* -template <class T> -struct has_back_reference - : mpl::false_ -{ -}; - - -}} // namespace boost::python - -#endif // HAS_BACK_REFERENCE_DWA2002323_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/implicit.hpp b/contrib/restricted/boost/python/include/boost/python/implicit.hpp deleted file mode 100644 index 4d01b2fb229..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/implicit.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// 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 IMPLICIT_DWA2002325_HPP -# define IMPLICIT_DWA2002325_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/type.hpp> -# include <boost/python/converter/implicit.hpp> -# include <boost/python/converter/registry.hpp> -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif -# include <boost/python/type_id.hpp> - -namespace boost { namespace python { - -template <class Source, class Target> -void implicitly_convertible(boost::type<Source>* = 0, boost::type<Target>* = 0) -{ - typedef converter::implicit<Source,Target> functions; - - converter::registry::push_back( - &functions::convertible - , &functions::construct - , type_id<Target>() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - , &converter::expected_from_python_type_direct<Source>::get_pytype -#endif - ); -} - -}} // namespace boost::python - -#endif // IMPLICIT_DWA2002325_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/init.hpp b/contrib/restricted/boost/python/include/boost/python/init.hpp deleted file mode 100644 index 0ee763cc269..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/init.hpp +++ /dev/null @@ -1,399 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Copyright David Abrahams 2002, Joel de Guzman, 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 INIT_JDG20020820_HPP -#define INIT_JDG20020820_HPP - -# include <boost/python/detail/prefix.hpp> - -#include <boost/python/detail/type_list.hpp> -#include <boost/python/args_fwd.hpp> -#include <boost/python/detail/make_keyword_range_fn.hpp> -#include <boost/python/def_visitor.hpp> - -#include <boost/mpl/if.hpp> -#include <boost/mpl/eval_if.hpp> -#include <boost/mpl/size.hpp> -#include <boost/mpl/iterator_range.hpp> -#include <boost/mpl/empty.hpp> -#include <boost/mpl/begin_end.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/prior.hpp> -#include <boost/mpl/joint_view.hpp> -#include <boost/mpl/back.hpp> - -#include <boost/python/detail/type_traits.hpp> - -#include <boost/preprocessor/enum_params_with_a_default.hpp> -#include <boost/preprocessor/enum_params.hpp> - -#include <utility> - -/////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT \ - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( \ - BOOST_PYTHON_MAX_ARITY, \ - class T, \ - mpl::void_) \ - -#define BOOST_PYTHON_OVERLOAD_TYPES \ - BOOST_PP_ENUM_PARAMS_Z(1, \ - BOOST_PYTHON_MAX_ARITY, \ - class T) \ - -#define BOOST_PYTHON_OVERLOAD_ARGS \ - BOOST_PP_ENUM_PARAMS_Z(1, \ - BOOST_PYTHON_MAX_ARITY, \ - T) \ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace python { - -template <BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT> -class init; // forward declaration - - -template <BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT> -struct optional; // forward declaration - -namespace detail -{ - namespace error - { - template <int keywords, int init_args> - struct more_keywords_than_init_arguments - { - typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1] BOOST_ATTRIBUTE_UNUSED; - }; - } - - // is_optional<T>::value - // - // This metaprogram checks if T is an optional - // - - template <class T> - struct is_optional - : mpl::false_ - {}; - - template <BOOST_PYTHON_OVERLOAD_TYPES> - struct is_optional<optional<BOOST_PYTHON_OVERLOAD_ARGS> > - : mpl::true_ - {}; - - - template <int NDefaults> - struct define_class_init_helper; - -} // namespace detail - -template <class DerivedT> -struct init_base : def_visitor<DerivedT> -{ - init_base(char const* doc_, detail::keyword_range const& keywords_) - : m_doc(doc_), m_keywords(keywords_) - {} - - init_base(char const* doc_) - : m_doc(doc_) - {} - - DerivedT const& derived() const - { - return *static_cast<DerivedT const*>(this); - } - - char const* doc_string() const - { - return m_doc; - } - - detail::keyword_range const& keywords() const - { - return m_keywords; - } - - static default_call_policies call_policies() - { - return default_call_policies(); - } - - private: - // visit - // - // Defines a set of n_defaults + 1 constructors for its - // class_<...> argument. Each constructor after the first has - // one less argument to its right. Example: - // - // init<int, optional<char, long, double> > - // - // Defines: - // - // __init__(int, char, long, double) - // __init__(int, char, long) - // __init__(int, char) - // __init__(int) - template <class classT> - void visit(classT& cl) const - { - typedef typename DerivedT::signature signature; - typedef typename DerivedT::n_arguments n_arguments; - typedef typename DerivedT::n_defaults n_defaults; - - detail::define_class_init_helper<n_defaults::value>::apply( - cl - , derived().call_policies() - , signature() - , n_arguments() - , derived().doc_string() - , derived().keywords()); - } - - friend class python::def_visitor_access; - - private: // data members - char const* m_doc; - detail::keyword_range m_keywords; -}; - -template <class CallPoliciesT, class InitT> -class init_with_call_policies - : public init_base<init_with_call_policies<CallPoliciesT, InitT> > -{ - typedef init_base<init_with_call_policies<CallPoliciesT, InitT> > base; - public: - typedef typename InitT::n_arguments n_arguments; - typedef typename InitT::n_defaults n_defaults; - typedef typename InitT::signature signature; - - init_with_call_policies( - CallPoliciesT const& policies_ - , char const* doc_ - , detail::keyword_range const& keywords - ) - : base(doc_, keywords) - , m_policies(policies_) - {} - - CallPoliciesT const& call_policies() const - { - return this->m_policies; - } - - private: // data members - CallPoliciesT m_policies; -}; - -// -// drop1<S> is the initial length(S) elements of S -// -namespace detail -{ - template <class S> - struct drop1 - : mpl::iterator_range< - typename mpl::begin<S>::type - , typename mpl::prior< - typename mpl::end<S>::type - >::type - > - {}; -} - -template <BOOST_PYTHON_OVERLOAD_TYPES> -class init : public init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> > -{ - typedef init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> > base; - public: - typedef init<BOOST_PYTHON_OVERLOAD_ARGS> self_t; - - init(char const* doc_ = 0) - : base(doc_) - { - } - - template <std::size_t N> - init(char const* doc_, detail::keywords<N> const& kw) - : base(doc_, kw.range()) - { - typedef typename detail::error::more_keywords_than_init_arguments< - N, n_arguments::value + 1 - >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; - } - - template <std::size_t N> - init(detail::keywords<N> const& kw, char const* doc_ = 0) - : base(doc_, kw.range()) - { - typedef typename detail::error::more_keywords_than_init_arguments< - N, n_arguments::value + 1 - >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; - } - - template <class CallPoliciesT> - init_with_call_policies<CallPoliciesT, self_t> - operator[](CallPoliciesT const& policies) const - { - return init_with_call_policies<CallPoliciesT, self_t>( - policies, this->doc_string(), this->keywords()); - } - - typedef detail::type_list<BOOST_PYTHON_OVERLOAD_ARGS> signature_; - - typedef detail::is_optional< - typename mpl::eval_if< - mpl::empty<signature_> - , mpl::false_ - , mpl::back<signature_> - >::type - > back_is_optional; - - typedef typename mpl::eval_if< - back_is_optional - , mpl::back<signature_> - , mpl::vector0<> - >::type optional_args; - - typedef typename mpl::eval_if< - back_is_optional - , mpl::if_< - mpl::empty<optional_args> - , detail::drop1<signature_> - , mpl::joint_view< - detail::drop1<signature_> - , optional_args - > - > - , signature_ - >::type signature; - - // TODO: static assert to make sure there are no other optional elements - - // Count the number of default args - typedef mpl::size<optional_args> n_defaults; - typedef mpl::size<signature> n_arguments; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// optional -// -// optional<T0...TN>::type returns a typelist. -// -/////////////////////////////////////////////////////////////////////////////// -template <BOOST_PYTHON_OVERLOAD_TYPES> -struct optional - : detail::type_list<BOOST_PYTHON_OVERLOAD_ARGS> -{ -}; - -namespace detail -{ - template <class ClassT, class CallPoliciesT, class Signature, class NArgs> - inline void def_init_aux( - ClassT& cl - , Signature const& - , NArgs - , CallPoliciesT const& policies - , char const* doc - , detail::keyword_range const& keywords_ - ) - { - cl.def( - "__init__" - , detail::make_keyword_range_constructor<Signature,NArgs>( - policies - , keywords_ - , (typename ClassT::metadata::holder*)0 - ) - , doc - ); - } - - /////////////////////////////////////////////////////////////////////////////// - // - // define_class_init_helper<N>::apply - // - // General case - // - // Accepts a class_ and an arguments list. Defines a constructor - // for the class given the arguments and recursively calls - // define_class_init_helper<N-1>::apply with one fewer argument (the - // rightmost argument is shaved off) - // - /////////////////////////////////////////////////////////////////////////////// - template <int NDefaults> - struct define_class_init_helper - { - - template <class ClassT, class CallPoliciesT, class Signature, class NArgs> - static void apply( - ClassT& cl - , CallPoliciesT const& policies - , Signature const& args - , NArgs - , char const* doc - , detail::keyword_range keywords) - { - detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords); - - if (keywords.second > keywords.first) - --keywords.second; - - typedef typename mpl::prior<NArgs>::type next_nargs; - define_class_init_helper<NDefaults-1>::apply( - cl, policies, Signature(), next_nargs(), doc, keywords); - } - }; - - /////////////////////////////////////////////////////////////////////////////// - // - // define_class_init_helper<0>::apply - // - // Terminal case - // - // Accepts a class_ and an arguments list. Defines a constructor - // for the class given the arguments. - // - /////////////////////////////////////////////////////////////////////////////// - template <> - struct define_class_init_helper<0> { - - template <class ClassT, class CallPoliciesT, class Signature, class NArgs> - static void apply( - ClassT& cl - , CallPoliciesT const& policies - , Signature const& args - , NArgs - , char const* doc - , detail::keyword_range const& keywords) - { - detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords); - } - }; -} - -}} // namespace boost::python - -#undef BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT -#undef BOOST_PYTHON_OVERLOAD_TYPES -#undef BOOST_PYTHON_OVERLOAD_ARGS -#undef BOOST_PYTHON_IS_OPTIONAL_VALUE -#undef BOOST_PYTHON_APPEND_TO_INIT - -/////////////////////////////////////////////////////////////////////////////// -#endif // INIT_JDG20020820_HPP - - - - - - - - diff --git a/contrib/restricted/boost/python/include/boost/python/iterator.hpp b/contrib/restricted/boost/python/include/boost/python/iterator.hpp deleted file mode 100644 index b0ea5789592..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/iterator.hpp +++ /dev/null @@ -1,136 +0,0 @@ -// 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 ITERATOR_DWA2002512_HPP -# define ITERATOR_DWA2002512_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/detail/target.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/python/object/iterator.hpp> -# include <boost/python/object_core.hpp> - -# if defined(BOOST_MSVC) && (BOOST_MSVC == 1400) /* -> warning C4180: qualifier applied to function type has no meaning; ignored -Peter Dimov wrote: -This warning is caused by an overload resolution bug in VC8 that cannot be -worked around and will probably not be fixed by MS in the VC8 line. The -problematic overload is only instantiated and never called, and the code -works correctly. */ -# pragma warning(disable: 4180) -# endif - -# include <boost/bind/bind.hpp> -# include <boost/bind/protect.hpp> - -namespace boost { namespace python { - -namespace detail -{ - // Adds an additional layer of binding to - // objects::make_iterator(...), which allows us to pass member - // function and member data pointers. - template <class Target, class Accessor1, class Accessor2, class NextPolicies> - inline object make_iterator( - Accessor1 get_start - , Accessor2 get_finish - , NextPolicies next_policies - , Target&(*)() - ) - { - using namespace boost::placeholders; - return objects::make_iterator_function<Target>( - boost::protect(boost::bind(get_start, _1)) - , boost::protect(boost::bind(get_finish, _1)) - , next_policies - ); - } - - // Guts of template class iterators<>, below. - template <bool const_ = false> - struct iterators_impl - { - template <class T> - struct apply - { - typedef typename T::iterator iterator; - static iterator begin(T& x) { return x.begin(); } - static iterator end(T& x) { return x.end(); } - }; - }; - - template <> - struct iterators_impl<true> - { - template <class T> - struct apply - { - typedef typename T::const_iterator iterator; - static iterator begin(T& x) { return x.begin(); } - static iterator end(T& x) { return x.end(); } - }; - }; -} - -// An "ordinary function generator" which contains static begin(x) and -// end(x) functions that invoke T::begin() and T::end(), respectively. -template <class T> -struct iterators - : detail::iterators_impl< - detail::is_const<T>::value - >::template apply<T> -{ -}; - -// Create an iterator-building function which uses the given -// accessors. Deduce the Target type from the accessors. The iterator -// returns copies of the inderlying elements. -template <class Accessor1, class Accessor2> -object range(Accessor1 start, Accessor2 finish) -{ - return detail::make_iterator( - start, finish - , objects::default_iterator_call_policies() - , detail::target(start) - ); -} - -// Create an iterator-building function which uses the given accessors -// and next() policies. Deduce the Target type. -template <class NextPolicies, class Accessor1, class Accessor2> -object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0) -{ - return detail::make_iterator(start, finish, NextPolicies(), detail::target(start)); -} - -// Create an iterator-building function which uses the given accessors -// and next() policies, operating on the given Target type -template <class NextPolicies, class Target, class Accessor1, class Accessor2> -object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0, boost::type<Target>* = 0) -{ - // typedef typename add_reference<Target>::type target; - return detail::make_iterator(start, finish, NextPolicies(), (Target&(*)())0); -} - -// A Python callable object which produces an iterator traversing -// [x.begin(), x.end()), where x is an instance of the Container -// type. NextPolicies are used as the CallPolicies for the iterator's -// next() function. -template <class Container - , class NextPolicies = objects::default_iterator_call_policies> -struct iterator : object -{ - iterator() - : object( - python::range<NextPolicies>( - &iterators<Container>::begin, &iterators<Container>::end - )) - { - } -}; - -}} // namespace boost::python - -#endif // ITERATOR_DWA2002512_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/lvalue_from_pytype.hpp b/contrib/restricted/boost/python/include/boost/python/lvalue_from_pytype.hpp deleted file mode 100644 index 59d31b89cf5..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/lvalue_from_pytype.hpp +++ /dev/null @@ -1,117 +0,0 @@ -// 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 LVALUE_FROM_PYTYPE_DWA2002130_HPP -# define LVALUE_FROM_PYTYPE_DWA2002130_HPP - -# include <boost/python/detail/prefix.hpp> -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif - -# include <boost/python/type_id.hpp> -# include <boost/python/converter/registry.hpp> -# include <boost/python/detail/void_ptr.hpp> -# include <boost/python/detail/type_traits.hpp> - -namespace boost { namespace python { - -namespace detail -{ - // Given a pointer-to-function of 1 parameter returning a reference - // type, return the type_id of the function's return type. - template <class T, class U> - inline type_info extractor_type_id(T&(*)(U)) - { - return type_id<T>(); - } - - // A function generator whose static execute() function is an lvalue - // from_python converter using the given Extractor. U is expected to - // be the actual type of the PyObject instance from which the result - // is being extracted. - template <class Extractor, class U> - struct normalized_extractor - { - static inline void* execute(PyObject* op) - { - typedef typename add_lvalue_reference<U>::type param; - return &Extractor::execute( - boost::python::detail::void_ptr_to_reference( - op, (param(*)())0 ) - ); - } - }; - - // Given an Extractor type and a pointer to its execute function, - // return a new object whose static execute function does the same - // job but is a conforming lvalue from_python conversion function. - // - // usage: normalize<Extractor>(&Extractor::execute) - template <class Extractor, class T, class U> - inline normalized_extractor<Extractor,U> - normalize(T(*)(U), Extractor* = 0) - { - return normalized_extractor<Extractor, U>(); - } -} - -// An Extractor which extracts the given member from a Python object -// whose instances are stored as InstanceType. -template <class InstanceType, class MemberType, MemberType (InstanceType::*member)> -struct extract_member -{ - static MemberType& execute(InstanceType& c) - { - (void)Py_TYPE(&c); // static assertion - return c.*member; - } -}; - -// An Extractor which simply extracts the entire python object -// instance of InstanceType. -template <class InstanceType> -struct extract_identity -{ - static InstanceType& execute(InstanceType& c) - { - (void)Py_TYPE(&c); // static assertion - return c; - } -}; - -// Registers a from_python conversion which extracts lvalues using -// Extractor's static execute function from Python objects whose type -// object is python_type. -template <class Extractor, PyTypeObject const* python_type> -struct lvalue_from_pytype -{ - lvalue_from_pytype() - { - converter::registry::insert - ( &extract - , detail::extractor_type_id(&Extractor::execute) -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - , &get_pytype -#endif - ); - } - private: - static void* extract(PyObject* op) - { - return PyObject_TypeCheck(op, const_cast<PyTypeObject*>(python_type)) - ? const_cast<void*>( - static_cast<void const volatile*>( - detail::normalize<Extractor>(&Extractor::execute).execute(op))) - : 0 - ; - } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - static PyTypeObject const*get_pytype() { return python_type; } -#endif -}; - -}} // namespace boost::python - -#endif // LVALUE_FROM_PYTYPE_DWA2002130_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/make_constructor.hpp b/contrib/restricted/boost/python/include/boost/python/make_constructor.hpp deleted file mode 100644 index 3ec9ad5f86b..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/make_constructor.hpp +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright David Abrahams 2001. -// 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 MAKE_CONSTRUCTOR_DWA20011221_HPP -# define MAKE_CONSTRUCTOR_DWA20011221_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/default_call_policies.hpp> -# include <boost/python/args.hpp> -# include <boost/python/object_fwd.hpp> - -# include <boost/python/object/function_object.hpp> -# include <boost/python/object/make_holder.hpp> -# include <boost/python/object/pointer_holder.hpp> -# include <boost/python/converter/context_result_converter.hpp> - -# include <boost/python/detail/caller.hpp> -# include <boost/python/detail/none.hpp> - -# include <boost/mpl/size.hpp> -# include <boost/mpl/int.hpp> -# include <boost/mpl/push_front.hpp> -# include <boost/mpl/pop_front.hpp> -# include <boost/mpl/assert.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class T> - struct install_holder : converter::context_result_converter - { - install_holder(PyObject* args_) - : m_self(PyTuple_GetItem(args_, 0)) {} - - PyObject* operator()(T x) const - { - dispatch(x, is_pointer<T>()); - return none(); - } - - private: - template <class U> - void dispatch(U* x, detail::true_) const - { -#if defined(BOOST_NO_CXX11_SMART_PTR) - std::auto_ptr<U> owner(x); - dispatch(owner, detail::false_()); -#else - std::unique_ptr<U> owner(x); - dispatch(std::move(owner), detail::false_()); -#endif - } - - template <class Ptr> - void dispatch(Ptr x, detail::false_) const - { - typedef typename pointee<Ptr>::type value_type; - typedef objects::pointer_holder<Ptr,value_type> holder; - typedef objects::instance<holder> instance_t; - - void* memory = holder::allocate(this->m_self, offsetof(instance_t, storage), sizeof(holder)); - try { -#if defined(BOOST_NO_CXX11_SMART_PTR) - (new (memory) holder(x))->install(this->m_self); -#else - (new (memory) holder(std::move(x)))->install(this->m_self); -#endif - } - catch(...) { - holder::deallocate(this->m_self, memory); - throw; - } - } - - PyObject* m_self; - }; - - struct constructor_result_converter - { - template <class T> - struct apply - { - typedef install_holder<T> type; - }; - }; - - template <class BaseArgs, class Offset> - struct offset_args - { - offset_args(BaseArgs base_) : base(base_) {} - BaseArgs base; - }; - - template <int N, class BaseArgs, class Offset> - inline PyObject* get(mpl::int_<N>, offset_args<BaseArgs,Offset> const& args_) - { - return get(mpl::int_<(N+Offset::value)>(), args_.base); - } - - template <class BaseArgs, class Offset> - inline unsigned arity(offset_args<BaseArgs,Offset> const& args_) - { - return arity(args_.base) - Offset::value; - } - - template <class BasePolicy_ = default_call_policies> - struct constructor_policy : BasePolicy_ - { - constructor_policy(BasePolicy_ base) : BasePolicy_(base) {} - - // If the BasePolicy_ supplied a result converter it would be - // ignored; issue an error if it's not the default. - BOOST_MPL_ASSERT_MSG( - (is_same< - typename BasePolicy_::result_converter - , default_result_converter - >::value) - , MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS - , (typename BasePolicy_::result_converter) - ); - typedef constructor_result_converter result_converter; - typedef offset_args<typename BasePolicy_::argument_package, mpl::int_<1> > argument_package; - }; - - template <class InnerSignature> - struct outer_constructor_signature - { - typedef typename mpl::pop_front<InnerSignature>::type inner_args; - typedef typename mpl::push_front<inner_args,object>::type outer_args; - typedef typename mpl::push_front<outer_args,void>::type type; - }; - - // ETI workaround - template <> - struct outer_constructor_signature<int> - { - typedef int type; - }; - - // - // These helper functions for make_constructor (below) do the raw work - // of constructing a Python object from some invokable entity. See - // <boost/python/detail/caller.hpp> for more information about how - // the Sig arguments is used. - // - // @group make_constructor_aux { - template <class F, class CallPolicies, class Sig> - object make_constructor_aux( - F f // An object that can be invoked by detail::invoke() - , CallPolicies const& p // CallPolicies to use in the invocation - , Sig const& // An MPL sequence of argument types expected by F - ) - { - typedef typename outer_constructor_signature<Sig>::type outer_signature; - - typedef constructor_policy<CallPolicies> inner_policy; - - return objects::function_object( - objects::py_function( - detail::caller<F,inner_policy,Sig>(f, inner_policy(p)) - , outer_signature() - ) - ); - } - - // As above, except that it accepts argument keywords. NumKeywords - // is used only for a compile-time assertion to make sure the user - // doesn't pass more keywords than the function can accept. To - // disable all checking, pass mpl::int_<0> for NumKeywords. - template <class F, class CallPolicies, class Sig, class NumKeywords> - object make_constructor_aux( - F f - , CallPolicies const& p - , Sig const& - , detail::keyword_range const& kw // a [begin,end) pair of iterators over keyword names - , NumKeywords // An MPL integral type wrapper: the size of kw - ) - { - enum { arity = mpl::size<Sig>::value - 1 }; - - typedef typename detail::error::more_keywords_than_function_arguments< - NumKeywords::value, arity - >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; - - typedef typename outer_constructor_signature<Sig>::type outer_signature; - - typedef constructor_policy<CallPolicies> inner_policy; - - return objects::function_object( - objects::py_function( - detail::caller<F,inner_policy,Sig>(f, inner_policy(p)) - , outer_signature() - ) - , kw - ); - } - // } - - // - // These dispatch functions are used to discriminate between the - // cases when the 3rd argument is keywords or when it is a - // signature. - // - // @group Helpers for make_constructor when called with 3 arguments. { - // - template <class F, class CallPolicies, class Keywords> - object make_constructor_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_) - { - return detail::make_constructor_aux( - f - , policies - , detail::get_signature(f) - , kw.range() - , mpl::int_<Keywords::size>() - ); - } - - template <class F, class CallPolicies, class Signature> - object make_constructor_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_) - { - return detail::make_constructor_aux( - f - , policies - , sig - ); - } - // } -} - -// These overloaded functions wrap a function or member function -// pointer as a Python object, using optional CallPolicies, -// Keywords, and/or Signature. @group { -// -template <class F> -object make_constructor(F f) -{ - return detail::make_constructor_aux( - f,default_call_policies(), detail::get_signature(f)); -} - -template <class F, class CallPolicies> -object make_constructor(F f, CallPolicies const& policies) -{ - return detail::make_constructor_aux( - f, policies, detail::get_signature(f)); -} - -template <class F, class CallPolicies, class KeywordsOrSignature> -object make_constructor( - F f - , CallPolicies const& policies - , KeywordsOrSignature const& keywords_or_signature) -{ - typedef typename - detail::is_reference_to_keywords<KeywordsOrSignature&>::type - is_kw; - - return detail::make_constructor_dispatch( - f - , policies - , keywords_or_signature - , is_kw() - ); -} - -template <class F, class CallPolicies, class Keywords, class Signature> -object make_constructor( - F f - , CallPolicies const& policies - , Keywords const& kw - , Signature const& sig - ) -{ - return detail::make_constructor_aux( - f - , policies - , sig - , kw.range() - , mpl::int_<Keywords::size>() - ); -} -// } - -}} - - -#endif // MAKE_CONSTRUCTOR_DWA20011221_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/manage_new_object.hpp b/contrib/restricted/boost/python/include/boost/python/manage_new_object.hpp deleted file mode 100644 index 9ff341c1acc..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/manage_new_object.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// 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 MANAGE_NEW_OBJECT_DWA200222_HPP -# define MANAGE_NEW_OBJECT_DWA200222_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/mpl/if.hpp> -# include <boost/python/to_python_indirect.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class R> - struct manage_new_object_requires_a_pointer_return_type -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; -} - -struct manage_new_object -{ - template <class T> - struct apply - { - typedef typename mpl::if_c< - detail::is_pointer<T>::value - , to_python_indirect<T, detail::make_owning_holder> - , detail::manage_new_object_requires_a_pointer_return_type<T> - >::type type; - }; -}; - -}} // namespace boost::python - -#endif // MANAGE_NEW_OBJECT_DWA200222_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/module.hpp b/contrib/restricted/boost/python/include/boost/python/module.hpp deleted file mode 100644 index 8ad69f5a343..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/module.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright David Abrahams 2001. -// 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 MODULE_DWA2001128_HPP -# define MODULE_DWA2001128_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/module_init.hpp> -# define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT - -#endif // MODULE_DWA20011221_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/module_init.hpp b/contrib/restricted/boost/python/include/boost/python/module_init.hpp deleted file mode 100644 index 7fe5a1c8a25..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/module_init.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// 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 MODULE_INIT_DWA20020722_HPP -# define MODULE_INIT_DWA20020722_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/preprocessor/cat.hpp> -# include <boost/preprocessor/stringize.hpp> - -# ifndef BOOST_PYTHON_MODULE_INIT - -namespace boost { namespace python { namespace detail { - -# if PY_VERSION_HEX >= 0x03000000 - -BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef&, void(*)()); - -#else - -BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); - -#endif - -}}} - -# if PY_VERSION_HEX >= 0x03000000 - -# define _BOOST_PYTHON_MODULE_INIT(name) \ - PyObject* BOOST_PP_CAT(PyInit_, name)() \ - { \ - static PyModuleDef_Base initial_m_base = { \ - PyObject_HEAD_INIT(NULL) \ - 0, /* m_init */ \ - 0, /* m_index */ \ - 0 /* m_copy */ }; \ - static PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; \ - \ - static struct PyModuleDef moduledef = { \ - initial_m_base, \ - BOOST_PP_STRINGIZE(name), \ - 0, /* m_doc */ \ - -1, /* m_size */ \ - initial_methods, \ - 0, /* m_reload */ \ - 0, /* m_traverse */ \ - 0, /* m_clear */ \ - 0, /* m_free */ \ - }; \ - \ - return boost::python::detail::init_module( \ - moduledef, BOOST_PP_CAT(init_module_, name) ); \ - } \ - void BOOST_PP_CAT(init_module_, name)() - -# else - -# define _BOOST_PYTHON_MODULE_INIT(name) \ - void BOOST_PP_CAT(init,name)() \ -{ \ - boost::python::detail::init_module( \ - BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ -} \ - void BOOST_PP_CAT(init_module_,name)() - -# endif - -# define BOOST_PYTHON_MODULE_INIT(name) \ - void BOOST_PP_CAT(init_module_,name)(); \ -extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name) - -# endif - -#endif // MODULE_INIT_DWA20020722_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/object/class_metadata.hpp b/contrib/restricted/boost/python/include/boost/python/object/class_metadata.hpp deleted file mode 100644 index 06d3f8efa70..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/class_metadata.hpp +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright David Abrahams 2004. -// Copyright Stefan Seefeld 2016. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef boost_python_object_class_metadata_hpp_ -#define boost_python_object_class_metadata_hpp_ - -#include <boost/python/converter/shared_ptr_from_python.hpp> -#include <boost/python/object/inheritance.hpp> -#include <boost/python/object/class_wrapper.hpp> -#include <boost/python/object/make_instance.hpp> -#include <boost/python/object/value_holder.hpp> -#include <boost/python/object/pointer_holder.hpp> -#include <boost/python/object/make_ptr_instance.hpp> - -#include <boost/python/detail/force_instantiate.hpp> -#include <boost/python/detail/not_specified.hpp> -#include <boost/python/detail/type_traits.hpp> - -#include <boost/python/has_back_reference.hpp> -#include <boost/python/bases.hpp> - -#include <boost/mpl/if.hpp> -#include <boost/mpl/eval_if.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/or.hpp> -#include <boost/mpl/identity.hpp> -#include <boost/mpl/for_each.hpp> -#include <boost/mpl/placeholders.hpp> -#include <boost/mpl/single_view.hpp> - -#include <boost/mpl/assert.hpp> - -#include <boost/noncopyable.hpp> -#include <boost/detail/workaround.hpp> - -namespace boost { namespace python { namespace objects { - -BOOST_PYTHON_DECL -void copy_class_object(type_info const& src, type_info const& dst); - -// -// Support for registering base/derived relationships -// -template <class Derived> -struct register_base_of -{ - template <class Base> - inline void operator()(Base*) const - { - BOOST_MPL_ASSERT_NOT((boost::python::detail::is_same<Base,Derived>)); - - // Register the Base class - register_dynamic_id<Base>(); - - // Register the up-cast - register_conversion<Derived,Base>(false); - - // Register the down-cast, if appropriate. - this->register_downcast((Base*)0, boost::python::detail::is_polymorphic<Base>()); - } - - private: - static inline void register_downcast(void*, boost::python::detail::false_) {} - - template <class Base> - static inline void register_downcast(Base*, boost::python::detail::true_) - { - register_conversion<Base, Derived>(true); - } - -}; - -// -// Preamble of register_class. Also used for callback classes, which -// need some registration of their own. -// - -template <class T, class Bases> -inline void register_shared_ptr_from_python_and_casts(T*, Bases) -{ - // Constructor performs registration - python::detail::force_instantiate(converter::shared_ptr_from_python<T, boost::shared_ptr>()); -#if !defined(BOOST_NO_CXX11_SMART_PTR) - python::detail::force_instantiate(converter::shared_ptr_from_python<T, std::shared_ptr>()); -#endif - - // - // register all up/downcasts here. We're using the alternate - // interface to mpl::for_each to avoid an MSVC 6 bug. - // - register_dynamic_id<T>(); - mpl::for_each(register_base_of<T>(), (Bases*)0, (boost::python::detail::add_pointer<mpl::_>*)0); -} - -// -// Helper for choosing the unnamed held_type argument -// -template <class T, class Prev> -struct select_held_type - : mpl::if_< - mpl::or_< - python::detail::specifies_bases<T> - , boost::python::detail::is_same<T,noncopyable> - > - , Prev - , T - > -{ -}; - -template < - class T // class being wrapped - , class X1 // = detail::not_specified - , class X2 // = detail::not_specified - , class X3 // = detail::not_specified -> -struct class_metadata -{ - // - // Calculate the unnamed template arguments - // - - // held_type_arg -- not_specified, [a class derived from] T or a - // smart pointer to [a class derived from] T. Preserving - // not_specified allows us to give class_<T,T> a back-reference. - typedef typename select_held_type< - X1 - , typename select_held_type< - X2 - , typename select_held_type< - X3 - , python::detail::not_specified - >::type - >::type - >::type held_type_arg; - - // bases - typedef typename python::detail::select_bases< - X1 - , typename python::detail::select_bases< - X2 - , typename python::detail::select_bases< - X3 - , python::bases<> - >::type - >::type - >::type bases; - - typedef mpl::or_< - boost::python::detail::is_same<X1,noncopyable> - , boost::python::detail::is_same<X2,noncopyable> - , boost::python::detail::is_same<X3,noncopyable> - > is_noncopyable; - - // - // Holder computation. - // - - // Compute the actual type that will be held in the Holder. - typedef typename mpl::if_< - boost::python::detail::is_same<held_type_arg,python::detail::not_specified>, T, held_type_arg - >::type held_type; - - // Determine if the object will be held by value - typedef mpl::bool_<boost::python::detail::is_convertible<held_type*,T*>::value> use_value_holder; - - // Compute the "wrapped type", that is, if held_type is a smart - // pointer, we're talking about the pointee. - typedef typename mpl::eval_if< - use_value_holder - , mpl::identity<held_type> - , pointee<held_type> - >::type wrapped; - - // Determine whether to use a "back-reference holder" - typedef mpl::bool_< - mpl::or_< - has_back_reference<T> - , boost::python::detail::is_same<held_type_arg,T> - , is_base_and_derived<T,wrapped> - >::value - > use_back_reference; - - // Select the holder. - typedef typename mpl::eval_if< - use_back_reference - , mpl::if_< - use_value_holder - , value_holder_back_reference<T, wrapped> - , pointer_holder_back_reference<held_type,T> - > - , mpl::if_< - use_value_holder - , value_holder<T> - , pointer_holder<held_type,wrapped> - > - >::type holder; - - inline static void register_() // Register the runtime metadata. - { - class_metadata::register_aux((T*)0); - } - - private: - template <class T2> - inline static void register_aux(python::wrapper<T2>*) - { - typedef typename mpl::not_<boost::python::detail::is_same<T2,wrapped> >::type use_callback; - class_metadata::register_aux2((T2*)0, use_callback()); - } - - inline static void register_aux(void*) - { - typedef typename is_base_and_derived<T,wrapped>::type use_callback; - class_metadata::register_aux2((T*)0, use_callback()); - } - - template <class T2, class Callback> - inline static void register_aux2(T2*, Callback) - { - objects::register_shared_ptr_from_python_and_casts((T2*)0, bases()); - class_metadata::maybe_register_callback_class((T2*)0, Callback()); - - class_metadata::maybe_register_class_to_python((T2*)0, is_noncopyable()); - - class_metadata::maybe_register_pointer_to_python( - (T2*)0, (use_value_holder*)0, (use_back_reference*)0); - } - - - // - // Support for converting smart pointers to python - // - inline static void maybe_register_pointer_to_python(...) {} - -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) - { - objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T const &> >()); - objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T &> >()); - } -#endif - - template <class T2> - inline static void maybe_register_pointer_to_python(T2*, mpl::false_*, mpl::false_*) - { - python::detail::force_instantiate( - objects::class_value_wrapper< - held_type - , make_ptr_instance<T2, pointer_holder<held_type, T2> > - >() - ); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - // explicit qualification of type_id makes msvc6 happy - objects::copy_class_object(python::type_id<T2>(), python::type_id<held_type>()); -#endif - } - // - // Support for registering to-python converters - // - inline static void maybe_register_class_to_python(void*, mpl::true_) {} - - - template <class T2> - inline static void maybe_register_class_to_python(T2*, mpl::false_) - { - python::detail::force_instantiate(class_cref_wrapper<T2, make_instance<T2, holder> >()); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - // explicit qualification of type_id makes msvc6 happy - objects::copy_class_object(python::type_id<T2>(), python::type_id<held_type>()); -#endif - } - - // - // Support for registering callback classes - // - inline static void maybe_register_callback_class(void*, mpl::false_) {} - - template <class T2> - inline static void maybe_register_callback_class(T2*, mpl::true_) - { - objects::register_shared_ptr_from_python_and_casts( - (wrapped*)0, mpl::single_view<T2>()); - // explicit qualification of type_id makes msvc6 happy - objects::copy_class_object(python::type_id<T2>(), python::type_id<wrapped>()); - } -}; - -}}} // namespace boost::python::object - -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/object/class_wrapper.hpp b/contrib/restricted/boost/python/include/boost/python/object/class_wrapper.hpp deleted file mode 100644 index ffee7457abf..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/class_wrapper.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright David Abrahams 2001. -// 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 CLASS_WRAPPER_DWA20011221_HPP -# define CLASS_WRAPPER_DWA20011221_HPP - -# include <boost/python/to_python_converter.hpp> -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif -# include <boost/ref.hpp> - -namespace boost { namespace python { namespace objects { - -// -// These two classes adapt the static execute function of a class -// MakeInstance execute() function returning a new PyObject* -// reference. The first one is used for class copy constructors, and -// the second one is used to handle smart pointers. -// - -template <class Src, class MakeInstance> -struct class_cref_wrapper - : to_python_converter<Src,class_cref_wrapper<Src,MakeInstance> ,true> -{ - static PyObject* convert(Src const& x) - { - return MakeInstance::execute(boost::ref(x)); - } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - static PyTypeObject const *get_pytype() { return converter::registered_pytype_direct<Src>::get_pytype(); } -#endif -}; - -template <class Src, class MakeInstance> -struct class_value_wrapper - : to_python_converter<Src,class_value_wrapper<Src,MakeInstance> ,true> -{ - static PyObject* convert(Src x) - { - return MakeInstance::execute(x); - } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - static PyTypeObject const *get_pytype() { return MakeInstance::get_pytype(); } -#endif -}; - -}}} // namespace boost::python::objects - -#endif // CLASS_WRAPPER_DWA20011221_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/object/iterator.hpp b/contrib/restricted/boost/python/include/boost/python/object/iterator.hpp deleted file mode 100644 index 874950365de..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/iterator.hpp +++ /dev/null @@ -1,227 +0,0 @@ -// 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 ITERATOR_DWA2002510_HPP -# define ITERATOR_DWA2002510_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/type_traits.hpp> - -# include <boost/python/class.hpp> -# include <boost/python/return_value_policy.hpp> -# include <boost/python/return_by_value.hpp> -# include <boost/python/handle.hpp> -# include <boost/python/make_function.hpp> - -# include <boost/python/object/iterator_core.hpp> -# include <boost/python/object/class_detail.hpp> -# include <boost/python/object/function_object.hpp> - -# include <boost/mpl/vector/vector10.hpp> -# include <boost/mpl/if.hpp> - -# include <boost/python/detail/raw_pyobject.hpp> - -# include <boost/type.hpp> - -# include <iterator> - -namespace boost { namespace python { namespace objects { - -// CallPolicies for the next() method of iterators. We don't want -// users to have to explicitly specify that the references returned by -// iterators are copied, so we just replace the result_converter from -// the default_iterator_call_policies with a permissive one which -// always copies the result. -typedef return_value_policy<return_by_value> default_iterator_call_policies; - -// Instantiations of these are wrapped to produce Python iterators. -template <class NextPolicies, class Iterator> -struct iterator_range -{ - iterator_range(object sequence, Iterator start, Iterator finish); - - typedef std::iterator_traits<Iterator> traits_t; - - struct next - { - typedef typename mpl::if_< - is_reference< - typename traits_t::reference - > - , typename traits_t::reference - , typename traits_t::value_type - >::type result_type; - - result_type - operator()(iterator_range<NextPolicies,Iterator>& self) - { - if (self.m_start == self.m_finish) - stop_iteration_error(); - return *self.m_start++; - } - -# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) - // CWPro8 has a codegen problem when this is an empty class - int garbage; -# endif - }; - - typedef next next_fn; - - object m_sequence; // Keeps the sequence alive while iterating. - Iterator m_start; - Iterator m_finish; -}; - -namespace detail -{ - // Get a Python class which contains the given iterator and - // policies, creating it if necessary. Requires: NextPolicies is - // default-constructible. - template <class Iterator, class NextPolicies> - object demand_iterator_class(char const* name, Iterator* = 0, NextPolicies const& policies = NextPolicies()) - { - typedef iterator_range<NextPolicies,Iterator> range_; - - // Check the registry. If one is already registered, return it. - handle<> class_obj( - objects::registered_class_object(python::type_id<range_>())); - - if (class_obj.get() != 0) - return object(class_obj); - - typedef typename range_::next_fn next_fn; - typedef typename next_fn::result_type result_type; - - return class_<range_>(name, no_init) - .def("__iter__", identity_function()) - .def( -#if PY_VERSION_HEX >= 0x03000000 - "__next__" -#else - "next" -#endif - , make_function( - next_fn() - , policies - , mpl::vector2<result_type,range_&>() - )); - } - - // A function object which builds an iterator_range. - template < - class Target - , class Iterator - , class Accessor1 - , class Accessor2 - , class NextPolicies - > - struct py_iter_ - { - py_iter_(Accessor1 const& get_start, Accessor2 const& get_finish) - : m_get_start(get_start) - , m_get_finish(get_finish) - {} - - // Extract an object x of the Target type from the first Python - // argument, and invoke get_start(x)/get_finish(x) to produce - // iterators, which are used to construct a new iterator_range<> - // object that gets wrapped into a Python iterator. - iterator_range<NextPolicies,Iterator> - operator()(back_reference<Target&> x) const - { - // Make sure the Python class is instantiated. - detail::demand_iterator_class("iterator", (Iterator*)0, NextPolicies()); - - return iterator_range<NextPolicies,Iterator>( - x.source() - , m_get_start(x.get()) - , m_get_finish(x.get()) - ); - } - private: - Accessor1 m_get_start; - Accessor2 m_get_finish; - }; - - template <class Target, class Iterator, class NextPolicies, class Accessor1, class Accessor2> - inline object make_iterator_function( - Accessor1 const& get_start - , Accessor2 const& get_finish - , NextPolicies const& /*next_policies*/ - , Iterator const& (*)() - , boost::type<Target>* - , int - ) - { - return make_function( - py_iter_<Target,Iterator,Accessor1,Accessor2,NextPolicies>(get_start, get_finish) - , default_call_policies() - , mpl::vector2<iterator_range<NextPolicies,Iterator>, back_reference<Target&> >() - ); - } - - template <class Target, class Iterator, class NextPolicies, class Accessor1, class Accessor2> - inline object make_iterator_function( - Accessor1 const& get_start - , Accessor2 const& get_finish - , NextPolicies const& next_policies - , Iterator& (*)() - , boost::type<Target>* - , ...) - { - return make_iterator_function( - get_start - , get_finish - , next_policies - , (Iterator const&(*)())0 - , (boost::type<Target>*)0 - , 0 - ); - } - -} - -// Create a Python callable object which accepts a single argument -// convertible to the C++ Target type and returns a Python -// iterator. The Python iterator uses get_start(x) and get_finish(x) -// (where x is an instance of Target) to produce begin and end -// iterators for the range, and an instance of NextPolicies is used as -// CallPolicies for the Python iterator's next() function. -template <class Target, class NextPolicies, class Accessor1, class Accessor2> -inline object make_iterator_function( - Accessor1 const& get_start - , Accessor2 const& get_finish - , NextPolicies const& next_policies - , boost::type<Target>* = 0 -) -{ - typedef typename Accessor1::result_type iterator; - typedef typename boost::python::detail::add_const<iterator>::type iterator_const; - typedef typename boost::python::detail::add_lvalue_reference<iterator_const>::type iterator_cref; - - return detail::make_iterator_function( - get_start - , get_finish - , next_policies - , (iterator_cref(*)())0 - , (boost::type<Target>*)0 - , 0 - ); -} - -// -// implementation -// -template <class NextPolicies, class Iterator> -inline iterator_range<NextPolicies,Iterator>::iterator_range( - object sequence, Iterator start, Iterator finish) - : m_sequence(sequence), m_start(start), m_finish(finish) -{ -} - -}}} // namespace boost::python::objects - -#endif // ITERATOR_DWA2002510_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/object/make_holder.hpp b/contrib/restricted/boost/python/include/boost/python/object/make_holder.hpp deleted file mode 100644 index 735e5395caf..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/make_holder.hpp +++ /dev/null @@ -1,110 +0,0 @@ -#if !defined(BOOST_PP_IS_ITERATING) - -// Copyright David Abrahams 2001. -// 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 MAKE_HOLDER_DWA20011215_HPP -# define MAKE_HOLDER_DWA20011215_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/object/instance.hpp> -# include <boost/python/converter/registry.hpp> -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) -# include <boost/python/detail/python_type.hpp> -#endif - -# include <boost/python/object/forward.hpp> -# include <boost/python/detail/preprocessor.hpp> - -# include <boost/mpl/next.hpp> -# include <boost/mpl/begin_end.hpp> -# include <boost/mpl/deref.hpp> - -# include <boost/preprocessor/iterate.hpp> -# include <boost/preprocessor/iteration/local.hpp> -# include <boost/preprocessor/repeat.hpp> -# include <boost/preprocessor/debug/line.hpp> -# include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> - -# include <cstddef> - -namespace boost { namespace python { namespace objects { - -template <int nargs> struct make_holder; - -# define BOOST_PYTHON_DO_FORWARD_ARG(z, index, _) , f##index(a##index) - -// specializations... -# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/object/make_holder.hpp>)) -# include BOOST_PP_ITERATE() - -# undef BOOST_PYTHON_DO_FORWARD_ARG - -}}} // namespace boost::python::objects - -# endif // MAKE_HOLDER_DWA20011215_HPP - -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, make_holder.hpp) -# endif - -# define N BOOST_PP_ITERATION() - -template <> -struct make_holder<N> -{ - template <class Holder, class ArgList> - struct apply - { -# if N - // Unrolled iteration through each argument type in ArgList, - // choosing the type that will be forwarded on to the holder's - // templated constructor. - typedef typename mpl::begin<ArgList>::type iter0; - -# define BOOST_PP_LOCAL_MACRO(n) \ - typedef typename mpl::deref<iter##n>::type t##n; \ - typedef typename forward<t##n>::type f##n; \ - typedef typename mpl::next<iter##n>::type \ - BOOST_PP_CAT(iter,BOOST_PP_INC(n)); // Next iterator type - -# define BOOST_PP_LOCAL_LIMITS (0, N-1) -# include BOOST_PP_LOCAL_ITERATE() -# endif - - static void execute( -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) - boost::python::detail::python_class<BOOST_DEDUCED_TYPENAME Holder::value_type> *p -#else - PyObject *p -#endif - BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, t, a)) - { - typedef instance<Holder> instance_t; - - void* memory = Holder::allocate(p, offsetof(instance_t, storage), sizeof(Holder), - boost::python::detail::alignment_of<Holder>::value); - try { - (new (memory) Holder( - p BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_DO_FORWARD_ARG, nil)))->install(p); - } - catch(...) { - Holder::deallocate(p, memory); - throw; - } - } - }; -}; - -# undef N - -#endif // BOOST_PP_ITERATION_DEPTH() -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/object/value_holder.hpp b/contrib/restricted/boost/python/include/boost/python/object/value_holder.hpp deleted file mode 100644 index a4e91786d12..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/value_holder.hpp +++ /dev/null @@ -1,166 +0,0 @@ -#if !defined(BOOST_PP_IS_ITERATING) - -// Copyright David Abrahams 2001. -// 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 VALUE_HOLDER_DWA20011215_HPP -# define VALUE_HOLDER_DWA20011215_HPP - -# include <boost/python/object/value_holder_fwd.hpp> - -# include <boost/python/instance_holder.hpp> -# include <boost/python/type_id.hpp> -# include <boost/python/wrapper.hpp> - -# include <boost/python/object/inheritance_query.hpp> -# include <boost/python/object/forward.hpp> - -# include <boost/python/detail/force_instantiate.hpp> -# include <boost/python/detail/preprocessor.hpp> - -# include <boost/preprocessor/comma_if.hpp> -# include <boost/preprocessor/enum_params.hpp> -# include <boost/preprocessor/iterate.hpp> -# include <boost/preprocessor/repeat.hpp> -# include <boost/preprocessor/debug/line.hpp> - -# include <boost/preprocessor/repetition/enum_params.hpp> -# include <boost/preprocessor/repetition/enum_binary_params.hpp> - -# include <boost/utility/addressof.hpp> - -namespace boost { namespace python { namespace objects { - -#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) - -template <class Value> -struct value_holder : instance_holder -{ - typedef Value held_type; - typedef Value value_type; - - // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/object/value_holder.hpp>, 1)) -# include BOOST_PP_ITERATE() - - private: // required holder implementation - void* holds(type_info, bool null_ptr_only); - - template <class T> - inline void* holds_wrapped(type_info dst_t, wrapper<T>*,T* p) - { - return python::type_id<T>() == dst_t ? p : 0; - } - - inline void* holds_wrapped(type_info, ...) - { - return 0; - } - private: // data members - Value m_held; -}; - -template <class Value, class Held> -struct value_holder_back_reference : instance_holder -{ - typedef Held held_type; - typedef Value value_type; - - // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/object/value_holder.hpp>, 2)) -# include BOOST_PP_ITERATE() - -private: // required holder implementation - void* holds(type_info, bool null_ptr_only); - - private: // data members - Held m_held; -}; - -# undef BOOST_PYTHON_UNFORWARD_LOCAL - -template <class Value> -void* value_holder<Value>::holds(type_info dst_t, bool /*null_ptr_only*/) -{ - if (void* wrapped = holds_wrapped(dst_t, boost::addressof(m_held), boost::addressof(m_held))) - return wrapped; - - type_info src_t = python::type_id<Value>(); - return src_t == dst_t ? boost::addressof(m_held) - : find_static_type(boost::addressof(m_held), src_t, dst_t); -} - -template <class Value, class Held> -void* value_holder_back_reference<Value,Held>::holds( - type_info dst_t, bool /*null_ptr_only*/) -{ - type_info src_t = python::type_id<Value>(); - Value* x = &m_held; - - if (dst_t == src_t) - return x; - else if (dst_t == python::type_id<Held>()) - return &m_held; - else - return find_static_type(x, src_t, dst_t); -} - -}}} // namespace boost::python::objects - -# endif // VALUE_HOLDER_DWA20011215_HPP - -// --------------- value_holder --------------- - -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, value_holder.hpp(value_holder)) -# endif - -# define N BOOST_PP_ITERATION() - -# if (N != 0) - template <BOOST_PP_ENUM_PARAMS_Z(1, N, class A)> -# endif - value_holder( - PyObject* self BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) - : m_held( - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) - ) - { - python::detail::initialize_wrapper(self, boost::addressof(this->m_held)); - } - -# undef N - -// --------------- value_holder_back_reference --------------- - -#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 2 -# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# line BOOST_PP_LINE(__LINE__, value_holder.hpp(value_holder_back_reference)) -# endif - -# define N BOOST_PP_ITERATION() - -# if (N != 0) - template <BOOST_PP_ENUM_PARAMS_Z(1, N, class A)> -# endif - value_holder_back_reference( - PyObject* p BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) - : m_held( - p BOOST_PP_COMMA_IF(N) - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) - ) - { - } - -# undef N - -#endif // BOOST_PP_ITERATION_DEPTH() -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/object/value_holder_fwd.hpp b/contrib/restricted/boost/python/include/boost/python/object/value_holder_fwd.hpp deleted file mode 100644 index 3454bac426f..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/object/value_holder_fwd.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// 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 VALUE_HOLDER_FWD_DWA2002311_HPP -# define VALUE_HOLDER_FWD_DWA2002311_HPP - -namespace boost { namespace python { namespace objects { - -struct no_back_reference; - -template <class CallbackType = no_back_reference> struct value_holder_generator; - -}}} // namespace boost::python::object - -#endif // VALUE_HOLDER_FWD_DWA2002311_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/opaque_pointer_converter.hpp b/contrib/restricted/boost/python/include/boost/python/opaque_pointer_converter.hpp deleted file mode 100644 index 701b13dc30e..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/opaque_pointer_converter.hpp +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright Gottfried Ganßauge 2003..2006. -// 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) -/* - * Generic Conversion of opaque C++-pointers to a Python-Wrapper. - */ -# ifndef OPAQUE_POINTER_CONVERTER_HPP_ -# define OPAQUE_POINTER_CONVERTER_HPP_ - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/lvalue_from_pytype.hpp> -# include <boost/python/to_python_converter.hpp> -# include <boost/python/converter/registrations.hpp> -# include <boost/python/detail/dealloc.hpp> -# include <boost/python/detail/type_traits.hpp> -# include <boost/python/detail/none.hpp> -# include <boost/python/type_id.hpp> -# include <boost/python/errors.hpp> - -# include <boost/implicit_cast.hpp> - -# include <boost/mpl/eval_if.hpp> -# include <boost/mpl/identity.hpp> -# include <boost/mpl/assert.hpp> - -// opaque -- -// -// registers to- and from- python conversions for a type Pointee. -// -// Note: -// In addition you need to define specializations for type_id -// on the type pointed to by Pointer using -// BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) -// -// For an example see libs/python/test/opaque.cpp -// -namespace boost { namespace python { - -template <class Pointee> -struct opaque -{ - opaque() - { - if (type_object.tp_name == 0) - { - type_object.tp_name = const_cast<char*>(type_id<Pointee*>().name()); - if (PyType_Ready (&type_object) < 0) - { - throw error_already_set(); - } - - this->register_self(); - } - } - - static opaque instance; -private: - - static void* extract(PyObject* op) - { - return PyObject_TypeCheck(op, &type_object) - ? static_cast<python_instance*>(implicit_cast<void*>(op))->x - : 0 - ; - } - - static PyObject* wrap(void const* px) - { - Pointee* x = *static_cast<Pointee*const*>(px); - - if (x == 0) - return detail::none(); - - if ( python_instance *o = PyObject_New(python_instance, &type_object) ) - { - o->x = x; - return static_cast<PyObject*>(implicit_cast<void*>(o)); - } - else - { - throw error_already_set(); - } - } - - void register_self() - { - converter::registration const *existing = - converter::registry::query (type_id<Pointee*>()); - - if ((existing == 0) || (existing->m_to_python == 0)) - { -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - converter::registry::insert(&extract, type_id<Pointee>(), &get_pytype); - converter::registry::insert(&wrap, type_id<Pointee*>(), &get_pytype); -#else - converter::registry::insert(&extract, type_id<Pointee>()); - converter::registry::insert(&wrap, type_id<Pointee*>()); -#endif - } - } - - struct python_instance - { - PyObject_HEAD - Pointee* x; - }; - - static PyTypeObject type_object; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - static PyTypeObject const *get_pytype(){return &type_object; } -#endif -}; - -template <class Pointee> -opaque<Pointee> opaque<Pointee>::instance; - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -template <class Pointee> -PyTypeObject opaque<Pointee>::type_object = -{ - PyVarObject_HEAD_INIT(NULL, 0) - 0, - sizeof( BOOST_DEDUCED_TYPENAME opaque<Pointee>::python_instance ), - 0, - ::boost::python::detail::dealloc, - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - 0, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#if PYTHON_API_VERSION >= 1012 - 0 /* tp_del */ -#endif -}; - -#pragma GCC diagnostic pop - -}} // namespace boost::python - -// If you change the below, don't forget to alter the end of type_id.hpp -# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ - namespace boost { namespace python { \ - template<> \ - inline type_info type_id<Pointee>() \ - { \ - return type_info (typeid (Pointee *)); \ - } \ - template<> \ - inline type_info type_id<const volatile Pointee&>() \ - { \ - return type_info (typeid (Pointee *)); \ - } \ - }} - -# endif // OPAQUE_POINTER_CONVERTER_HPP_ diff --git a/contrib/restricted/boost/python/include/boost/python/operators.hpp b/contrib/restricted/boost/python/include/boost/python/operators.hpp deleted file mode 100644 index ea2be7b98f6..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/operators.hpp +++ /dev/null @@ -1,374 +0,0 @@ -// 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 OPERATORS_DWA2002530_HPP -# define OPERATORS_DWA2002530_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/def_visitor.hpp> -# include <boost/python/converter/arg_to_python.hpp> -# include <boost/python/detail/operator_id.hpp> -# include <boost/python/detail/not_specified.hpp> -# include <boost/python/back_reference.hpp> -# include <boost/mpl/if.hpp> -# include <boost/mpl/eval_if.hpp> -# include <boost/python/self.hpp> -# include <boost/python/other.hpp> -# include <boost/lexical_cast.hpp> -# include <boost/python/refcount.hpp> -# include <boost/python/detail/unwrap_wrapper.hpp> -# include <string> -# include <complex> - -namespace boost { namespace python { - -namespace detail -{ - // This is essentially the old v1 to_python(). It will be eliminated - // once the public interface for to_python is settled on. - template <class T> - PyObject* convert_result(T const& x) - { - return converter::arg_to_python<T>(x).release(); - } - - // Operator implementation template declarations. The nested apply - // declaration here keeps MSVC6 happy. - template <operator_id> struct operator_l - { - template <class L, class R> struct apply; - }; - - template <operator_id> struct operator_r - { - template <class L, class R> struct apply; - }; - - template <operator_id> struct operator_1 - { - template <class T> struct apply; - }; - - // MSVC6 doesn't want us to do this sort of inheritance on a nested - // class template, so we use this layer of indirection to avoid - // ::template<...> on the nested apply functions below - template <operator_id id, class L, class R> - struct operator_l_inner - : operator_l<id>::template apply<L,R> - {}; - - template <operator_id id, class L, class R> - struct operator_r_inner - : operator_r<id>::template apply<L,R> - {}; - - template <operator_id id, class T> - struct operator_1_inner - : operator_1<id>::template apply<T> - {}; - - // Define three different binary_op templates which take care of - // these cases: - // self op self - // self op R - // L op self - // - // The inner apply metafunction is used to adjust the operator to - // the class type being defined. Inheritance of the outer class is - // simply used to provide convenient access to the operation's - // name(). - - // self op self - template <operator_id id> - struct binary_op : operator_l<id> - { - template <class T> - struct apply : operator_l_inner<id,T,T> - { - }; - }; - - // self op R - template <operator_id id, class R> - struct binary_op_l : operator_l<id> - { - template <class T> - struct apply : operator_l_inner<id,T,R> - { - }; - }; - - // L op self - template <operator_id id, class L> - struct binary_op_r : operator_r<id> - { - template <class T> - struct apply : operator_r_inner<id,L,T> - { - }; - }; - - template <operator_id id> - struct unary_op : operator_1<id> - { - template <class T> - struct apply : operator_1_inner<id,T> - { - }; - }; - - // This type is what actually gets returned from operators used on - // self_t - template <operator_id id, class L = not_specified, class R = not_specified> - struct operator_ - : def_visitor<operator_<id,L,R> > - { - private: - template <class ClassT> - void visit(ClassT& cl) const - { - typedef typename mpl::eval_if< - is_same<L,self_t> - , mpl::if_< - is_same<R,self_t> - , binary_op<id> - , binary_op_l< - id - , BOOST_DEDUCED_TYPENAME unwrap_other<R>::type - > - > - , mpl::if_< - is_same<L,not_specified> - , unary_op<id> - , binary_op_r< - id - , BOOST_DEDUCED_TYPENAME unwrap_other<L>::type - > - > - >::type generator; - - cl.def( - generator::name() - , &generator::template apply< - BOOST_DEDUCED_TYPENAME ClassT::wrapped_type - >::execute - ); - } - - friend class python::def_visitor_access; - }; -} - -# define BOOST_PYTHON_BINARY_OPERATION(id, rid, expr) \ -namespace detail \ -{ \ - template <> \ - struct operator_l<op_##id> \ - { \ - template <class L, class R> \ - struct apply \ - { \ - typedef typename unwrap_wrapper_<L>::type lhs; \ - typedef typename unwrap_wrapper_<R>::type rhs; \ - static PyObject* execute(lhs& l, rhs const& r) \ - { \ - return detail::convert_result(expr); \ - } \ - }; \ - static char const* name() { return "__" #id "__"; } \ - }; \ - \ - template <> \ - struct operator_r<op_##id> \ - { \ - template <class L, class R> \ - struct apply \ - { \ - typedef typename unwrap_wrapper_<L>::type lhs; \ - typedef typename unwrap_wrapper_<R>::type rhs; \ - static PyObject* execute(rhs& r, lhs const& l) \ - { \ - return detail::convert_result(expr); \ - } \ - }; \ - static char const* name() { return "__" #rid "__"; } \ - }; \ -} - -# define BOOST_PYTHON_BINARY_OPERATOR(id, rid, op) \ -BOOST_PYTHON_BINARY_OPERATION(id, rid, l op r) \ -namespace self_ns \ -{ \ - template <class L, class R> \ - inline detail::operator_<detail::op_##id,L,R> \ - operator op(L const&, R const&) \ - { \ - return detail::operator_<detail::op_##id,L,R>(); \ - } \ -} - -BOOST_PYTHON_BINARY_OPERATOR(add, radd, +) -BOOST_PYTHON_BINARY_OPERATOR(sub, rsub, -) -BOOST_PYTHON_BINARY_OPERATOR(mul, rmul, *) -#if PY_VERSION_HEX >= 0x03000000 - BOOST_PYTHON_BINARY_OPERATOR(truediv, rtruediv, /) -#else - BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) -#endif -BOOST_PYTHON_BINARY_OPERATOR(mod, rmod, %) -BOOST_PYTHON_BINARY_OPERATOR(lshift, rlshift, <<) -BOOST_PYTHON_BINARY_OPERATOR(rshift, rrshift, >>) -BOOST_PYTHON_BINARY_OPERATOR(and, rand, &) -BOOST_PYTHON_BINARY_OPERATOR(xor, rxor, ^) -BOOST_PYTHON_BINARY_OPERATOR(or, ror, |) -BOOST_PYTHON_BINARY_OPERATOR(gt, lt, >) -BOOST_PYTHON_BINARY_OPERATOR(ge, le, >=) -BOOST_PYTHON_BINARY_OPERATOR(lt, gt, <) -BOOST_PYTHON_BINARY_OPERATOR(le, ge, <=) -BOOST_PYTHON_BINARY_OPERATOR(eq, eq, ==) -BOOST_PYTHON_BINARY_OPERATOR(ne, ne, !=) -# undef BOOST_PYTHON_BINARY_OPERATOR - -// pow isn't an operator in C++; handle it specially. -BOOST_PYTHON_BINARY_OPERATION(pow, rpow, pow(l,r)) -# undef BOOST_PYTHON_BINARY_OPERATION - -namespace self_ns -{ -# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP - template <class L, class R> - inline detail::operator_<detail::op_pow,L,R> - pow(L const&, R const&) - { - return detail::operator_<detail::op_pow,L,R>(); - } -# else - // When there's no argument-dependent lookup, we need these - // overloads to handle the case when everything is imported into the - // global namespace. Note that the plain overload below does /not/ - // take const& arguments. This is needed by MSVC6 at least, or it - // complains of ambiguities, since there's no partial ordering. - inline detail::operator_<detail::op_pow,self_t,self_t> - pow(self_t, self_t) - { - return detail::operator_<detail::op_pow,self_t,self_t>(); - } - template <class R> - inline detail::operator_<detail::op_pow,self_t,R> - pow(self_t const&, R const&) - { - return detail::operator_<detail::op_pow,self_t,R>(); - } - template <class L> - inline detail::operator_<detail::op_pow,L,self_t> - pow(L const&, self_t const&) - { - return detail::operator_<detail::op_pow,L,self_t>(); - } -# endif -} - - -# define BOOST_PYTHON_INPLACE_OPERATOR(id, op) \ -namespace detail \ -{ \ - template <> \ - struct operator_l<op_##id> \ - { \ - template <class L, class R> \ - struct apply \ - { \ - typedef typename unwrap_wrapper_<L>::type lhs; \ - typedef typename unwrap_wrapper_<R>::type rhs; \ - static PyObject* \ - execute(back_reference<lhs&> l, rhs const& r) \ - { \ - l.get() op r; \ - return python::incref(l.source().ptr()); \ - } \ - }; \ - static char const* name() { return "__" #id "__"; } \ - }; \ -} \ -namespace self_ns \ -{ \ - template <class R> \ - inline detail::operator_<detail::op_##id,self_t,R> \ - operator op(self_t const&, R const&) \ - { \ - return detail::operator_<detail::op_##id,self_t,R>(); \ - } \ -} - -BOOST_PYTHON_INPLACE_OPERATOR(iadd,+=) -BOOST_PYTHON_INPLACE_OPERATOR(isub,-=) -BOOST_PYTHON_INPLACE_OPERATOR(imul,*=) -BOOST_PYTHON_INPLACE_OPERATOR(idiv,/=) -BOOST_PYTHON_INPLACE_OPERATOR(imod,%=) -BOOST_PYTHON_INPLACE_OPERATOR(ilshift,<<=) -BOOST_PYTHON_INPLACE_OPERATOR(irshift,>>=) -BOOST_PYTHON_INPLACE_OPERATOR(iand,&=) -BOOST_PYTHON_INPLACE_OPERATOR(ixor,^=) -BOOST_PYTHON_INPLACE_OPERATOR(ior,|=) - -# define BOOST_PYTHON_UNARY_OPERATOR(id, op, func_name) \ -namespace detail \ -{ \ - template <> \ - struct operator_1<op_##id> \ - { \ - template <class T> \ - struct apply \ - { \ - typedef typename unwrap_wrapper_<T>::type self_t; \ - static PyObject* execute(self_t& x) \ - { \ - return detail::convert_result(op(x)); \ - } \ - }; \ - static char const* name() { return "__" #id "__"; } \ - }; \ -} \ -namespace self_ns \ -{ \ - inline detail::operator_<detail::op_##id> \ - func_name(self_t const&) \ - { \ - return detail::operator_<detail::op_##id>(); \ - } \ -} -# undef BOOST_PYTHON_INPLACE_OPERATOR - -BOOST_PYTHON_UNARY_OPERATOR(neg, -, operator-) -BOOST_PYTHON_UNARY_OPERATOR(pos, +, operator+) -BOOST_PYTHON_UNARY_OPERATOR(abs, abs, abs) -BOOST_PYTHON_UNARY_OPERATOR(invert, ~, operator~) -#if PY_VERSION_HEX >= 0x03000000 -BOOST_PYTHON_UNARY_OPERATOR(bool, !!, operator!) -#else -BOOST_PYTHON_UNARY_OPERATOR(nonzero, !!, operator!) -#endif -BOOST_PYTHON_UNARY_OPERATOR(int, long, int_) -BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) -BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) -BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex<double>, complex_) -BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast<std::string>, str) -BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast<std::string>, repr) -# undef BOOST_PYTHON_UNARY_OPERATOR - -}} // namespace boost::python - -# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -using boost::python::self_ns::abs; -using boost::python::self_ns::int_; -using boost::python::self_ns::long_; -using boost::python::self_ns::float_; -using boost::python::self_ns::complex_; -using boost::python::self_ns::str; -using boost::python::self_ns::repr; -using boost::python::self_ns::pow; -# endif - -#endif // OPERATORS_DWA2002530_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/other.hpp b/contrib/restricted/boost/python/include/boost/python/other.hpp deleted file mode 100644 index 26ebb426ba9..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/other.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef BOOST_PYTHON_OTHER_HPP -# define BOOST_PYTHON_OTHER_HPP - -# include <boost/python/detail/prefix.hpp> -// 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) - -# include <boost/config.hpp> - -namespace boost { namespace python { - -template<class T> struct other -{ - typedef T type; -}; - -namespace detail -{ - template<typename T> - class is_other - { - public: - BOOST_STATIC_CONSTANT(bool, value = false); - }; - - template<typename T> - class is_other<other<T> > - { - public: - BOOST_STATIC_CONSTANT(bool, value = true); - }; - - template<typename T> - class unwrap_other - { - public: - typedef T type; - }; - - template<typename T> - class unwrap_other<other<T> > - { - public: - typedef T type; - }; -} - -}} // namespace boost::python - -#endif diff --git a/contrib/restricted/boost/python/include/boost/python/overloads.hpp b/contrib/restricted/boost/python/include/boost/python/overloads.hpp deleted file mode 100644 index e60dc1798e9..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/overloads.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// 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 OVERLOADS_DWA2002101_HPP -# define OVERLOADS_DWA2002101_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/detail/overloads_fwd.hpp> -# include <boost/python/detail/defaults_def.hpp> - -#endif // OVERLOADS_DWA2002101_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/pure_virtual.hpp b/contrib/restricted/boost/python/include/boost/python/pure_virtual.hpp deleted file mode 100644 index 58e9aedef1b..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/pure_virtual.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright David Abrahams 2003. -// 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 PURE_VIRTUAL_DWA2003810_HPP -# define PURE_VIRTUAL_DWA2003810_HPP - -# include <boost/python/def_visitor.hpp> -# include <boost/python/default_call_policies.hpp> -# include <boost/mpl/push_front.hpp> -# include <boost/mpl/pop_front.hpp> - -# include <boost/python/detail/nullary_function_adaptor.hpp> - -namespace boost { namespace python { - -namespace detail -{ - // - // @group Helpers for pure_virtual_visitor. { - // - - // Raises a Python RuntimeError reporting that a pure virtual - // function was called. - void BOOST_PYTHON_DECL pure_virtual_called(); - - // Replace the two front elements of S with T1 and T2 - template <class S, class T1, class T2> - struct replace_front2 - { - // Metafunction forwarding seemed to confound vc6 - typedef typename mpl::push_front< - typename mpl::push_front< - typename mpl::pop_front< - typename mpl::pop_front< - S - >::type - >::type - , T2 - >::type - , T1 - >::type type; - }; - - // Given an MPL sequence representing a member function [object] - // signature, returns a new MPL sequence whose return type is - // replaced by void, and whose first argument is replaced by C&. - template <class C, class S> - typename replace_front2<S,void,C&>::type - error_signature(S) - { - typedef typename replace_front2<S,void,C&>::type r; - return r(); - } - - // - // } - // - - // - // A def_visitor which defines a method as usual, then adds a - // corresponding function which raises a "pure virtual called" - // exception unless it's been overridden. - // - template <class PointerToMemberFunction> - struct pure_virtual_visitor - : def_visitor<pure_virtual_visitor<PointerToMemberFunction> > - { - pure_virtual_visitor(PointerToMemberFunction pmf) - : m_pmf(pmf) - {} - - private: - friend class python::def_visitor_access; - - template <class C_, class Options> - void visit(C_& c, char const* name, Options& options) const - { - // This should probably be a nicer error message - BOOST_STATIC_ASSERT(!Options::has_default_implementation); - - // Add the virtual function dispatcher - c.def( - name - , m_pmf - , options.doc() - , options.keywords() - , options.policies() - ); - - typedef BOOST_DEDUCED_TYPENAME C_::metadata::held_type held_type; - - // Add the default implementation which raises the exception - c.def( - name - , make_function( - detail::nullary_function_adaptor<void(*)()>(pure_virtual_called) - , default_call_policies() - , detail::error_signature<held_type>(detail::get_signature(m_pmf)) - ) - ); - } - - private: // data members - PointerToMemberFunction m_pmf; - }; -} - -// -// Passed a pointer to member function, generates a def_visitor which -// creates a method that only dispatches to Python if the function has -// been overridden, either in C++ or in Python, raising a "pure -// virtual called" exception otherwise. -// -template <class PointerToMemberFunction> -detail::pure_virtual_visitor<PointerToMemberFunction> -pure_virtual(PointerToMemberFunction pmf) -{ - return detail::pure_virtual_visitor<PointerToMemberFunction>(pmf); -} - -}} // namespace boost::python - -#endif // PURE_VIRTUAL_DWA2003810_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/raw_function.hpp b/contrib/restricted/boost/python/include/boost/python/raw_function.hpp deleted file mode 100644 index 9d9f6b8b1b2..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/raw_function.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright David Abrahams 2003. -// 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 RAW_FUNCTION_DWA200336_HPP -# define RAW_FUNCTION_DWA200336_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/tuple.hpp> -# include <boost/python/dict.hpp> -# include <boost/python/object/py_function.hpp> -# include <boost/mpl/vector/vector10.hpp> - -# include <boost/limits.hpp> -# include <cstddef> - -namespace boost { namespace python { - -namespace detail -{ - template <class F> - struct raw_dispatcher - { - raw_dispatcher(F f) : f(f) {} - - PyObject* operator()(PyObject* args, PyObject* keywords) - { - return incref( - object( - f( - tuple(borrowed_reference(args)) - , keywords ? dict(borrowed_reference(keywords)) : dict() - ) - ).ptr() - ); - } - - private: - F f; - }; - - object BOOST_PYTHON_DECL make_raw_function(objects::py_function); -} - -template <class F> -object raw_function(F f, std::size_t min_args = 0) -{ - return detail::make_raw_function( - objects::py_function( - detail::raw_dispatcher<F>(f) - , mpl::vector1<PyObject*>() - , min_args - , (std::numeric_limits<unsigned>::max)() - ) - ); -} - -}} // namespace boost::python - -#endif // RAW_FUNCTION_DWA200336_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/reference_existing_object.hpp b/contrib/restricted/boost/python/include/boost/python/reference_existing_object.hpp deleted file mode 100644 index 4c8344070ba..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/reference_existing_object.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// 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 REFERENCE_EXISTING_OBJECT_DWA200222_HPP -# define REFERENCE_EXISTING_OBJECT_DWA200222_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/detail/indirect_traits.hpp> -# include <boost/mpl/if.hpp> -# include <boost/python/to_python_indirect.hpp> -# include <boost/python/detail/type_traits.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class R> - struct reference_existing_object_requires_a_pointer_or_reference_return_type -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; -} - -template <class T> struct to_python_value; - -struct reference_existing_object -{ - template <class T> - struct apply - { - BOOST_STATIC_CONSTANT( - bool, ok = detail::is_pointer<T>::value || detail::is_reference<T>::value); - - typedef typename mpl::if_c< - ok - , to_python_indirect<T, detail::make_reference_holder> - , detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T> - >::type type; - }; -}; - -}} // namespace boost::python - -#endif // REFERENCE_EXISTING_OBJECT_DWA200222_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/register_ptr_to_python.hpp b/contrib/restricted/boost/python/include/boost/python/register_ptr_to_python.hpp deleted file mode 100644 index d39bd0cf71e..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/register_ptr_to_python.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// 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 REGISTER_PTR_TO_PYTHON_HPP -#define REGISTER_PTR_TO_PYTHON_HPP - -#include <boost/python/pointee.hpp> -#include <boost/python/object.hpp> -#include <boost/python/object/class_wrapper.hpp> - -namespace boost { namespace python { - -template <class P> -void register_ptr_to_python() -{ - typedef typename boost::python::pointee<P>::type X; - objects::class_value_wrapper< - P - , objects::make_ptr_instance< - X - , objects::pointer_holder<P,X> - > - >(); -} - -}} // namespace boost::python - -#endif // REGISTER_PTR_TO_PYTHON_HPP - - diff --git a/contrib/restricted/boost/python/include/boost/python/return_arg.hpp b/contrib/restricted/boost/python/include/boost/python/return_arg.hpp deleted file mode 100644 index de239939871..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/return_arg.hpp +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright David Abrahams and Nikolay Mladenov 2003. -// 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 RETURN_ARG_DWA2003719_HPP -# define RETURN_ARG_DWA2003719_HPP -# include <boost/python/default_call_policies.hpp> -# include <boost/python/detail/none.hpp> -# include <boost/python/detail/value_arg.hpp> - -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif - -# include <boost/python/detail/type_traits.hpp> - -# include <boost/mpl/int.hpp> -# include <boost/mpl/at.hpp> - -# include <boost/static_assert.hpp> -# include <boost/python/refcount.hpp> - -# include <cstddef> - -namespace boost { namespace python { - -namespace detail -{ - template <std::size_t> - struct return_arg_pos_argument_must_be_positive -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; - - struct return_none - { - template <class T> struct apply - { - struct type - { - static bool convertible() - { - return true; - } - - PyObject *operator()( typename value_arg<T>::type ) const - { - return none(); - } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - PyTypeObject const *get_pytype() const { return converter::expected_pytype_for_arg<T>::get_pytype() ; } -#endif - }; - }; - }; -} - -template < - std::size_t arg_pos=1 - , class Base = default_call_policies -> -struct return_arg : Base -{ - private: - BOOST_STATIC_CONSTANT(bool, legal = arg_pos > 0); - - public: - typedef typename mpl::if_c< - legal - , detail::return_none - , detail::return_arg_pos_argument_must_be_positive<arg_pos> - // we could default to the base result_converter in case or - // arg_pos==0 since return arg 0 means return result, but I - // think it is better to issue an error instead, cause it can - // lead to confusions - >::type result_converter; - - template <class ArgumentPackage> - static PyObject* postcall(ArgumentPackage const& args, PyObject* result) - { - // In case of arg_pos == 0 we could simply return Base::postcall, - // but this is redundant - BOOST_STATIC_ASSERT(arg_pos > 0); - - result = Base::postcall(args,result); - if (!result) - return 0; - Py_DECREF(result); - return incref( detail::get(mpl::int_<arg_pos-1>(),args) ); - } - - template <class Sig> - struct extract_return_type : mpl::at_c<Sig, arg_pos> - { - }; - -}; - -template < - class Base = default_call_policies - > -struct return_self - : return_arg<1,Base> -{}; - -}} // namespace boost::python - -#endif // RETURN_ARG_DWA2003719_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/return_by_value.hpp b/contrib/restricted/boost/python/include/boost/python/return_by_value.hpp deleted file mode 100644 index 42d7076d175..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/return_by_value.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// 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 BY_VALUE_DWA20021015_HPP -# define BY_VALUE_DWA20021015_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/to_python_value.hpp> -# include <boost/python/detail/type_traits.hpp> - -# include <boost/python/detail/value_arg.hpp> - -namespace boost { namespace python { - -struct return_by_value -{ - template <class R> - struct apply - { - typedef to_python_value< - typename detail::value_arg<R>::type - > type; - }; -}; - -}} // namespace boost::python - -#endif // BY_VALUE_DWA20021015_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/return_internal_reference.hpp b/contrib/restricted/boost/python/include/boost/python/return_internal_reference.hpp deleted file mode 100644 index cc60f4422a6..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/return_internal_reference.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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 RETURN_INTERNAL_REFERENCE_DWA2002131_HPP -# define RETURN_INTERNAL_REFERENCE_DWA2002131_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/default_call_policies.hpp> -# include <boost/python/reference_existing_object.hpp> -# include <boost/python/with_custodian_and_ward.hpp> -# include <boost/mpl/if.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <std::size_t> - struct return_internal_reference_owner_arg_must_be_greater_than_zero -# if defined(__GNUC__) || defined(__EDG__) - {} -# endif - ; -} - -template <std::size_t owner_arg = 1, class BasePolicy_ = default_call_policies> -struct return_internal_reference - : with_custodian_and_ward_postcall<0, owner_arg, BasePolicy_> -{ - private: - BOOST_STATIC_CONSTANT(bool, legal = owner_arg > 0); - public: - typedef typename mpl::if_c< - legal - , reference_existing_object - , detail::return_internal_reference_owner_arg_must_be_greater_than_zero<owner_arg> - >::type result_converter; -}; - -}} // namespace boost::python - -#endif // RETURN_INTERNAL_REFERENCE_DWA2002131_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/return_opaque_pointer.hpp b/contrib/restricted/boost/python/include/boost/python/return_opaque_pointer.hpp deleted file mode 100644 index 4654e3bd512..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/return_opaque_pointer.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Gottfried Ganßauge 2003. -// 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) -/* - * Generic Return value converter generator for opaque C++-pointers - */ -# ifndef RETURN_OPAQUE_POINTER_HPP_ -# define RETURN_OPAQUE_POINTER_HPP_ - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/opaque_pointer_converter.hpp> -# include <boost/python/detail/force_instantiate.hpp> -# include <boost/python/to_python_value.hpp> -# include <boost/python/detail/value_arg.hpp> -# include <boost/mpl/assert.hpp> - -namespace boost { namespace python { - -namespace detail -{ - template <class Pointee> - static void opaque_pointee(Pointee const volatile*) - { - force_instantiate(opaque<Pointee>::instance); - } -} - -struct return_opaque_pointer -{ - template <class R> - struct apply - { - BOOST_MPL_ASSERT_MSG( is_pointer<R>::value, RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE, (R)); - - struct type : - boost::python::to_python_value< - typename detail::value_arg<R>::type - > - { - type() { detail::opaque_pointee(R()); } - }; - }; -}; - -}} // namespace boost::python -# endif // RETURN_OPAQUE_POINTER_HPP_ diff --git a/contrib/restricted/boost/python/include/boost/python/return_value_policy.hpp b/contrib/restricted/boost/python/include/boost/python/return_value_policy.hpp deleted file mode 100644 index 9a5fba380b2..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/return_value_policy.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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 RETURN_VALUE_POLICY_DWA2002131_HPP -# define RETURN_VALUE_POLICY_DWA2002131_HPP - -# include <boost/python/detail/prefix.hpp> -# include <boost/python/default_call_policies.hpp> - -namespace boost { namespace python { - -template <class ResultConverterGenerator, class BasePolicy_ = default_call_policies> -struct return_value_policy : BasePolicy_ -{ - typedef ResultConverterGenerator result_converter; -}; - -}} // namespace boost::python - -#endif // RETURN_VALUE_POLICY_DWA2002131_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/stl_iterator.hpp b/contrib/restricted/boost/python/include/boost/python/stl_iterator.hpp deleted file mode 100644 index 838954879ad..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/stl_iterator.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright Eric Niebler 2005. -// 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 STL_ITERATOR_EAN20051028_HPP -# define STL_ITERATOR_EAN20051028_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/object/stl_iterator_core.hpp> - -# include <boost/iterator/iterator_facade.hpp> - -namespace boost { namespace python -{ - -// An STL input iterator over a python sequence -template<typename ValueT> -struct stl_input_iterator - : boost::iterator_facade< - stl_input_iterator<ValueT> - , ValueT - , std::input_iterator_tag - , ValueT - > -{ - stl_input_iterator() - : impl_() - { - } - - // ob is the python sequence - stl_input_iterator(boost::python::object const &ob) - : impl_(ob) - { - } - -private: - friend class boost::iterator_core_access; - - void increment() - { - this->impl_.increment(); - } - - ValueT dereference() const - { - return extract<ValueT>(this->impl_.current().get())(); - } - - bool equal(stl_input_iterator<ValueT> const &that) const - { - return this->impl_.equal(that.impl_); - } - - objects::stl_input_iterator_impl impl_; -}; - -}} // namespace boost::python - -#endif // STL_ITERATOR_EAN20051028_HPP diff --git a/contrib/restricted/boost/python/include/boost/python/to_python_converter.hpp b/contrib/restricted/boost/python/include/boost/python/to_python_converter.hpp deleted file mode 100644 index 4391b6dce95..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/to_python_converter.hpp +++ /dev/null @@ -1,94 +0,0 @@ -// 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 TO_PYTHON_CONVERTER_DWA200221_HPP -# define TO_PYTHON_CONVERTER_DWA200221_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/converter/registry.hpp> -# include <boost/python/converter/as_to_python_function.hpp> -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -# include <boost/python/converter/pytype_function.hpp> -#endif -# include <boost/python/type_id.hpp> - -namespace boost { namespace python { - -#if 0 //get_pytype member detection -namespace detail -{ - typedef char yes_type; - typedef struct {char a[2]; } no_type; - template<PyTypeObject const * (*f)()> struct test_get_pytype1 { }; - template<PyTypeObject * (*f)()> struct test_get_pytype2 { }; - - template<class T> yes_type tester(test_get_pytype1<&T::get_pytype>*); - - template<class T> yes_type tester(test_get_pytype2<&T::get_pytype>*); - - template<class T> no_type tester(...); - - template<class T> - struct test_get_pytype_base - { - BOOST_STATIC_CONSTANT(bool, value= (sizeof(detail::tester<T>(0)) == sizeof(yes_type))); - }; - - template<class T> - struct test_get_pytype : boost::mpl::bool_<test_get_pytype_base<T>::value> - { - }; - -} -#endif - -template < class T, class Conversion, bool has_get_pytype=false > -struct to_python_converter -{ -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - typedef boost::mpl::bool_<has_get_pytype> HasGetPytype; - - static PyTypeObject const* get_pytype_1(boost::mpl::true_ *) - { - return Conversion::get_pytype(); - } - - static PyTypeObject const* get_pytype_1(boost::mpl::false_ *) - { - return 0; - } - static PyTypeObject const* get_pytype_impl() - { - return get_pytype_1((HasGetPytype*)0); - } -#endif - - to_python_converter(); -}; - -// -// implementation -// - -template <class T, class Conversion ,bool has_get_pytype> -to_python_converter<T,Conversion, has_get_pytype>::to_python_converter() -{ - typedef converter::as_to_python_function< - T, Conversion - > normalized; - - converter::registry::insert( - &normalized::convert - , type_id<T>() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES - , &get_pytype_impl -#endif - ); -} - -}} // namespace boost::python - -#endif // TO_PYTHON_CONVERTER_DWA200221_HPP - diff --git a/contrib/restricted/boost/python/include/boost/python/with_custodian_and_ward.hpp b/contrib/restricted/boost/python/include/boost/python/with_custodian_and_ward.hpp deleted file mode 100644 index 3431c6f22c3..00000000000 --- a/contrib/restricted/boost/python/include/boost/python/with_custodian_and_ward.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// 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 WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP -# define WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP - -# include <boost/python/detail/prefix.hpp> - -# include <boost/python/default_call_policies.hpp> -# include <boost/python/object/life_support.hpp> -# include <algorithm> - -namespace boost { namespace python { - -namespace detail -{ - template <std::size_t N> - struct get_prev - { - template <class ArgumentPackage> - static PyObject* execute(ArgumentPackage const& args, PyObject* = 0) - { - int const pre_n = static_cast<int>(N) - 1; // separate line is gcc-2.96 workaround - return detail::get(mpl::int_<pre_n>(), args); - } - }; - template <> - struct get_prev<0> - { - template <class ArgumentPackage> - static PyObject* execute(ArgumentPackage const&, PyObject* zeroth) - { - return zeroth; - } - }; -} -template < - std::size_t custodian - , std::size_t ward - , class BasePolicy_ = default_call_policies -> -struct with_custodian_and_ward : BasePolicy_ -{ - BOOST_STATIC_ASSERT(custodian != ward); - BOOST_STATIC_ASSERT(custodian > 0); - BOOST_STATIC_ASSERT(ward > 0); - - template <class ArgumentPackage> - static bool precall(ArgumentPackage const& args_) - { - unsigned arity_ = detail::arity(args_); - if (custodian > arity_ || ward > arity_) - { - PyErr_SetString( - PyExc_IndexError - , "boost::python::with_custodian_and_ward: argument index out of range" - ); - return false; - } - - PyObject* patient = detail::get_prev<ward>::execute(args_); - PyObject* nurse = detail::get_prev<custodian>::execute(args_); - - PyObject* life_support = python::objects::make_nurse_and_patient(nurse, patient); - if (life_support == 0) - return false; - - bool result = BasePolicy_::precall(args_); - - if (!result) { - Py_DECREF(life_support); - } - - return result; - } -}; - -template <std::size_t custodian, std::size_t ward, class BasePolicy_ = default_call_policies> -struct with_custodian_and_ward_postcall : BasePolicy_ -{ - BOOST_STATIC_ASSERT(custodian != ward); - - template <class ArgumentPackage> - static PyObject* postcall(ArgumentPackage const& args_, PyObject* result) - { - std::size_t arity_ = detail::arity(args_); - // check if either custodian or ward exceeds the arity - // (this weird formulation avoids "always false" warnings - // for arity_ = 0) - if ( (std::max)(custodian, ward) > arity_ ) - { - PyErr_SetString( - PyExc_IndexError - , "boost::python::with_custodian_and_ward_postcall: argument index out of range" - ); - return 0; - } - - PyObject* patient = detail::get_prev<ward>::execute(args_, result); - PyObject* nurse = detail::get_prev<custodian>::execute(args_, result); - - if (nurse == 0) return 0; - - result = BasePolicy_::postcall(args_, result); - if (result == 0) - return 0; - - if (python::objects::make_nurse_and_patient(nurse, patient) == 0) - { - Py_XDECREF(result); - return 0; - } - return result; - } -}; - - -}} // namespace boost::python - -#endif // WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP |
