Wrap C++ class methods and constructods.
Bases: pybindgen.typehandlers.base.ForwardWrapperBase
Class that generates a wrapper to a C++ class constructor. Such wrapper is used as the python class __init__ method.
Parameters: |
|
---|
Add a custodian/ward relationship to the constructor 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{0}: the object being constructed (self)
- value > 0: the nth parameter of the function, starting at 1
Parameters: |
|
---|
Get the class wrapper object (CppClass)
Creates a semi-deep copy of this constructor wrapper. The returned constructor wrapper clone contains copies of all parameters, so they can be modified at will.
Generates the wrapper code :param code_sink: a CodeSink instance that will receive the generated code :returns: the wrapper function name.
virtual method implementation; do not call
Get the class wrapper object (CppClass)
Set the class wrapper object (CppClass)
Bases: pybindgen.cppmethod.CppMethod
A ‘dummy’ method; cannot be generated due to incomple or incorrect parameters, but is added to the class to model the missing method.
Bases: pybindgen.cppmethod.CppConstructor
Class that generates a wrapper to a C/C++ function that appears as a contructor.
Parameters: |
|
---|
virtual method implementation; do not call
Bases: pybindgen.typehandlers.base.ForwardWrapperBase
Class that generates a wrapper to a C++ class method
Create an object the generates code to wrap a C++ class method.
Parameters: |
|
---|
Add a custodian/ward relationship to the method 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
- C{0}: the instance of the method (self)
- value > 0: the nth parameter of the function, starting at 1
Parameters: |
|
---|
get the class object this method belongs to
Creates a semi-deep copy of this method wrapper. The returned method wrapper clone contains copies of all parameters, so they can be modified at will.
Generates the wrapper code code_sink – a CodeSink instance that will receive the generated code method_name – actual name the method will get extra_wrapper_params – extra parameters the wrapper function should receive
Returns the corresponding PyMethodDef entry string.
virtual method implementation; do not call
get the class object this method belongs to
Get the C++ helper class, which is used for overriding virtual methods
Get the PyMethodDef entry suitable for this method
Get the PyMethodDef flags suitable for this method
Get the C++ helper class, which is used for overriding virtual methods
set the class object this method belongs to
Set the C++ helper class, which is used for overriding virtual methods
Bases: pybindgen.typehandlers.base.ForwardWrapperBase
Class that generates a constructor that raises an exception saying that the class has no constructor.
Parameters: | reason – string indicating reason why the class cannot be constructed. |
---|
Generates the wrapper code
Parameters: |
|
---|
Returns the wrapper function name.
dummy method, not really called
Bases: pybindgen.overloading.OverloadedWrapper
Support class for overloaded constructors
wrapper_name – C/C++ name of the wrapper
Bases: pybindgen.overloading.OverloadedWrapper
Support class for overloaded methods
wrapper_name – C/C++ name of the wrapper
Bases: pybindgen.cppmethod.CppMethod
Class that generates a wrapper that calls a virtual method default implementation in a parent base class.
Creates a semi-deep copy of this method wrapper. The returned method wrapper clone contains copies of all parameters, so they can be modified at will.
virtual method implementation; do not call
Get the PyMethodDef entry suitable for this method
Bases: pybindgen.typehandlers.base.ReverseWrapperBase
Class that generates a proxy virtual method that calls a similarly named python method.
Get the class wrapper object (CppClass)
generates the proxy virtual method
code to call the python method
Get the class wrapper object (CppClass)
Get the C++ helper class, which is used for overriding virtual methods
Get the C++ helper class, which is used for overriding virtual methods
Set the C++ helper class, which is used for overriding virtual methods
Bases: pybindgen.cppmethod.CppConstructor
Adds a custom constructor 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.
Bases: pybindgen.cppmethod.CppMethod
Adds a custom method 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.
Bases: pybindgen.typehandlers.base.Parameter
Accepts either a Parameter object or a tuple as sole parameter. In case it’s a tuple, it is assumed to be a retval spec (*args, **kwargs).
A ‘dummy’ parameter object used for modelling methods that have incomplete or incorrect parameters or return values.
Bases: pybindgen.typehandlers.base.ReturnValue
Accepts either a ReturnValue object or a tuple as sole parameter. In case it’s a tuple, it is assumed to be a retval spec (*args, **kwargs).
A ‘dummy’ return value object used for modelling methods that have incomplete or incorrect parameters or return values.