C function wrapper
Bases: pybindgen.function.Function
Adds a custom function wrapper. The custom wrapper must be prepared to support overloading, i.e. it must have an additional “PyObject **return_exception” parameter, and raised exceptions must be returned by this parameter.
Parameters: |
|
---|
Bases: pybindgen.typehandlers.base.ForwardWrapperBase
Class that generates a wrapper to a C function.
Parameters: |
|
---|
Add a custodian/ward relationship to the function wrapper
A custodian/ward relationship is one where one object (custodian) keeps a references to another object (ward), thus keeping it alive. When the custodian is destroyed, the reference to the ward is released, allowing the ward to be freed if no other reference to it is being kept by the user code. Please note that custodian/ward manages the lifecycle of Python wrappers, not the C/C++ objects referenced by the wrappers. In most cases, the wrapper owns the C/C++ object, and so the lifecycle of the C/C++ object is also managed by this. However, there are cases when a Python wrapper does not own the underlying C/C++ object, only references it.
The custodian and ward objects are indicated by an integer with the following meaning:
- C{-1}: the return value of the function
- value > 0: the nth parameter of the function, starting at 1
Parameters: |
|
---|
Creates a semi-deep copy of this function wrapper. The returned function wrapper clone contains copies of all parameters, so they can be modified at will.
Generates the wrapper code
Parameters: |
|
---|
virtual method implementation; do not call
Get the Module object this function belongs to
Returns an array element to use in a PyMethodDef table. Should only be called after code generation.
Parameters: | name – python function/method name |
---|
Get the Module object this function belongs to
Set the Module object this function belongs to