28 #ifndef ROCKETCOREPYTHONUTILITIES_H
29 #define ROCKETCOREPYTHONUTILITIES_H
31 #include "../Variant.h"
43 static bool IsCallable(PyObject*
self,
const char* method_name);
51 static R
Call(PyObject*
object,
const char* method_name,
const python::tuple& args)
53 PyObject* result = PythonCall(
object, method_name, args);
55 python::converter::return_from_python<R> converter;
56 return converter(result);
63 static bool Call(PyObject*
object,
const char* method_name,
const python::tuple& args);
68 template<
typename T >
72 typename python::return_by_value::apply< T* >::type result_converter;
73 return python::object(python::handle<>(result_converter(
object)));
78 template<
typename T >
82 return python::object(
object);
87 static void PrintError(
bool clear_error =
false);
93 static bool ConvertToVariant(
Variant& variant, PyObject*
object);
96 static PyObject* PythonCall(PyObject*
object,
const char* method_name,
const python::tuple& args );
101 inline python::object Utilities::MakeObject< PyObject >(PyObject* object)
103 return python::object(python::handle<>(python::borrowed(
object)));
static R Call(PyObject *object, const char *method_name, const python::tuple &args)
Definition: Utilities.h:51
Definition: Clipboard.h:33
static python::object MakeObject(const T &object)
Definition: Utilities.h:79
static python::object MakeObject(T *object)
Definition: Utilities.h:69
Definition: Utilities.h:39