57const std::string MultiCallbackImplBase::repr()
const
60 return std::string(
"MultiCallbackRepr");
69 LASS_EXECUTE_BEFORE_MAIN_EX( MultiCallback_executeBeforeMain,
77 MultiCallback::MultiCallback(TPimpl&& pimpl)
79 init(std::move(pimpl));
84 PyObject * MultiCallback::_tp_call(PyObject * self, PyObject *args, PyObject* kwargs)
86 LockGIL LASS_UNUSED(lock);
87 if (!PyType_IsSubtype(self->ob_type , MultiCallback::_lassPyClassDef.type() ))
89 PyErr_SetString(PyExc_TypeError,
"not castable to MultiCallback");
94 if (!PyDict_CheckExact(kwargs))
96 PyErr_BadInternalCall();
99 if (PyDict_Size(kwargs) != 0)
101 PyErr_SetString(PyExc_TypeError,
"function takes no keyword arguments");
105 return static_cast<MultiCallback*
>(self)->callVar(args);
108 void MultiCallback::init(TPimpl&& pimpl)
110 impl::initLassModule();
111 impl::fixObjectType(
this);
112 pimpl_ = std::move(pimpl);
115 std::string MultiCallback::repr()
const
117 return pimpl_->repr();
120 void MultiCallback::reset()
127 LockGIL LASS_UNUSED(lock);
128 pimpl_->call(args,
this);
130 PyObject* MultiCallback::callVar(PyObject* args)
132 LockGIL LASS_UNUSED(lock);
136 const std::type_info& MultiCallback::type()
const
138 return pimpl_->type();
140 void* MultiCallback::raw(
bool writable)
const
142 return pimpl_->raw(writable);
145 Py_ssize_t MultiCallback::length( PyObject* self)
147 return static_cast<MultiCallback*
>(self)->pimpl_->length();
151 LockGIL LASS_UNUSED(lock);
154 PyObject* MultiCallback::addVar(PyObject* args)
156 LockGIL LASS_UNUSED(lock);
#define PY_DECLARE_CLASS(i_cppClass)
Declare a Python class with automatic name and no documentation.
#define PY_CLASS_METHOD_NAME(i_cppClass, i_cppMethod, s_methodName)
Export a C++ method to Python with custom name (no documentation).
#define PY_CLASS_METHOD(i_cppClass, i_cppMethod)
Export a C++ method to Python using the C++ method name (no documentation).
#define PY_CLASS_PY_METHOD_EX(i_cppClass, i_cppMethod, s_methodName, s_doc)
Export a C++ method that returns raw PyObject* to Python.
PyObjectPtr< PyObject >::Type TPyObjPtr
PyObjectPtr to a PyObject.
Predefined constants for Python special methods (magic methods) that can be used as method names in c...
Comprehensive C++ to Python binding library.
Library for Assembled Shared Sources.