diff --git a/include/boost/python/returning.hpp b/include/boost/python/returning.hpp deleted file mode 100644 index c34f97f6..00000000 --- a/include/boost/python/returning.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// (C) Copyright David Abrahams 2001,2002. Permission to copy, use, modify, sell -// and distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// This work was funded in part by Lawrence Berkeley National Labs -// -// This file generated for 5-argument member functions and 6-argument free -// functions by gen_returning.py - -#ifndef RETURNING_DWA20020228_HPP -# define RETURNING_DWA20020228_HPP - -# include -# include -# include -# include - -namespace boost { namespace python { - -// Calling C++ from Python -template -struct returning -{ - static R call(char const* name, PyObject* self) - { - converter::callback_from_python cr; - return cr(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("()") - )); - } - - static R call(PyObject* self) - { - converter::callback_from_python cr; - return cr(PyEval_CallFunction(self, const_cast("()") - )); - } - - template - static R call_method(PyObject* self, const char* name, A1 const& a1) - { - converter::callback_from_python cr; - return cr(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("(O)") - , converter::callback_to_python(a1).get() - )); - } - - template - static R call(PyObject* self, A1 const& a1) - { - converter::callback_from_python cr; - return cr(PyEval_CallFunction( - self - , const_cast("(O)") - , converter::callback_to_python(a1).get() - )); - } - - template - static R call_method(PyObject* self, const char* name, A1 const& a1, A2 const& a2) - { - converter::callback_from_python cr; - return cr(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("(O)") - , converter::callback_to_python(a1).get() - , converter::callback_to_python(a2).get() - )); - } - - template - static R call(PyObject* self, A1 const& a1, A2 const& a2) - { - converter::callback_from_python cr; - return cr(PyEval_CallFunction( - self - , const_cast("(O)") - , converter::callback_to_python(a1).get() - , converter::callback_to_python(a2).get() - )); - } - -}; - -template <> -struct returning -{ - typedef void R; - static R call(char const* name, PyObject* self) - { - ref x(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("()") - )); - } - - static R call(PyObject* self) - { - ref x(PyEval_CallFunction(self, const_cast("()") - )); - } - - template - static R call_method(PyObject* self, const char* name, A1 const& a1) - { - ref x(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("(O)") - , converter::callback_to_python(a1).get() - )); - } - - template - static R call(PyObject* self, A1 const& a1) - { - ref x(PyEval_CallFunction( - self - , const_cast("(O)") - , converter::callback_to_python(a1).get() - )); - } - - template - static R call_method(PyObject* self, const char* name, A1 const& a1, A2 const& a2) - { - ref x(PyEval_CallMethod( - self - , const_cast(name) - , const_cast("(O)") - , converter::callback_to_python(a1).get() - , converter::callback_to_python(a2).get() - )); - } - - template - static R call(PyObject* self, A1 const& a1, A2 const& a2) - { - ref x(PyEval_CallFunction( - self - , const_cast("(O)") - , converter::callback_to_python(a1).get() - , converter::callback_to_python(a2).get() - )); - } -}; - -}} // namespace boost::python - -#endif // RETURNING_DWA20020228_HPP -