mirror of
https://github.com/boostorg/python.git
synced 2026-01-19 16:32:16 +00:00
struct lookup_tag {}; to_python(x, lookup_tag());
[SVN r10226]
This commit is contained in:
@@ -95,7 +95,7 @@ BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
|
||||
// Convert a MillerIndex object to a Python tuple.
|
||||
//
|
||||
PyObject* to_python(python::semantics, const MillerIndex& hkl)
|
||||
PyObject* to_python(const MillerIndex& hkl, python::lookup_tag)
|
||||
{
|
||||
python::tuple result(3);
|
||||
for (int i = 0; i < 3; i++)
|
||||
|
||||
@@ -46,7 +46,7 @@ struct callback
|
||||
template <class A1>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(O)"),
|
||||
p1.get()));
|
||||
@@ -57,7 +57,7 @@ struct callback
|
||||
template <class A1>
|
||||
static R call(PyObject* self, const A1& a1)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(O)"),
|
||||
p1.get()));
|
||||
detail::callback_adjust_refcount(result.get(), type<R>());
|
||||
@@ -67,8 +67,8 @@ struct callback
|
||||
template <class A1, class A2>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OO)"),
|
||||
p1.get(),
|
||||
@@ -80,8 +80,8 @@ struct callback
|
||||
template <class A1, class A2>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OO)"),
|
||||
p1.get(),
|
||||
p2.get()));
|
||||
@@ -92,9 +92,9 @@ struct callback
|
||||
template <class A1, class A2, class A3>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOO)"),
|
||||
p1.get(),
|
||||
@@ -107,9 +107,9 @@ struct callback
|
||||
template <class A1, class A2, class A3>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -121,10 +121,10 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOO)"),
|
||||
p1.get(),
|
||||
@@ -138,10 +138,10 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -154,11 +154,11 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOO)"),
|
||||
p1.get(),
|
||||
@@ -173,11 +173,11 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -191,12 +191,12 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -212,12 +212,12 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -232,13 +232,13 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -255,13 +255,13 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -277,14 +277,14 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -302,14 +302,14 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -326,15 +326,15 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -353,15 +353,15 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -379,16 +379,16 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
static R call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p10(to_python(search_namespace, a10));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref p10(to_python(a10, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -408,16 +408,16 @@ struct callback
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
static R call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p10(to_python(search_namespace, a10));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref p10(to_python(a10, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -455,7 +455,7 @@ struct callback<void>
|
||||
template <class A1>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(O)"),
|
||||
p1.get()));
|
||||
@@ -464,7 +464,7 @@ struct callback<void>
|
||||
template <class A1>
|
||||
static void call(PyObject* self, const A1& a1)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(O)"),
|
||||
p1.get()));
|
||||
}
|
||||
@@ -472,8 +472,8 @@ struct callback<void>
|
||||
template <class A1, class A2>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OO)"),
|
||||
p1.get(),
|
||||
@@ -483,8 +483,8 @@ struct callback<void>
|
||||
template <class A1, class A2>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OO)"),
|
||||
p1.get(),
|
||||
p2.get()));
|
||||
@@ -493,9 +493,9 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOO)"),
|
||||
p1.get(),
|
||||
@@ -506,9 +506,9 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -518,10 +518,10 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOO)"),
|
||||
p1.get(),
|
||||
@@ -533,10 +533,10 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -547,11 +547,11 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOO)"),
|
||||
p1.get(),
|
||||
@@ -564,11 +564,11 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -580,12 +580,12 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -599,12 +599,12 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -617,13 +617,13 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -638,13 +638,13 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -658,14 +658,14 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -681,14 +681,14 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -703,15 +703,15 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -728,15 +728,15 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
@@ -752,16 +752,16 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
static void call_method(PyObject* self, const char* name, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p10(to_python(search_namespace, a10));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref p10(to_python(a10, lookup_tag()));
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(OOOOOOOOOO)"),
|
||||
p1.get(),
|
||||
@@ -779,16 +779,16 @@ struct callback<void>
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
static void call(PyObject* self, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10)
|
||||
{
|
||||
ref p1(to_python(search_namespace, a1));
|
||||
ref p2(to_python(search_namespace, a2));
|
||||
ref p3(to_python(search_namespace, a3));
|
||||
ref p4(to_python(search_namespace, a4));
|
||||
ref p5(to_python(search_namespace, a5));
|
||||
ref p6(to_python(search_namespace, a6));
|
||||
ref p7(to_python(search_namespace, a7));
|
||||
ref p8(to_python(search_namespace, a8));
|
||||
ref p9(to_python(search_namespace, a9));
|
||||
ref p10(to_python(search_namespace, a10));
|
||||
ref p1(to_python(a1, lookup_tag()));
|
||||
ref p2(to_python(a2, lookup_tag()));
|
||||
ref p3(to_python(a3, lookup_tag()));
|
||||
ref p4(to_python(a4, lookup_tag()));
|
||||
ref p5(to_python(a5, lookup_tag()));
|
||||
ref p6(to_python(a6, lookup_tag()));
|
||||
ref p7(to_python(a7, lookup_tag()));
|
||||
ref p8(to_python(a8, lookup_tag()));
|
||||
ref p9(to_python(a9, lookup_tag()));
|
||||
ref p10(to_python(a10, lookup_tag()));
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(OOOOOOOOOO)"),
|
||||
p1.get(),
|
||||
p2.get(),
|
||||
|
||||
@@ -30,7 +30,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &self))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)());
|
||||
return to_python((target.*pmf)(), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1>
|
||||
@@ -40,7 +40,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OO"), &self, &a1))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>())));
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2>
|
||||
@@ -51,8 +51,8 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOO"), &self, &a1, &a2))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())));
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3>
|
||||
@@ -64,9 +64,9 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOO"), &self, &a1, &a2, &a3))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>())));
|
||||
from_python(a3, type<A3>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4>
|
||||
@@ -79,10 +79,10 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOO"), &self, &a1, &a2, &a3, &a4))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>())));
|
||||
from_python(a4, type<A4>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5>
|
||||
@@ -96,11 +96,11 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOO"), &self, &a1, &a2, &a3, &a4, &a5))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>())));
|
||||
from_python(a5, type<A5>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
@@ -115,12 +115,12 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>())));
|
||||
from_python(a6, type<A6>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
@@ -136,13 +136,13 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>())));
|
||||
from_python(a7, type<A7>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
@@ -159,14 +159,14 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>())));
|
||||
from_python(a8, type<A8>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
@@ -184,7 +184,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -192,7 +192,7 @@ struct caller
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>())));
|
||||
from_python(a9, type<A9>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
@@ -211,7 +211,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -220,7 +220,7 @@ struct caller
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>()),
|
||||
from_python(a10, type<A10>())));
|
||||
from_python(a10, type<A10>())), lookup_tag());
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &self))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)());
|
||||
return to_python((target.*pmf)(), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1>
|
||||
@@ -240,7 +240,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OO"), &self, &a1))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>())));
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2>
|
||||
@@ -251,8 +251,8 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOO"), &self, &a1, &a2))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())));
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3>
|
||||
@@ -264,9 +264,9 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOO"), &self, &a1, &a2, &a3))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>())));
|
||||
from_python(a3, type<A3>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4>
|
||||
@@ -279,10 +279,10 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOO"), &self, &a1, &a2, &a3, &a4))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>())));
|
||||
from_python(a4, type<A4>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5>
|
||||
@@ -296,11 +296,11 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOO"), &self, &a1, &a2, &a3, &a4, &a5))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>())));
|
||||
from_python(a5, type<A5>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
@@ -315,12 +315,12 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>())));
|
||||
from_python(a6, type<A6>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
@@ -336,13 +336,13 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>())));
|
||||
from_python(a7, type<A7>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
@@ -359,14 +359,14 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>())));
|
||||
from_python(a8, type<A8>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
@@ -384,7 +384,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -392,7 +392,7 @@ struct caller
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>())));
|
||||
from_python(a9, type<A9>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
@@ -411,7 +411,7 @@ struct caller
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOOO"), &self, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10))
|
||||
return 0;
|
||||
T& target = from_python(self, type<T&>());
|
||||
return to_python(search_namespace, (target.*pmf)(from_python(a1, type<A1>()),
|
||||
return to_python((target.*pmf)(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -420,14 +420,14 @@ struct caller
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>()),
|
||||
from_python(a10, type<A10>())));
|
||||
from_python(a10, type<A10>())), lookup_tag());
|
||||
}
|
||||
|
||||
// Free functions
|
||||
static PyObject* call(R (*f)(), PyObject* args, PyObject* /* keywords */ ) {
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("")))
|
||||
return 0;
|
||||
return to_python(search_namespace, f());
|
||||
return to_python(f(), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1>
|
||||
@@ -435,7 +435,7 @@ struct caller
|
||||
PyObject* a1;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &a1))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>())));
|
||||
return to_python(f(from_python(a1, type<A1>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2>
|
||||
@@ -444,8 +444,8 @@ struct caller
|
||||
PyObject* a2;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OO"), &a1, &a2))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())));
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3>
|
||||
@@ -455,9 +455,9 @@ struct caller
|
||||
PyObject* a3;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOO"), &a1, &a2, &a3))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>())));
|
||||
from_python(a3, type<A3>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4>
|
||||
@@ -468,10 +468,10 @@ struct caller
|
||||
PyObject* a4;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOO"), &a1, &a2, &a3, &a4))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>())));
|
||||
from_python(a4, type<A4>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5>
|
||||
@@ -483,11 +483,11 @@ struct caller
|
||||
PyObject* a5;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOO"), &a1, &a2, &a3, &a4, &a5))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>())));
|
||||
from_python(a5, type<A5>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
@@ -500,12 +500,12 @@ struct caller
|
||||
PyObject* a6;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>())));
|
||||
from_python(a6, type<A6>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
@@ -519,13 +519,13 @@ struct caller
|
||||
PyObject* a7;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>())));
|
||||
from_python(a7, type<A7>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
@@ -540,14 +540,14 @@ struct caller
|
||||
PyObject* a8;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
from_python(a5, type<A5>()),
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>())));
|
||||
from_python(a8, type<A8>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
@@ -563,7 +563,7 @@ struct caller
|
||||
PyObject* a9;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -571,7 +571,7 @@ struct caller
|
||||
from_python(a6, type<A6>()),
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>())));
|
||||
from_python(a9, type<A9>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
|
||||
@@ -588,7 +588,7 @@ struct caller
|
||||
PyObject* a10;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -597,7 +597,7 @@ struct caller
|
||||
from_python(a7, type<A7>()),
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>()),
|
||||
from_python(a10, type<A10>())));
|
||||
from_python(a10, type<A10>())), lookup_tag());
|
||||
}
|
||||
|
||||
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
|
||||
@@ -615,7 +615,7 @@ struct caller
|
||||
PyObject* a11;
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10, &a11))
|
||||
return 0;
|
||||
return to_python(search_namespace, f(from_python(a1, type<A1>()),
|
||||
return to_python(f(from_python(a1, type<A1>()),
|
||||
from_python(a2, type<A2>()),
|
||||
from_python(a3, type<A3>()),
|
||||
from_python(a4, type<A4>()),
|
||||
@@ -625,7 +625,7 @@ struct caller
|
||||
from_python(a8, type<A8>()),
|
||||
from_python(a9, type<A9>()),
|
||||
from_python(a10, type<A10>()),
|
||||
from_python(a11, type<A11>())));
|
||||
from_python(a11, type<A11>())), lookup_tag());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -29,11 +29,11 @@ class class_builder
|
||||
/// Tell Boost.Python that for the purposes of pickling, the state is
|
||||
/// completely captured in the object's __dict__.
|
||||
inline void dict_defines_state() {
|
||||
add(ref(to_python(search_namespace, 1)), "__dict_defines_state__");
|
||||
add(ref(to_python(1, lookup_tag())), "__dict_defines_state__");
|
||||
}
|
||||
|
||||
inline void getstate_manages_dict() {
|
||||
add(ref(to_python(search_namespace, 1)), "__getstate_manages_dict__");
|
||||
add(ref(to_python(1, lookup_tag())), "__getstate_manages_dict__");
|
||||
}
|
||||
|
||||
/// define constructors
|
||||
|
||||
@@ -284,14 +284,14 @@ PyObject* class_t<T>::instance_mapping_subscript(PyObject* obj, PyObject* key) c
|
||||
template <class T>
|
||||
PyObject* class_t<T>::instance_sequence_item(PyObject* obj, int n) const
|
||||
{
|
||||
ref key(to_python(search_namespace, n));
|
||||
ref key(to_python(n, lookup_tag()));
|
||||
return downcast<T>(obj)->get_subscript(key.get());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
int class_t<T>::instance_sequence_ass_item(PyObject* obj, int n, PyObject* value) const
|
||||
{
|
||||
ref key(to_python(search_namespace, n));
|
||||
ref key(to_python(n, lookup_tag()));
|
||||
downcast<T>(obj)->set_subscript(key.get(), value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
# endif
|
||||
|
||||
namespace boost { namespace python {
|
||||
enum semantics { search_namespace }; // Used to find to_python functions via koenig lookup.
|
||||
struct lookup_tag {}; // Used to find to_python functions via Koenig lookup.
|
||||
}}
|
||||
|
||||
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is a gcc 2.95.2 bug workaround
|
||||
@@ -56,9 +56,9 @@ class py_enum_as_int_converters
|
||||
from_python(x, boost::python::type<long>()));
|
||||
}
|
||||
|
||||
friend PyObject* to_python(boost::python::semantics, EnumType x)
|
||||
friend PyObject* to_python(EnumType x, boost::python::lookup_tag)
|
||||
{
|
||||
return to_python(boost::python::search_namespace, static_cast<long>(x));
|
||||
return to_python(static_cast<long>(x), boost::python::lookup_tag());
|
||||
}
|
||||
};
|
||||
BOOST_PYTHON_END_CONVERSION_NAMESPACE
|
||||
@@ -120,70 +120,70 @@ BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
//
|
||||
// Converters
|
||||
//
|
||||
PyObject* to_python(boost::python::semantics, long);
|
||||
PyObject* to_python(long, boost::python::lookup_tag);
|
||||
long from_python(PyObject* p, boost::python::type<long>);
|
||||
long from_python(PyObject* p, boost::python::type<const long&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned long);
|
||||
PyObject* to_python(unsigned long, boost::python::lookup_tag);
|
||||
unsigned long from_python(PyObject* p, boost::python::type<unsigned long>);
|
||||
unsigned long from_python(PyObject* p, boost::python::type<const unsigned long&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, int);
|
||||
PyObject* to_python(int, boost::python::lookup_tag);
|
||||
int from_python(PyObject*, boost::python::type<int>);
|
||||
int from_python(PyObject*, boost::python::type<const int&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned int);
|
||||
PyObject* to_python(unsigned int, boost::python::lookup_tag);
|
||||
unsigned int from_python(PyObject*, boost::python::type<unsigned int>);
|
||||
unsigned int from_python(PyObject*, boost::python::type<const unsigned int&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, short);
|
||||
PyObject* to_python(short, boost::python::lookup_tag);
|
||||
short from_python(PyObject*, boost::python::type<short>);
|
||||
short from_python(PyObject*, boost::python::type<const short&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned short);
|
||||
PyObject* to_python(unsigned short, boost::python::lookup_tag);
|
||||
unsigned short from_python(PyObject*, boost::python::type<unsigned short>);
|
||||
unsigned short from_python(PyObject*, boost::python::type<const unsigned short&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, char);
|
||||
PyObject* to_python(char, boost::python::lookup_tag);
|
||||
char from_python(PyObject*, boost::python::type<char>);
|
||||
char from_python(PyObject*, boost::python::type<const char&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, signed char);
|
||||
PyObject* to_python(signed char, boost::python::lookup_tag);
|
||||
signed char from_python(PyObject*, boost::python::type<signed char>);
|
||||
signed char from_python(PyObject*, boost::python::type<const signed char&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned char);
|
||||
PyObject* to_python(unsigned char, boost::python::lookup_tag);
|
||||
unsigned char from_python(PyObject*, boost::python::type<unsigned char>);
|
||||
unsigned char from_python(PyObject*, boost::python::type<const unsigned char&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, float);
|
||||
PyObject* to_python(float, boost::python::lookup_tag);
|
||||
float from_python(PyObject*, boost::python::type<float>);
|
||||
float from_python(PyObject*, boost::python::type<const float&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, double);
|
||||
PyObject* to_python(double, boost::python::lookup_tag);
|
||||
double from_python(PyObject*, boost::python::type<double>);
|
||||
double from_python(PyObject*, boost::python::type<const double&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, bool);
|
||||
PyObject* to_python(bool, boost::python::lookup_tag);
|
||||
bool from_python(PyObject*, boost::python::type<bool>);
|
||||
bool from_python(PyObject*, boost::python::type<const bool&>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics);
|
||||
PyObject* to_python(boost::python::lookup_tag);
|
||||
void from_python(PyObject*, boost::python::type<void>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const char* s);
|
||||
PyObject* to_python(const char* s, boost::python::lookup_tag);
|
||||
const char* from_python(PyObject*, boost::python::type<const char*>);
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const std::string& s);
|
||||
PyObject* to_python(const std::string& s, boost::python::lookup_tag);
|
||||
std::string from_python(PyObject*, boost::python::type<std::string>);
|
||||
std::string from_python(PyObject*, boost::python::type<const std::string&>);
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, const std::complex<float>& x)
|
||||
inline PyObject* to_python(const std::complex<float>& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::detail::complex_to_python<float>(x);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, const std::complex<double>& x)
|
||||
inline PyObject* to_python(const std::complex<double>& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::detail::complex_to_python<double>(x);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ inline std::complex<float> from_python(PyObject* p,
|
||||
}
|
||||
|
||||
// For when your C++ function really wants to pass/return a PyObject*
|
||||
PyObject* to_python(boost::python::semantics, PyObject*);
|
||||
PyObject* to_python(PyObject*, boost::python::lookup_tag);
|
||||
PyObject* from_python(PyObject*, boost::python::type<PyObject*>);
|
||||
|
||||
// Some standard conversions to/from smart pointer types. You can add your own
|
||||
@@ -263,13 +263,13 @@ boost::shared_ptr<T> from_python(PyObject*p, boost::python::type<boost::shared_p
|
||||
|
||||
#if 0
|
||||
template <class T>
|
||||
PyObject* to_python(boost::python::semantics, std::auto_ptr<T> p)
|
||||
PyObject* to_python(std::auto_ptr<T> p, boost::python::lookup_tag)
|
||||
{
|
||||
return new boost::python::wrapped_pointer<std::auto_ptr<T>, T>(p);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
PyObject* to_python(boost::python::semantics, boost::shared_ptr<T> p)
|
||||
PyObject* to_python(boost::shared_ptr<T> p, boost::python::lookup_tag)
|
||||
{
|
||||
return new boost::python::wrapped_pointer<boost::shared_ptr<T>, T>(p);
|
||||
}
|
||||
@@ -280,43 +280,43 @@ PyObject* to_python(boost::python::semantics, boost::shared_ptr<T> p)
|
||||
//
|
||||
|
||||
#ifndef BOOST_MSVC6_OR_EARLIER
|
||||
inline PyObject* to_python(boost::python::semantics, double d)
|
||||
inline PyObject* to_python(double d, boost::python::lookup_tag)
|
||||
{
|
||||
return PyFloat_FromDouble(d);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, float f)
|
||||
inline PyObject* to_python(float f, boost::python::lookup_tag)
|
||||
{
|
||||
return PyFloat_FromDouble(f);
|
||||
}
|
||||
#endif // BOOST_MSVC6_OR_EARLIER
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, long l)
|
||||
inline PyObject* to_python(long l, boost::python::lookup_tag)
|
||||
{
|
||||
return PyInt_FromLong(l);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, int x)
|
||||
inline PyObject* to_python(int x, boost::python::lookup_tag)
|
||||
{
|
||||
return PyInt_FromLong(x);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, short x)
|
||||
inline PyObject* to_python(short x, boost::python::lookup_tag)
|
||||
{
|
||||
return PyInt_FromLong(x);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, bool b)
|
||||
inline PyObject* to_python(bool b, boost::python::lookup_tag)
|
||||
{
|
||||
return PyInt_FromLong(b);
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics)
|
||||
inline PyObject* to_python(boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::detail::none();
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, const char* s)
|
||||
inline PyObject* to_python(const char* s, boost::python::lookup_tag)
|
||||
{
|
||||
return PyString_FromString(s);
|
||||
}
|
||||
@@ -326,7 +326,7 @@ inline std::string from_python(PyObject* p, boost::python::type<const std::strin
|
||||
return from_python(p, boost::python::type<std::string>());
|
||||
}
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, PyObject* p)
|
||||
inline PyObject* to_python(PyObject* p, boost::python::lookup_tag)
|
||||
{
|
||||
Py_INCREF(p);
|
||||
return p;
|
||||
|
||||
@@ -101,7 +101,7 @@ class python_import_extension_class_converters
|
||||
friend const std::auto_ptr<T>& from_python(PyObject* p, boost::python::type<const std::auto_ptr<T>&> t, bool sig = false) {
|
||||
return boost::python::detail::import_extension_class<T>::get_converters()->from_python_caTr(p, t);
|
||||
}
|
||||
friend PyObject* to_python(boost::python::semantics, std::auto_ptr<T> x, bool sig = false) {
|
||||
friend PyObject* to_python(std::auto_ptr<T> x, boost::python::lookup_tag, bool sig = false) {
|
||||
return boost::python::detail::import_extension_class<T>::get_converters()->dispatcher_to_python(x);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class python_import_extension_class_converters
|
||||
friend const boost::shared_ptr<T>& from_python(PyObject* p, boost::python::type<const boost::shared_ptr<T>&> t, bool sig = false) {
|
||||
return boost::python::detail::import_extension_class<T>::get_converters()->from_python_csTr(p, t);
|
||||
}
|
||||
friend PyObject* to_python(boost::python::semantics, boost::shared_ptr<T> x, bool sig = false) {
|
||||
friend PyObject* to_python(boost::shared_ptr<T> x, boost::python::lookup_tag, bool sig = false) {
|
||||
return boost::python::detail::import_extension_class<T>::get_converters()->dispatcher_to_python(x);
|
||||
}
|
||||
};
|
||||
@@ -165,7 +165,7 @@ struct export_converter_object_noncopyable : export_converter_object_base<T>
|
||||
{
|
||||
virtual PyObject* dispatcher_to_python(const T& x) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"to_python(boost::python::semantics, const T&) converter not exported");
|
||||
"to_python(const T&, boost::python::lookup_tag) converter not exported");
|
||||
throw import_error();
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ struct export_converter_object_noncopyable : export_converter_object_base<T>
|
||||
return from_python(p, t);
|
||||
}
|
||||
virtual PyObject* dispatcher_to_python(std::auto_ptr<T> x) {
|
||||
return to_python(search_namespace, x);
|
||||
return to_python(x, lookup_tag());
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<T>& from_python_sTr(PyObject* p, type<boost::shared_ptr<T>&> t) {
|
||||
@@ -214,7 +214,7 @@ struct export_converter_object_noncopyable : export_converter_object_base<T>
|
||||
return from_python(p, t);
|
||||
}
|
||||
virtual PyObject* dispatcher_to_python(boost::shared_ptr<T> x) {
|
||||
return to_python(search_namespace, x);
|
||||
return to_python(x, lookup_tag());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class python_extension_class_converters
|
||||
/// Get an object which can be used to convert T to/from python. This is used
|
||||
/// as a kind of concept check by the free template function
|
||||
///
|
||||
/// PyObject* to_python(boost::python::semantics, const T& x)
|
||||
/// PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
///
|
||||
/// below this class, to prevent the confusing messages that would otherwise
|
||||
/// pop up. Now, if T hasn't been wrapped as an extension class, the user
|
||||
@@ -200,7 +200,7 @@ class python_extension_class_converters
|
||||
/// a compiler error. Instead, we access this function through the global
|
||||
/// template
|
||||
///
|
||||
/// PyObject* to_python(boost::python::semantics, const T& x)
|
||||
/// PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
///
|
||||
/// defined below this class. Since template functions are instantiated only
|
||||
/// on demand, errors will be avoided unless T is noncopyable and the user
|
||||
@@ -341,7 +341,7 @@ class python_extension_class_converters
|
||||
friend const std::auto_ptr<T>& from_python(PyObject* p, boost::python::type<const std::auto_ptr<T>&>)
|
||||
{ return smart_ptr_value(p, boost::python::type<std::auto_ptr<T> >()); }
|
||||
|
||||
friend PyObject* to_python(boost::python::semantics, std::auto_ptr<T> x)
|
||||
friend PyObject* to_python(std::auto_ptr<T> x, boost::python::lookup_tag)
|
||||
{ return smart_ptr_to_python(x); }
|
||||
|
||||
friend boost::shared_ptr<T>& from_python(PyObject* p, boost::python::type<boost::shared_ptr<T>&>)
|
||||
@@ -353,7 +353,7 @@ class python_extension_class_converters
|
||||
friend const boost::shared_ptr<T>& from_python(PyObject* p, boost::python::type<const boost::shared_ptr<T>&>)
|
||||
{ return smart_ptr_value(p, boost::python::type<boost::shared_ptr<T> >()); }
|
||||
|
||||
friend PyObject* to_python(boost::python::semantics, boost::shared_ptr<T> x)
|
||||
friend PyObject* to_python(boost::shared_ptr<T> x, boost::python::lookup_tag)
|
||||
{ return smart_ptr_to_python(x); }
|
||||
};
|
||||
|
||||
@@ -362,7 +362,7 @@ class python_extension_class_converters
|
||||
// T is a wrapped class. See the first 2 functions declared in
|
||||
// python_extension_class_converters above for more info.
|
||||
template <class T>
|
||||
PyObject* to_python(boost::python::semantics, const T& x)
|
||||
PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
{
|
||||
return py_extension_class_converters(boost::python::type<T>()).m_to_python(x);
|
||||
}
|
||||
|
||||
@@ -94,9 +94,10 @@ struct raw_arguments_function : function
|
||||
ref(keywords, ref::increment_count) :
|
||||
ref(PyDict_New()));
|
||||
|
||||
return to_python(search_namespace,
|
||||
return to_python(
|
||||
(*m_pf)(from_python(args, type<Args>()),
|
||||
from_python(dict.get(), type<Keywords>())));
|
||||
from_python(dict.get(), type<Keywords>())),
|
||||
lookup_tag());
|
||||
}
|
||||
|
||||
const char* description() const
|
||||
@@ -263,8 +264,8 @@ PyObject* getter_function<ClassType, MemberType>::do_call(
|
||||
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &self))
|
||||
return 0;
|
||||
|
||||
return to_python(search_namespace,
|
||||
from_python(self, type<const ClassType*>())->*m_pm);
|
||||
return to_python(from_python(self, type<const ClassType*>())->*m_pm,
|
||||
lookup_tag());
|
||||
}
|
||||
|
||||
template <class ClassType, class MemberType>
|
||||
|
||||
@@ -297,7 +297,7 @@ struct list::slice_proxy
|
||||
|
||||
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::tuple&);
|
||||
PyObject* to_python(const boost::python::tuple&, boost::python::lookup_tag);
|
||||
boost::python::tuple from_python(PyObject* p, boost::python::type<boost::python::tuple>);
|
||||
|
||||
inline boost::python::tuple from_python(PyObject* p, boost::python::type<const boost::python::tuple&>)
|
||||
@@ -305,7 +305,7 @@ inline boost::python::tuple from_python(PyObject* p, boost::python::type<const b
|
||||
return from_python(p, boost::python::type<boost::python::tuple>());
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::list&);
|
||||
PyObject* to_python(const boost::python::list&, boost::python::lookup_tag);
|
||||
boost::python::list from_python(PyObject* p, boost::python::type<boost::python::list>);
|
||||
|
||||
inline boost::python::list from_python(PyObject* p, boost::python::type<const boost::python::list&>)
|
||||
@@ -313,7 +313,7 @@ inline boost::python::list from_python(PyObject* p, boost::python::type<const bo
|
||||
return from_python(p, boost::python::type<boost::python::list>());
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::string&);
|
||||
PyObject* to_python(const boost::python::string&, boost::python::lookup_tag);
|
||||
boost::python::string from_python(PyObject* p, boost::python::type<boost::python::string>);
|
||||
|
||||
inline boost::python::string from_python(PyObject* p, boost::python::type<const boost::python::string&>)
|
||||
@@ -321,7 +321,7 @@ inline boost::python::string from_python(PyObject* p, boost::python::type<const
|
||||
return from_python(p, boost::python::type<boost::python::string>());
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::dictionary&);
|
||||
PyObject* to_python(const boost::python::dictionary&, boost::python::lookup_tag);
|
||||
boost::python::dictionary from_python(PyObject* p, boost::python::type<boost::python::dictionary>);
|
||||
|
||||
inline boost::python::dictionary from_python(PyObject* p, boost::python::type<const boost::python::dictionary&>)
|
||||
|
||||
@@ -239,9 +239,9 @@ namespace detail
|
||||
{ \
|
||||
tuple args(ref(arguments, ref::increment_count)); \
|
||||
\
|
||||
return to_python(search_namespace, \
|
||||
return to_python( \
|
||||
from_python(args[0].get(), type<Left>()) oper \
|
||||
from_python(args[1].get(), type<Right>())); \
|
||||
from_python(args[1].get(), type<Right>()), lookup_tag()); \
|
||||
} \
|
||||
\
|
||||
const char* description() const \
|
||||
@@ -255,9 +255,9 @@ namespace detail
|
||||
{ \
|
||||
tuple args(ref(arguments, ref::increment_count)); \
|
||||
\
|
||||
return to_python(search_namespace, \
|
||||
return to_python( \
|
||||
from_python(args[1].get(), type<Left>()) oper \
|
||||
from_python(args[0].get(), type<Right>())); \
|
||||
from_python(args[0].get(), type<Right>()), lookup_tag()); \
|
||||
} \
|
||||
\
|
||||
const char* description() const \
|
||||
@@ -280,8 +280,8 @@ namespace detail
|
||||
{ \
|
||||
tuple args(ref(arguments, ref::increment_count)); \
|
||||
\
|
||||
return to_python(search_namespace, \
|
||||
oper(from_python(args[0].get(), type<operand>()))); \
|
||||
return to_python( \
|
||||
oper(from_python(args[0].get(), type<operand>())), lookup_tag()); \
|
||||
} \
|
||||
\
|
||||
const char* description() const \
|
||||
@@ -335,9 +335,9 @@ namespace detail
|
||||
throw argument_error();
|
||||
}
|
||||
|
||||
return to_python(search_namespace,
|
||||
return to_python(
|
||||
pow(from_python(args[0].get(), type<Left>()),
|
||||
from_python(args[1].get(), type<Right>())));
|
||||
from_python(args[1].get(), type<Right>())), lookup_tag());
|
||||
}
|
||||
|
||||
const char* description() const
|
||||
@@ -358,9 +358,9 @@ namespace detail
|
||||
throw argument_error();
|
||||
}
|
||||
|
||||
return to_python(search_namespace,
|
||||
return to_python(
|
||||
pow(from_python(args[1].get(), type<Left>()),
|
||||
from_python(args[0].get(), type<Right>())));
|
||||
from_python(args[0].get(), type<Right>())), lookup_tag());
|
||||
}
|
||||
|
||||
const char* description() const
|
||||
@@ -386,13 +386,11 @@ namespace detail
|
||||
PyObject * res = PyTuple_New(2);
|
||||
|
||||
PyTuple_SET_ITEM(res, 0,
|
||||
to_python(search_namespace,
|
||||
from_python(args[0].get(), type<Left>()) /
|
||||
from_python(args[1].get(), type<Right>())));
|
||||
to_python(from_python(args[0].get(), type<Left>()) /
|
||||
from_python(args[1].get(), type<Right>()), lookup_tag()));
|
||||
PyTuple_SET_ITEM(res, 1,
|
||||
to_python(search_namespace,
|
||||
from_python(args[0].get(), type<Left>()) %
|
||||
from_python(args[1].get(), type<Right>())));
|
||||
to_python(from_python(args[0].get(), type<Left>()) %
|
||||
from_python(args[1].get(), type<Right>()), lookup_tag()));
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -411,13 +409,11 @@ namespace detail
|
||||
PyObject * res = PyTuple_New(2);
|
||||
|
||||
PyTuple_SET_ITEM(res, 0,
|
||||
to_python(search_namespace,
|
||||
from_python(args[1].get(), type<Left>()) /
|
||||
from_python(args[0].get(), type<Right>())));
|
||||
to_python(from_python(args[1].get(), type<Left>()) /
|
||||
from_python(args[0].get(), type<Right>()), lookup_tag()));
|
||||
PyTuple_SET_ITEM(res, 1,
|
||||
to_python(search_namespace,
|
||||
from_python(args[1].get(), type<Left>()) %
|
||||
from_python(args[0].get(), type<Right>())));
|
||||
to_python(from_python(args[1].get(), type<Left>()) %
|
||||
from_python(args[0].get(), type<Right>()), lookup_tag()));
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -443,14 +439,14 @@ namespace detail
|
||||
{
|
||||
tuple args(ref(arguments, ref::increment_count));
|
||||
|
||||
return to_python(search_namespace,
|
||||
return to_python(
|
||||
(from_python(args[0].get(), type<Left>()) <
|
||||
from_python(args[1].get(), type<Right>())) ?
|
||||
- 1 :
|
||||
(from_python(args[1].get(), type<Right>()) <
|
||||
from_python(args[0].get(), type<Left>())) ?
|
||||
1 :
|
||||
0) ;
|
||||
0, lookup_tag()) ;
|
||||
}
|
||||
|
||||
const char* description() const
|
||||
@@ -465,14 +461,14 @@ namespace detail
|
||||
{
|
||||
tuple args(ref(arguments, ref::increment_count));
|
||||
|
||||
return to_python(search_namespace,
|
||||
return to_python(
|
||||
(from_python(args[1].get(), type<Left>()) <
|
||||
from_python(args[0].get(), type<Right>())) ?
|
||||
- 1 :
|
||||
(from_python(args[0].get(), type<Right>()) <
|
||||
from_python(args[1].get(), type<Left>())) ?
|
||||
1 :
|
||||
0) ;
|
||||
0, lookup_tag()) ;
|
||||
}
|
||||
|
||||
const char* description() const
|
||||
@@ -511,12 +507,12 @@ namespace detail
|
||||
# ifdef BOOST_PYTHON_USE_SSTREAM
|
||||
std::ostringstream s;
|
||||
s << from_python(args[0].get(), type<operand>());
|
||||
return to_python(search_namespace, s.str());
|
||||
return to_python(s.str(), lookup_tag());
|
||||
# else
|
||||
std::ostrstream s;
|
||||
s << from_python(args[0].get(), type<operand>()) << char();
|
||||
auto unfreezer unfreeze(s);
|
||||
return to_python(search_namespace, const_cast<char const *>(s.str()));
|
||||
return to_python(const_cast<char const *>(s.str()), lookup_tag());
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ struct py_ptr_conversions : Base
|
||||
inline friend T from_python(PyObject* x, boost::python::type<T>)
|
||||
{ return T(boost::python::downcast<Value>(x).get(), T::increment_count); }
|
||||
|
||||
inline friend PyObject* to_python(boost::python::semantics, T x)
|
||||
inline friend PyObject* to_python(T x, boost::python::lookup_tag)
|
||||
{ return boost::python::as_object(x.release()); }
|
||||
|
||||
};
|
||||
@@ -163,7 +163,7 @@ typedef reference<PyObject> ref;
|
||||
template <class T>
|
||||
ref make_ref(const T& x)
|
||||
{
|
||||
return ref(to_python(search_namespace, x));
|
||||
return ref(to_python(x, lookup_tag()));
|
||||
}
|
||||
|
||||
}} // namespace boost::python
|
||||
|
||||
@@ -142,7 +142,7 @@ PyObject* integer_to_python(T value)
|
||||
throw boost::python::error_already_set();
|
||||
}
|
||||
|
||||
return to_python(boost::python::search_namespace, value_as_long);
|
||||
return to_python(value_as_long, boost::python::lookup_tag());
|
||||
}
|
||||
|
||||
int from_python(PyObject* p, boost::python::type<int> type)
|
||||
@@ -150,7 +150,7 @@ int from_python(PyObject* p, boost::python::type<int> type)
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned int i)
|
||||
PyObject* to_python(unsigned int i, boost::python::lookup_tag)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ float from_python(PyObject* p, boost::python::type<float>)
|
||||
return static_cast<float>(from_python(p, boost::python::type<double>()));
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned short i)
|
||||
PyObject* to_python(unsigned short i, boost::python::lookup_tag)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ unsigned short from_python(PyObject* p, boost::python::type<unsigned short> type
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, char c)
|
||||
PyObject* to_python(char c, boost::python::lookup_tag)
|
||||
{
|
||||
if (c == '\0') return PyString_FromString("");
|
||||
return PyString_FromStringAndSize(&c, 1);
|
||||
@@ -198,7 +198,7 @@ char from_python(PyObject* p, boost::python::type<char>)
|
||||
return PyString_AsString(p)[0];
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned char i)
|
||||
PyObject* to_python(unsigned char i, boost::python::lookup_tag)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ unsigned char from_python(PyObject* p, boost::python::type<unsigned char> type)
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, signed char i)
|
||||
PyObject* to_python(signed char i, boost::python::lookup_tag)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ signed char from_python(PyObject* p, boost::python::type<signed char> type)
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, unsigned long x)
|
||||
PyObject* to_python(unsigned long x, boost::python::lookup_tag)
|
||||
{
|
||||
return integer_to_python(x);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ const char* from_python(PyObject* p, boost::python::type<const char*>)
|
||||
return s;
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const std::string& s)
|
||||
PyObject* to_python(const std::string& s, boost::python::lookup_tag)
|
||||
{
|
||||
return PyString_FromStringAndSize(s.data(), s.size());
|
||||
}
|
||||
@@ -268,12 +268,12 @@ bool from_python(PyObject* p, boost::python::type<bool>)
|
||||
|
||||
#ifdef BOOST_MSVC6_OR_EARLIER
|
||||
// An optimizer bug prevents these from being inlined.
|
||||
PyObject* to_python(boost::python::semantics, double d)
|
||||
PyObject* to_python(double d, boost::python::lookup_tag)
|
||||
{
|
||||
return PyFloat_FromDouble(d);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, float f)
|
||||
PyObject* to_python(float f, boost::python::lookup_tag)
|
||||
{
|
||||
return PyFloat_FromDouble(f);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace detail {
|
||||
|
||||
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
|
||||
inline PyObject* to_python(boost::python::semantics, boost::python::detail::operator_dispatcher* n) { return n; }
|
||||
inline PyObject* to_python(boost::python::detail::operator_dispatcher* n, boost::python::lookup_tag) { return n; }
|
||||
|
||||
BOOST_PYTHON_END_CONVERSION_NAMESPACE
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ struct callback
|
||||
%{ template <%(class A%n%:, %)>
|
||||
%} static R call_method(PyObject* self, const char* name%(, const A%n& a%n%))
|
||||
{%(
|
||||
ref p%n(to_python(search_namespace, a%n));%)
|
||||
ref p%n(to_python(a%n, lookup_tag()));%)
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(%(O%))")%(,
|
||||
p%n.get()%)));
|
||||
@@ -49,7 +49,7 @@ struct callback
|
||||
%{ template <%(class A%n%:, %)>
|
||||
%} static R call(PyObject* self%(, const A%n& a%n%))
|
||||
{%(
|
||||
ref p%n(to_python(search_namespace, a%n));%)
|
||||
ref p%n(to_python(a%n, lookup_tag()));%)
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(%(O%))")%(,
|
||||
p%n.get()%)));
|
||||
detail::callback_adjust_refcount(result.get(), type<R>());
|
||||
@@ -70,7 +70,7 @@ struct callback<void>
|
||||
%{ template <%(class A%n%:, %)>
|
||||
%} static void call_method(PyObject* self, const char* name%(, const A%n& a%n%))
|
||||
{%(
|
||||
ref p%n(to_python(search_namespace, a%n));%)
|
||||
ref p%n(to_python(a%n, lookup_tag()));%)
|
||||
ref result(PyEval_CallMethod(self, const_cast<char*>(name),
|
||||
const_cast<char*>("(%(O%))")%(,
|
||||
p%n.get()%)));
|
||||
@@ -79,7 +79,7 @@ struct callback<void>
|
||||
%{ template <%(class A%n%:, %)>
|
||||
%} static void call(PyObject* self%(, const A%n& a%n%))
|
||||
{%(
|
||||
ref p%n(to_python(search_namespace, a%n));%)
|
||||
ref p%n(to_python(a%n, lookup_tag()));%)
|
||||
ref result(PyEval_CallFunction(self, const_cast<char*>("(%(O%))")%(,
|
||||
p%n.get()%)));
|
||||
}
|
||||
|
||||
@@ -97,14 +97,14 @@ def gen_caller(member_function_args, free_function_args = None):
|
||||
return (header % (member_function_args, free_function_args)
|
||||
+ body_sections[0]
|
||||
+ gen_functions(member_function, member_function_args,
|
||||
'R', '', 'return to_python(search_namespace, ', ');')
|
||||
'R', '', 'return to_python(', ', lookup_tag());')
|
||||
+ body_sections[1]
|
||||
+ gen_functions(member_function, member_function_args,
|
||||
'R', ' const', 'return to_python(search_namespace, ', ');')
|
||||
'R', ' const', 'return to_python(', ', lookup_tag());')
|
||||
+ body_sections[2]
|
||||
|
||||
+ gen_functions(free_function, free_function_args,
|
||||
'R', 'return to_python(search_namespace, ', ');')
|
||||
'R', 'return to_python(', ', lookup_tag());')
|
||||
+ body_sections[3]
|
||||
|
||||
# specialized part for void return values begins here
|
||||
|
||||
@@ -187,7 +187,7 @@ class python_extension_class_converters
|
||||
/// Get an object which can be used to convert T to/from python. This is used
|
||||
/// as a kind of concept check by the free template function
|
||||
///
|
||||
/// PyObject* to_python(boost::python::semantics, const T& x)
|
||||
/// PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
///
|
||||
/// below this class, to prevent the confusing messages that would otherwise
|
||||
/// pop up. Now, if T hasn't been wrapped as an extension class, the user
|
||||
@@ -205,7 +205,7 @@ class python_extension_class_converters
|
||||
/// a compiler error. Instead, we access this function through the global
|
||||
/// template
|
||||
///
|
||||
/// PyObject* to_python(boost::python::semantics, const T& x)
|
||||
/// PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
///
|
||||
/// defined below this class. Since template functions are instantiated only
|
||||
/// on demand, errors will be avoided unless T is noncopyable and the user
|
||||
@@ -346,7 +346,7 @@ class python_extension_class_converters
|
||||
friend const std::auto_ptr<T>& from_python(PyObject* p, boost::python::type<const std::auto_ptr<T>&>)
|
||||
{ return smart_ptr_value(p, boost::python::type<std::auto_ptr<T> >()); }
|
||||
|
||||
friend PyObject* to_python(boost::python::semantics, std::auto_ptr<T> x)
|
||||
friend PyObject* to_python(std::auto_ptr<T> x, boost::python::lookup_tag)
|
||||
{ return smart_ptr_to_python(x); }
|
||||
|
||||
friend boost::shared_ptr<T>& from_python(PyObject* p, boost::python::type<boost::shared_ptr<T>&>)
|
||||
@@ -358,7 +358,7 @@ class python_extension_class_converters
|
||||
friend const boost::shared_ptr<T>& from_python(PyObject* p, boost::python::type<const boost::shared_ptr<T>&>)
|
||||
{ return smart_ptr_value(p, boost::python::type<boost::shared_ptr<T> >()); }
|
||||
|
||||
friend PyObject* to_python(boost::python::semantics, boost::shared_ptr<T> x)
|
||||
friend PyObject* to_python(boost::shared_ptr<T> x, boost::python::lookup_tag)
|
||||
{ return smart_ptr_to_python(x); }
|
||||
};
|
||||
|
||||
@@ -367,7 +367,7 @@ class python_extension_class_converters
|
||||
// T is a wrapped class. See the first 2 functions declared in
|
||||
// python_extension_class_converters above for more info.
|
||||
template <class T>
|
||||
PyObject* to_python(boost::python::semantics, const T& x)
|
||||
PyObject* to_python(const T& x, boost::python::lookup_tag)
|
||||
{
|
||||
return py_extension_class_converters(boost::python::type<T>()).m_to_python(x);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ PyObject* object::get() const
|
||||
|
||||
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::tuple& x)
|
||||
PyObject* to_python(const boost::python::tuple& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::object_to_python(x);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ boost::python::tuple from_python(PyObject* p, boost::python::type<boost::python:
|
||||
return boost::python::object_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::list& x)
|
||||
PyObject* to_python(const boost::python::list& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::object_to_python(x);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ boost::python::list from_python(PyObject* p, boost::python::type<boost::python::
|
||||
return boost::python::object_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::dictionary& x)
|
||||
PyObject* to_python(const boost::python::dictionary& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::object_to_python(x);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ boost::python::dictionary from_python(PyObject* p, boost::python::type<boost::py
|
||||
return boost::python::object_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(boost::python::semantics, const boost::python::string& x)
|
||||
PyObject* to_python(const boost::python::string& x, boost::python::lookup_tag)
|
||||
{
|
||||
return boost::python::object_to_python(x);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void throw_key_error_if_end(const StringMap& m, StringMap::const_iterator p, std
|
||||
{
|
||||
if (p == m.end())
|
||||
{
|
||||
PyErr_SetObject(PyExc_KeyError, to_python(boost::python::search_namespace, key));
|
||||
PyErr_SetObject(PyExc_KeyError, to_python(key, boost::python::lookup_tag()));
|
||||
throw boost::python::error_already_set();
|
||||
}
|
||||
}
|
||||
@@ -746,9 +746,9 @@ namespace boost { namespace python {
|
||||
}} // namespace boost::python
|
||||
|
||||
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
|
||||
inline PyObject* to_python(boost::python::semantics, const bpl_test::Record* p)
|
||||
inline PyObject* to_python(const bpl_test::Record* p, boost::python::lookup_tag)
|
||||
{
|
||||
return to_python(boost::python::search_namespace, *p);
|
||||
return to_python(*p, boost::python::lookup_tag());
|
||||
}
|
||||
BOOST_PYTHON_END_CONVERSION_NAMESPACE
|
||||
|
||||
@@ -1123,7 +1123,7 @@ PyObject* raw(const boost::python::tuple& args, const boost::python::dictionary&
|
||||
int third = from_python(keywords[boost::python::string("third")].get(), boost::python::type<int>());
|
||||
int fourth = from_python(keywords[boost::python::string("fourth")].get(), boost::python::type<int>());
|
||||
|
||||
return to_python(boost::python::search_namespace, first->i_ + second + third + fourth);
|
||||
return to_python(first->i_ + second + third + fourth, boost::python::lookup_tag());
|
||||
}
|
||||
|
||||
void init_module()
|
||||
|
||||
Reference in New Issue
Block a user