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)
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()
128 pimpl_->call(args,
this);
130 PyObject* MultiCallback::callVar(PyObject* args)
137 LASS_PYTHON_CATCH_AND_RETURN_EX(
nullptr)
140 const std::type_info& MultiCallback::type()
const
142 return pimpl_->type();
144 void* MultiCallback::raw(
bool writable)
const
146 return pimpl_->raw(writable);
149 Py_ssize_t MultiCallback::length( PyObject* self)
151 return static_cast<MultiCallback*
>(self)->pimpl_->length();
158 PyObject* MultiCallback::addVar(PyObject* args)
165 LASS_PYTHON_CATCH_AND_RETURN_EX(
nullptr)
#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 Python name.
#define PY_CLASS_METHOD(i_cppClass, i_cppMethod)
Export a C++ method to Python.
#define PY_CLASS_PY_METHOD_EX(i_cppClass, i_cppMethod, s_methodName, s_doc)
Export a C++ method that returns raw PyObject* to Python (deprecated)
PyObjectPtr< PyObject >::Type TPyObjPtr
PyObjectPtr to a PyObject.
lass::util::SharedPtr< T, PyObjectStorage, PyObjectCounter > fromNakedToSharedPtrCast(PyObject *object)
fromNakedToSharedPtrCast.
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.