Library of Assembled Shared Sources
 
Loading...
Searching...
No Matches
pyobject_macros.h File Reference
Include dependency graph for pyobject_macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PY_DECLARE_MODULE_NAME_DOC(i_module, s_name, s_doc)
 Declare and define a ModuleDefinition object representing a Python module.
 
#define PY_DECLARE_MODULE_NAME(i_module, s_name)
 Declare a module with name only (no documentation).
 
#define PY_DECLARE_MODULE_DOC(i_module, s_doc)
 Declare a module with documentation, using the identifier as the module name.
 
#define PY_DECLARE_MODULE(i_module)
 Declare a module with minimal setup (name derived from identifier, no documentation).
 
#define PY_MODULE_ENTRYPOINT_NAME(i_module, i_name)
 Create a PyInit_* Python module initialization function with custom name.
 
#define PY_MODULE_ENTRYPOINT(i_module)
 Create a Python module initialization function using the module identifier as the name.
 
#define PY_INJECT_MODULE(i_module)
 Inject a Python module so Python becomes aware of it.
 
#define PY_INJECT_MODULE_EX(i_module, s_moduleName, s_doc)
 Inject a module with name and documentation override.
 
#define PY_INJECT_MODULE_NAME(i_module, s_moduleName)
 Inject a module with name override.
 
#define PY_INJECT_MODULE_DOC(i_module, s_doc)
 Inject a module with documentation override.
 
#define PY_EXTENSION_MODULE_EX(i_module, f_injection, s_doc)
 Inject a python module so Python is aware of it and produce all necessary code so a module can be used as extension of Python.
 
#define PY_EXTENSION_MODULE_DOC(i_module, f_injection, s_doc)
 Create an extension module with documentation.
 
#define PY_EXTENSION_MODULE(i_module, f_injection)
 Create an extension module (no documentation).
 
#define PY_MODULE_INTEGER_CONSTANT(i_module, s_name, s_value)
 Add an integer constant to a Python module.
 
#define PY_MODULE_STRING_CONSTANT(i_module, s_name, s_value)
 Add a string constant to a Python module.
 
#define PY_INJECT_OBJECT_IN_MODULE_EX(o_object, i_module, s_objectName)
 Inject an arbitrary object into an already created module at runtime.
 
#define PY_INJECT_OBJECT_IN_MODULE(o_object, i_module)
 Inject an object using its C++ identifier as the Python name.
 
#define PY_MODULE_ADD_INTEGER_CONSTANT(i_module, s_name, v_value)
 Inject an integer constant into an already created module at runtime.
 
#define PY_MODULE_ADD_STRING_CONSTANT(i_module, s_name, s_value)
 Inject a string constant into an already created module at runtime.
 
#define PY_MODULE_PY_FUNCTION_EX(i_module, f_cppFunction, s_functionName, s_doc)
 Export a C++ function to Python without automatic wrapper generation (deprecated)
 
#define PY_MODULE_FUNCTION_CAST_EX_0(i_module, f_cppFunction, t_return, s_functionName, s_doc, i_dispatcher)
 Exports a C++ free functions to Python with on the fly casting on return type and parameters, including omission of default parameters.
 
#define PY_MODULE_FUNCTION_CAST_EX_1(i_module, f_cppFunction, t_return, t_P1, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_EX_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName, s_doc, i_dispatcher)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_0(i_module, f_cppFunction, t_return, t_params, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_1(i_module, f_cppFunction, t_return, t_P1, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_DOC_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName, s_doc)
 
#define PY_MODULE_FUNCTION_CAST_NAME_0(i_module, f_cppFunction, t_return, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_1(i_module, f_cppFunction, t_return, t_P1, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName)
 
#define PY_MODULE_FUNCTION_CAST_NAME_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName)
 
#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)
 
#define PY_CLASS_METHOD_CAST_EX_0(t_cppClass, i_cppMethod, t_return, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method to Python with custom casting policy and full parameter control.
 
#define PY_CLASS_METHOD_CAST_EX_1(t_cppClass, i_cppMethod, t_return, t_P1, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 1-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_2(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 2-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_3(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 3-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_4(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 4-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_5(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 5-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_6(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 6-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_7(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 7-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_8(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 8-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_9(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 9-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_10(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 10-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_11(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 11-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_12(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 12-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_13(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 13-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_14(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 14-parameter methods.
 
#define PY_CLASS_METHOD_CAST_EX_15(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc, i_dispatcher, i_typename)
 Export a C++ method with casting policy for 15-parameter methods.
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_0(i_cppClass, i_cppMethod, t_return, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_0().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_1(i_cppClass, i_cppMethod, t_return, t_P1, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_1().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_2().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_3().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_4().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_5().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_6().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_7().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_8().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_9().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_10().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_11().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_12().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_13().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_14().
 
#define PY_CLASS_METHOD_CAST_NAME_DOC_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc)
 Convenience wrapper for PY_CLASS_METHOD_CAST_EX_15().
 
#define PY_CLASS_METHOD_CAST_NAME(i_cppClass, i_cppMethod, t_return, t_params, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_0(i_cppClass, i_cppMethod, t_return, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_1(i_cppClass, i_cppMethod, t_return, t_P1, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_NAME_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName)
 Convenience wrapper with no documentation.
 
#define PY_CLASS_METHOD_CAST_DOC(i_cppClass, i_cppMethod, t_return, t_params, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_0(i_cppClass, i_cppMethod, t_return, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_1(i_cppClass, i_cppMethod, t_return, t_P1, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST_DOC_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_doc)
 Convenience wrapper with method name derived from C++ method.
 
#define PY_CLASS_METHOD_CAST(i_cppClass, i_cppMethod, t_return, t_params)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_0(i_cppClass, i_cppMethod, t_return)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_1(i_cppClass, i_cppMethod, t_return, t_P1)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_METHOD_CAST_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Basic convenience wrapper with minimal parameters.
 
#define PY_CLASS_STATIC_METHOD_EX(t_cppClass, f_cppFunction, s_methodName, s_doc, i_dispatcher)
 Export a C++ static method to Python, with full control.
 
#define PY_CLASS_STATIC_METHOD_DOC(i_cppClass, i_cppMethod, s_doc)
 Export a C++ static method to Python, with docstring.
 
#define PY_CLASS_STATIC_METHOD_NAME_DOC(i_cppClass, i_cppMethod, s_methodName, s_doc)
 Export a C++ static method to Python, with custom name and docstring.
 
#define PY_CLASS_STATIC_METHOD_NAME(i_cppClass, i_cppMethod, s_methodName)
 Export a C++ static method to Python, with custom Python name.
 
#define PY_CLASS_STATIC_METHOD(i_cppClass, i_cppMethod)
 Export a C++ static method to Python.
 
Simple Function Export Macros

These macros export C++ functions to Python with automatic type deduction and wrapper generation.

Use these for simple function exports where overloading is not an issue and automatic type deduction is sufficient.

The basic form is:

PY_MODULE_FUNCTION( i_module, f_cppFunction )
#define PY_MODULE_FUNCTION(i_module, f_cppFunction)
Export a C++ function to Python.

with:

  • i_module : Module identifier declared by PY_DECLARE_MODULE_*
  • f_cppFunction : C++ function to export
Example
void spam(int a);
PY_MODULE_FUNCTION(foo, spam) // foo.spam(42)
#define PY_DECLARE_MODULE(i_module)
Declare a module with minimal setup (name derived from identifier, no documentation).
Common suffixes

The _NAME, _DOC and _EX suffixes allow you to specify a custom Python name, docstring, or (in rare cases) a custom dispatcher name.

Macro Adds parameters Use for ...
PY_MODULE_FUNCTION_NAME s_name Custom Python name
PY_MODULE_FUNCTION_DOC s_doc With docstring
PY_MODULE_FUNCTION_NAME_DOC s_name, s_doc Custom Python name + Docstring
PY_MODULE_FUNCTION_EX s_name, s_doc, i_dispatcher Custom dispatcher name
Example
void spam(int a);
PY_MODULE_FUNCTION (foo, spam) // foo.spam
PY_MODULE_FUNCTION_DOC (foo, spam, "eat it") // foo.spam, documented
PY_MODULE_FUNCTION_NAME (foo, spam, "eggs") // foo.eggs
PY_MODULE_FUNCTION_NAME_DOC(foo, spam, "eggs", "eat it") // foo.eggs, documented
PY_MODULE_FUNCTION_EX (foo, spam, "eggs", "eat it", dsp) // ... + explicit dispatcher
#define PY_MODULE_FUNCTION_NAME_DOC(i_module, f_cppFunction, s_name, s_doc)
Export a C++ function to Python, with custom name and docstring.
#define PY_MODULE_FUNCTION_NAME(i_module, f_cppFunction, s_name)
Export a C++ function to Python, with custom Python name.
#define PY_MODULE_FUNCTION_EX(i_module, f_cppFunction, s_functionName, s_doc, i_dispatcher)
Export a C++ function to Python, with full control.
#define PY_MODULE_FUNCTION_DOC(i_module, f_cppFunction, s_doc)
Export a C++ function to Python, with docstring.
Overloading Python functions

Multiple C++ functions can be exported to the same Python name, to create a Python function that is overloaded on the parameter types.

Note
Overload resolution uses first-fit, not best-fit like C++. The first exported overload that matches the arguments will be called.
Example
void barA(int a);
void barB(const std::string& b);
PY_MODULE_FUNCTION_NAME(foo, barA, "bar") // foo.bar(123)
PY_MODULE_FUNCTION_NAME(foo, barB, "bar") // foo.bar("123")
#define PY_MODULE_FUNCTION_EX(i_module, f_cppFunction, s_functionName, s_doc, i_dispatcher)
 Export a C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_NAME_DOC(i_module, f_cppFunction, s_name, s_doc)
 Export a C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_NAME(i_module, f_cppFunction, s_name)
 Export a C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_DOC(i_module, f_cppFunction, s_doc)
 Export a C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION(i_module, f_cppFunction)
 Export a C++ function to Python.
 
Qualified Free Functions

If the C++ function that you want to export is overloaded, then you need to be able to disambiquate what function exactly you want to export.

These macros export C++ functions to Python with explicit type qualification to resolve function overload ambiguities. They provide fine-grained control over function signatures to disambiguate overloaded functions, by adding the return type (except for constructors) and all parameter types.

The list of parameter types can be passed as a single lass::meta::TypeTuple, or as individual arguments. For the latter, the _<N> tells the number of arguments. The _<N> form is the most often used one, and simply packs its types into a TypeTuple

Form Adds parameters
PY_MODULE_FUNCTION_QUALIFIED t_return, t_params as lass::meta::TypeTuple
PY_MODULE_FUNCTION_QUALIFIED_<N> t_return, t_P1, t_P2, ... `t_P<N>
Example
double spam(int a, float b);
void spam(const std::string& c);
PY_MODULE_FUNCTION_QUALIFIED_2(foo, spam, double, int, float) // foo.spam(2, 3.14)
PY_MODULE_FUNCTION_QUALIFIED_1(foo, spam, void, const std::string&) // foo.spam("baz")
#define PY_MODULE_FUNCTION_QUALIFIED_1(i_module, f_cppFunction, t_return, t_P1)
Export an overloaded 1-ary C++ function to Python.
#define PY_MODULE_FUNCTION_QUALIFIED_2(i_module, f_cppFunction, t_return, t_P1, t_P2)
Export an overloaded 2-ary C++ function to Python.

They combine with the _NAME and _DOC suffixes, with the s_name, s_doc, i_dispatcher arguments following the function return and parameter types.

Example
void spam(const std::vector<int>& x);
double do_spam(int a, float b);
void do_spam(const std::string& c);
PY_MODULE_FUNCTION_DOC(foo, spam, "Does Spam!!!") // foo.spam([1,2,3])
PY_MODULE_FUNCTION_QUALIFIED_NAME_2(foo, do_spam, double, int, float, "spam") // foo.spam(2, 3.14)
PY_MODULE_FUNCTION_QUALIFIED_NAME_1(foo, do_spam, void, const std::string&, "spam") // foo.spam("baz")
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_1(i_module, f_cppFunction, t_return, t_P1, s_functionName)
Export an overloaded 1-ary C++ function to Python, with custom Python name.
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName)
Export an overloaded 2-ary C++ function to Python, with custom Python name.
#define PY_MODULE_FUNCTION_QUALIFIED_EX(i_module, f_cppFunction, t_return, t_params, s_functionName, s_doc, i_dispatcher)
 Export an overloaded C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_0(i_module, f_cppFunction, t_return, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 0-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_1(i_module, f_cppFunction, t_return, t_P1, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 1-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 2-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 3-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 4-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 5-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 6-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 7-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 8-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 9-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 10-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 11-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 12-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 13-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 14-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_EX_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName, s_doc, i_dispatcher)
 Export an overloaded 15-ary C++ function to Python, with full control.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC(i_module, f_cppFunction, t_return, t_params, s_functionName, s_doc)
 Export an overloaded C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_0(i_module, f_cppFunction, t_return, t_params, s_functionName, s_doc)
 Export an overloaded 0-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_1(i_module, f_cppFunction, t_return, t_P1, s_functionName, s_doc)
 Export an overloaded 1-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName, s_doc)
 Export an overloaded 2-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName, s_doc)
 Export an overloaded 3-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName, s_doc)
 Export an overloaded 4-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName, s_doc)
 Export an overloaded 5-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName, s_doc)
 Export an overloaded 6-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName, s_doc)
 Export an overloaded 7-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName, s_doc)
 Export an overloaded 8-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName, s_doc)
 Export an overloaded 9-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName, s_doc)
 Export an overloaded 10-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName, s_doc)
 Export an overloaded 11-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName, s_doc)
 Export an overloaded 12-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName, s_doc)
 Export an overloaded 13-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName, s_doc)
 Export an overloaded 14-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_DOC_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName, s_doc)
 Export an overloaded 15-ary C++ function to Python, with custom name and docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME(i_module, f_cppFunction, t_return, t_params, s_functionName)
 Export an overloaded C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_0(i_module, f_cppFunction, t_return, s_functionName)
 Export an overloaded 0-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_1(i_module, f_cppFunction, t_return, t_P1, s_functionName)
 Export an overloaded 1-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_functionName)
 Export an overloaded 2-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_functionName)
 Export an overloaded 3-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_functionName)
 Export an overloaded 4-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_functionName)
 Export an overloaded 5-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_functionName)
 Export an overloaded 6-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_functionName)
 Export an overloaded 7-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_functionName)
 Export an overloaded 8-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_functionName)
 Export an overloaded 9-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_functionName)
 Export an overloaded 10-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_functionName)
 Export an overloaded 11-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_functionName)
 Export an overloaded 12-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_functionName)
 Export an overloaded 13-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_functionName)
 Export an overloaded 14-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_NAME_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_functionName)
 Export an overloaded 15-ary C++ function to Python, with custom Python name.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC(i_module, f_cppFunction, t_return, t_params, s_doc)
 Export an overloaded C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_0(i_module, f_cppFunction, t_return, s_doc)
 Export an overloaded 0-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_1(i_module, f_cppFunction, t_return, t_P1, s_doc)
 Export an overloaded 1-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_2(i_module, f_cppFunction, t_return, t_P1, t_P2, s_doc)
 Export an overloaded 2-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, s_doc)
 Export an overloaded 3-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, s_doc)
 Export an overloaded 4-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_doc)
 Export an overloaded 5-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_doc)
 Export an overloaded 6-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_doc)
 Export an overloaded 7-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_doc)
 Export an overloaded 8-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_doc)
 Export an overloaded 9-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_doc)
 Export an overloaded 10-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_doc)
 Export an overloaded 11-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_doc)
 Export an overloaded 12-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_doc)
 Export an overloaded 13-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_doc)
 Export an overloaded 14-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED_DOC_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_doc)
 Export an overloaded 15-ary C++ function to Python, with docstring.
 
#define PY_MODULE_FUNCTION_QUALIFIED(i_module, f_cppFunction, t_return, t_params)
 Export an overloaded C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_0(i_module, f_cppFunction, t_return)
 Export an overloaded 0-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_1(i_module, f_cppFunction, t_return, t_P1)
 Export an overloaded 1-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_2(i_module, f_cppFunction, t_return, t_P1, t_P2)
 Export an overloaded 2-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_3(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3)
 Export an overloaded 3-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_4(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4)
 Export an overloaded 4-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_5(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5)
 Export an overloaded 5-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_6(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Export an overloaded 6-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_7(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Export an overloaded 7-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_8(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Export an overloaded 8-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_9(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Export an overloaded 9-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_10(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Export an overloaded 10-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_11(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Export an overloaded 11-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_12(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Export an overloaded 12-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_13(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Export an overloaded 13-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_14(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Export an overloaded 14-ary C++ function to Python.
 
#define PY_MODULE_FUNCTION_QUALIFIED_15(i_module, f_cppFunction, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Export an overloaded 15-ary C++ function to Python.
 
Class Declaration & Setup

Macros to declare and configure Python classes from C++ types.

These macros create the internal class definition objects that aggregate all the information needed to generate a Python type. Every C++ class that needs to be exposed to Python must be declared using one of these macros.

LASS supports two approaches for exporting C++ classes to Python:

  1. Direct Python classes: C++ classes that directly inherit from lass::python::PyObjectPlus and are designed to be Python-aware from the start.
  2. Python Shadow Classes: Wrapper classes created for existing native C++ types using the shadow system.
Note
In both cases, the class parameter in these declaration macros refers to the Python binding class (either PyObjectPlus-derived or shadow wrapper), never the underlying native C++ type being shadowed.

The basic form is

PY_DECLARE_CLASS( i_cppClass )
#define PY_DECLARE_CLASS(i_cppClass)
Declare a Python class with automatic name and no documentation.

with:

Common suffixes

The _NAME and _DOC suffixes allow you to specify a custom Python name and docstring.

Macro Fixed parameters Adds parameters Use for ...
PY_DECLARE_CLASS_NAME t_cppClass s_name Custom Python name
PY_DECLARE_CLASS_DOC i_cppClass s_doc With docstring
PY_DECLARE_CLASS_NAME_DOC t_cppClass s_name, s_doc Custom Python name + Docstring
PY_DECLARE_CLASS_EX t_cppClass s_name, i_uniqueClassIdentifier (deprecated)
Direct Python Class Example:
// In header file (MyClass.h):
class MyClass: public PyObjectPlus
{
PY_HEADER(PyObjectPlus)
public:
MyClass();
void someMethod();
};
// In source file (MyClass.cpp):
PY_DECLARE_CLASS_NAME_DOC(MyClass, "MyClass", "A sample class")
// ... add methods, constructors, properties etc.
#define PY_DECLARE_CLASS_NAME_DOC(t_cppClass, s_name, s_doc)
Declare a Python class with full control over name and documentation.
#define PY_HEADER(t_parentClass)
Place as first line of your Pythonized class.
Shadow Class Example:
// Existing non-Python-aware C++ class:
class LegacyClass
{
public:
void doSomething();
};
// Shadow wrapper class:
PY_SHADOW_CLASS(LASS_DLL_EXPORT, PyShadowLegacyClass, LegacyClass)
// Declaration (note: we declare the shadow class, not LegacyClass):
PY_DECLARE_CLASS_NAME_DOC(PyShadowLegacyClass, "LegacyClass", "Legacy class wrapper")
#define PY_SHADOW_CLASS(dllInterface, i_PyObjectShadowClass, t_CppClass)
Declare Python shadow class with util::SharedPtr as default shadowee pointer type.
#define PY_DECLARE_CLASS_NAME_DOC(t_cppClass, s_name, s_doc)
 Declare a Python class with full control over name and documentation.
 
#define PY_DECLARE_CLASS_NAME(t_cppClass, s_name)
 Declare a Python class with custom name but no documentation.
 
#define PY_DECLARE_CLASS_DOC(i_cppClass, s_doc)
 Declare a Python class with automatic name and custom documentation.
 
#define PY_DECLARE_CLASS(i_cppClass)
 Declare a Python class with automatic name and no documentation.
 
#define PY_DECLARE_CLASS_EX(t_cppClass, s_name, i_uniqueClassIdentifier)
 Legacy class declaration macro.
 
Class Integration

Macros to add Python classes to modules.

These macros integrate class definitions with module definitions, making the classes available as types within the module namespace. Classes must first be declared using PY_DECLARE_CLASS_* macros before they can be added to modules.

#define PY_INJECT_CLASS_IN_MODULE(t_cppClass, i_module, s_doc)
 Inject a class into a module at runtime.
 
#define PY_MODULE_CLASS(i_module, t_cppClass)
 Add a Python class to a module.
 
Static Constants

These macros allow you to expose compile-time constant values as static attributes of Python classes.

The values are converted to Python objects using PyExportTraits and become accessible as class-level attributes in Python.

#define PY_CLASS_STATIC_CONST(i_cppClass, s_name, v_value)
 Export a static constant value as a class attribute.
 
Inner Classes

Macros for adding inner classes (nested classes) to Python-exported classes.

These macros establish class relationships where inner classes become attributes of their outer class in Python.

The basic form is

PY_CLASS_INNER_CLASS( i_outerCppClass, i_innerCppClass )
#define PY_CLASS_INNER_CLASS(i_outerCppClass, i_innerCppClass)
Exports an inner class with default name and no documentation.

with:

  • i_outerCppClass : C++ class that will contain the inner class
  • i_innerCppClass : C++ class to be exported as inner class
Common suffixes

The _NAME, _DOC and _EX suffixes allow you to specify a custom Python name, docstring, or (in rare cases) fully qualified typenames.

Macro Fixed parameters Adds parameters Use for ...
PY_CLASS_INNER_CLASS_NAME i_outerCppClass, i_innerCppClass s_name Custom Python name
PY_CLASS_INNER_CLASS_DOC i_outerCppClass, i_innerCppClass s_doc With docstring (deprecated)
PY_CLASS_INNER_CLASS_NAME_DOC i_outerCppClass, i_innerCppClass s_name, s_doc Custom Python name + Docstring (deprecated)
PY_CLASS_INNER_CLASS_EX t_outerCppClass, t_innerCppClass s_name, s_doc, i_uniqueSuffix Fully qualified typenames
Note
Inner classes must be declared with PY_DECLARE_CLASS* macros before using these macros.
The outer class may also be the parent class of the inner class.
The two *_DOC forms are deprecated as you should set the docstring when declaring the innerclass using PY_DECLARE_CLASS_DOC() or PY_DECLARE_CLASS_NAME_DOC()
Example
// Declare both classes first
PY_DECLARE_CLASS_DOC(Outer, "Outer class")
PY_DECLARE_CLASS_DOC(Inner, "Inner class")
// Establish inner class relationship
PY_CLASS_INNER_CLASS(Outer, Inner)
#define PY_DECLARE_CLASS_DOC(i_cppClass, s_doc)
Declare a Python class with automatic name and custom documentation.
#define PY_CLASS_INNER_CLASS_EX(t_outerCppClass, t_innerCppClass, s_name, s_doc, i_uniqueSuffix)
 Exports an inner class with full customization of name, documentation, and symbol suffix.
 
#define PY_CLASS_INNER_CLASS_NAME_DOC(i_outerCppClass, i_innerCppClass, s_name, s_doc)
 Exports an inner class with custom name and documentation.
 
#define PY_CLASS_INNER_CLASS_NAME(i_outerCppClass, i_innerCppClass, s_name)
 Exports an inner class with custom name but no documentation.
 
#define PY_CLASS_INNER_CLASS_DOC(i_outerCppClass, i_innerCppClass, s_doc)
 Exports an inner class with default name and custom documentation.
 
#define PY_CLASS_INNER_CLASS(i_outerCppClass, i_innerCppClass)
 Exports an inner class with default name and no documentation.
 
Simple Class Method Export Macros

These macros export C++ methods to Python with automatic type deduction and wrapper generation.

The basic form is:

PY_CLASS_METHOD( i_cppClass, i_cppMethod )
#define PY_CLASS_METHOD(i_cppClass, i_cppMethod)
Export a C++ method to Python.

with:

  • i_cppClass : C++ class containing the method, or its shadow class
  • i_cppMethod : C++ method name to export
Common suffixes

The _NAME, _DOC and _EX suffixes allow you to specify a custom Python name, docstring, or (in rare cases) a custom dispatcher name.

Macro Fixed parameters Adds parameters Use for ...
PY_CLASS_METHOD_NAME i_cppClass, i_cppMethod s_name Custom Python name
PY_CLASS_METHOD_DOC i_cppClass, i_cppMethod s_doc With docstring
PY_CLASS_METHOD_NAME_DOC i_cppClass, i_cppMethod s_name, s_doc Custom Python name + Docstring
PY_CLASS_METHOD_EX t_cppClass, i_cppMethod s_name, s_doc, i_dispatcher Custom dispatcher name

See above in Method Export Macros for more details about overloading and special operators.

#define PY_CLASS_METHOD_EX(t_cppClass, i_cppMethod, s_methodName, s_doc, i_dispatcher)
 Export a C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_NAME_DOC(i_cppClass, i_cppMethod, s_methodName, s_doc)
 Export a C++ method to Python, with custom name and docstring.
 
#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_DOC(i_cppClass, i_cppMethod, s_doc)
 Export a C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD(i_cppClass, i_cppMethod)
 Export a C++ method to Python.
 
Type-Qualified Method Export Macros

These macros export C++ class methods to Python with explicit type qualification to resolve method overload ambiguities.

They provide fine-grained control over method signatures and are essential when exporting overloaded methods that would otherwise be ambiguous.

Use these macros when you have overloaded C++ methods and need to specify exactly which overload to export to Python by providing explicit return and parameter types.

The list of parameter types can be passed as a single lass::meta::TypeTuple, or as individual arguments. For the latter, the _<N> tells the number of arguments. The _<N> form is the most often used one, and simply packs its types into a TypeTuple

Form Adds parameters
PY_CLASS_METHOD_QUALIFIED t_return, t_params as lass::meta::TypeTuple
PY_CLASS_METHOD_QUALIFIED_<N> t_return, t_P1, t_P2, ... `t_P<N>

They combine with the _NAME and _DOC suffixes, with the s_name, s_doc, i_dispatcher arguments following the function return and parameter types.

See above in Method Export Macros for more details about overloading and special operators.

#define PY_CLASS_METHOD_QUALIFIED_EX(t_cppClass, i_cppMethod, t_return, t_params, s_methodName, s_doc, i_dispatcher)
 Export an overloaded C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_0(t_cppClass, i_cppMethod, t_return, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 0-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_1(t_cppClass, i_cppMethod, t_return, t_P1, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 1-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_2(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 2-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_3(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 3-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_4(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 4-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_5(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 5-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_6(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 6-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_7(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 7-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_8(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 8-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_9(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 9-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_10(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 10-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_11(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 11-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_12(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 12-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_13(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 13-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_14(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 14-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_EX_15(t_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 15-ary C++ method to Python, with full control.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC(i_cppClass, i_cppMethod, t_return, t_params, s_methodName, s_doc)
 Export an overloaded C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_0(i_cppClass, i_cppMethod, t_return, s_methodName, s_doc)
 Export an overloaded 0-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_1(i_cppClass, i_cppMethod, t_return, t_P1, s_methodName, s_doc)
 Export an overloaded 1-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName, s_doc)
 Export an overloaded 2-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc)
 Export an overloaded 3-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc)
 Export an overloaded 4-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc)
 Export an overloaded 5-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc)
 Export an overloaded 6-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc)
 Export an overloaded 7-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc)
 Export an overloaded 8-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc)
 Export an overloaded 9-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc)
 Export an overloaded 10-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc)
 Export an overloaded 11-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc)
 Export an overloaded 12-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc)
 Export an overloaded 13-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc)
 Export an overloaded 14-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_DOC_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc)
 Export an overloaded 15-ary C++ method to Python, with custom name and docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME(i_cppClass, i_cppMethod, t_return, t_params, s_methodName)
 Export an overloaded C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_0(i_cppClass, i_cppMethod, t_return, s_methodName)
 Export an overloaded 0-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_1(i_cppClass, i_cppMethod, t_return, t_P1, s_methodName)
 Export an overloaded 1-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_methodName)
 Export an overloaded 2-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_methodName)
 Export an overloaded 3-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName)
 Export an overloaded 4-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName)
 Export an overloaded 5-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName)
 Export an overloaded 6-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName)
 Export an overloaded 7-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName)
 Export an overloaded 8-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName)
 Export an overloaded 9-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName)
 Export an overloaded 10-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName)
 Export an overloaded 11-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName)
 Export an overloaded 12-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName)
 Export an overloaded 13-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName)
 Export an overloaded 14-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_NAME_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName)
 Export an overloaded 15-ary C++ method to Python, with custom Python name.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC(i_cppClass, i_cppMethod, t_return, t_params, s_doc)
 Export an overloaded C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_0(i_cppClass, i_cppMethod, t_return, s_doc)
 Export an overloaded 0-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_1(i_cppClass, i_cppMethod, t_return, t_P1, s_doc)
 Export an overloaded 1-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, s_doc)
 Export an overloaded 2-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, s_doc)
 Export an overloaded 3-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_doc)
 Export an overloaded 4-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_doc)
 Export an overloaded 5-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_doc)
 Export an overloaded 6-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_doc)
 Export an overloaded 7-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_doc)
 Export an overloaded 8-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_doc)
 Export an overloaded 9-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_doc)
 Export an overloaded 10-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_doc)
 Export an overloaded 11-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_doc)
 Export an overloaded 12-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_doc)
 Export an overloaded 13-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_doc)
 Export an overloaded 14-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED_DOC_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_doc)
 Export an overloaded 15-ary C++ method to Python, with docstring.
 
#define PY_CLASS_METHOD_QUALIFIED(i_cppClass, i_cppMethod, t_return, t_params)
 Export an overloaded C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_0(i_cppClass, i_cppMethod, t_return)
 Export an overloaded 0-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_1(i_cppClass, i_cppMethod, t_return, t_P1)
 Export an overloaded 1-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_2(i_cppClass, i_cppMethod, t_return, t_P1, t_P2)
 Export an overloaded 2-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_3(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3)
 Export an overloaded 3-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_4(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4)
 Export an overloaded 4-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_5(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5)
 Export an overloaded 5-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_6(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Export an overloaded 6-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_7(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Export an overloaded 7-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_8(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Export an overloaded 8-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_9(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Export an overloaded 9-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_10(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Export an overloaded 10-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_11(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Export an overloaded 11-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_12(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Export an overloaded 12-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_13(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Export an overloaded 13-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_14(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Export an overloaded 14-ary C++ method to Python.
 
#define PY_CLASS_METHOD_QUALIFIED_15(i_cppClass, i_cppMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Export an overloaded 15-ary C++ method to Python.
 
Free Method Export Macros

Export C/C++ free functions as Python methods.

The first parameter of the free function becomes the implicit 'self' parameter and must be a pointer or reference (const or non-const) to the class being exported. This is particularly useful for Python Shadow Classes where adding methods directly to the class is undesirable or impossible.

The basic form is:

PY_CLASS_FREE_METHOD( t_cppClass, f_cppFreeMethod )
#define PY_CLASS_FREE_METHOD(i_cppClass, i_cppFreeMethod)
Export a free function as a Python method

with:

  • t_cppClass : C++ class containing the method, or its shadow class
  • f_cppFreeMethod : C++ function to export (can be function pointer or std::function)
Common suffixes

The _NAME, _DOC and _EX suffixes allow you to specify a custom Python name, docstring, or (in rare cases) a custom dispatcher name.

Macro Fixed parameters Adds parameters Use for ...
PY_CLASS_FREE_METHOD_NAME i_cppClass, f_cppFreeMethod s_methodName Custom Python name
PY_CLASS_FREE_METHOD_DOC i_cppClass, i_cppFreeMethod s_doc With docstring
PY_CLASS_FREE_METHOD_NAME_DOC i_cppClass, f_cppFreeMethod s_methodName, s_doc Custom Python name + Docstring
PY_CLASS_FREE_METHOD_EX t_cppClass, f_cppFreeMethod s_methodName, s_doc, i_dispatcher Custom dispatcher name

See above in Method Export Macros for more details about overloading and special operators.

#define PY_CLASS_FREE_METHOD_EX(t_cppClass, f_cppFreeMethod, s_methodName, s_doc, i_dispatcher)
 Export a free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_NAME_DOC(i_cppClass, f_cppFreeMethod, s_methodName, s_doc)
 Export a free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_NAME(i_cppClass, f_cppFreeMethod, s_methodName)
 Export a free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_DOC(i_cppClass, i_cppFreeMethod, s_doc)
 Export a free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD(i_cppClass, i_cppFreeMethod)
 Export a free function as a Python method
 
Type-Qualified Free Method Export Macros

Export C++ free functions as Python methods with explicit type qualification to resolve overload ambiguity.

These macros require explicit specification of return type and parameter types, making them suitable for overloaded free functions.

The first parameter of the free function becomes the implicit 'self' parameter and must be a pointer or reference (const or non-const) to the class being exported.

The list of parameter types can be passed as a single lass::meta::TypeTuple, or as individual arguments. For the latter, the _<N> tells the number of arguments. The _<N> form is the most often used one, and simply packs its types into a TypeTuple

Form Adds parameters
PY_CLASS_FREE_METHOD_QUALIFIED t_return, t_params as lass::meta::TypeTuple
PY_CLASS_FREE_METHOD_QUALIFIED_<N> t_return, t_P1, t_P2, ... `t_P<N>

They combine with the _NAME and _DOC suffixes, with the s_name, s_doc, i_dispatcher arguments following the function return and parameter types.

See above in Method Export Macros for more details about overloading and special operators.

Note
There's a special case for binary functions that implement reflected operators like __radd__. Because they are mapped on the same slot like the regular operator (e.g. both __add__ and __radd__ are mapped on lass::python::methods::add), they differ in the order of parameters: for the reversed operators, the self argument comes second.
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX(t_cppClass, f_cppFreeMethod, t_return, t_params, s_methodName, s_doc, i_dispatcher)
 Export an overloaded free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_0(t_cppClass, f_cppFreeMethod, t_return, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 0-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_1(t_cppClass, f_cppFreeMethod, t_return, t_P1, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 1-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_2(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 2-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_3(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 3-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_4(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 4-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_5(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 5-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_6(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 6-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_7(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 7-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_8(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 8-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_9(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 9-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_10(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 10-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_11(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 11-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_12(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 12-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_13(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 13-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_14(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 14-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_EX_15(t_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc, i_dispatcher)
 Export an overloaded 15-ary free function as a Python method, with full control.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC(i_cppClass, f_cppFreeMethod, t_return, t_params, s_methodName, s_doc)
 Export an overloaded free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_0(i_cppClass, f_cppFreeMethod, t_return, s_methodName, s_doc)
 Export an overloaded 0-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_1(i_cppClass, f_cppFreeMethod, t_return, t_P1, s_methodName, s_doc)
 Export an overloaded 1-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_2(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, s_methodName, s_doc)
 Export an overloaded 2-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_3(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, s_methodName, s_doc)
 Export an overloaded 3-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_4(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName, s_doc)
 Export an overloaded 4-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_5(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName, s_doc)
 Export an overloaded 5-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_6(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName, s_doc)
 Export an overloaded 6-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_7(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName, s_doc)
 Export an overloaded 7-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_8(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName, s_doc)
 Export an overloaded 8-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_9(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName, s_doc)
 Export an overloaded 9-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_10(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName, s_doc)
 Export an overloaded 10-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_11(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName, s_doc)
 Export an overloaded 11-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_12(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName, s_doc)
 Export an overloaded 12-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_13(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName, s_doc)
 Export an overloaded 13-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_14(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName, s_doc)
 Export an overloaded 14-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_DOC_15(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName, s_doc)
 Export an overloaded 15-ary free function as a Python method, with custom name and docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME(i_cppClass, f_cppFreeMethod, t_return, t_params, s_methodName)
 Export an overloaded free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_0(i_cppClass, f_cppFreeMethod, t_return, s_methodName)
 Export an overloaded 0-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_1(i_cppClass, f_cppFreeMethod, t_return, t_P1, s_methodName)
 Export an overloaded 1-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_2(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, s_methodName)
 Export an overloaded 2-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_3(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, s_methodName)
 Export an overloaded 3-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_4(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_methodName)
 Export an overloaded 4-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_5(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_methodName)
 Export an overloaded 5-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_6(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_methodName)
 Export an overloaded 6-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_7(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_methodName)
 Export an overloaded 7-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_8(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_methodName)
 Export an overloaded 8-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_9(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_methodName)
 Export an overloaded 9-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_10(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_methodName)
 Export an overloaded 10-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_11(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_methodName)
 Export an overloaded 11-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_12(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_methodName)
 Export an overloaded 12-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_13(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_methodName)
 Export an overloaded 13-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_14(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_methodName)
 Export an overloaded 14-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_NAME_15(i_cppClass, f_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_methodName)
 Export an overloaded 15-ary free function as a Python method, with custom Python name.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC(i_cppClass, i_cppFreeMethod, t_return, t_params, s_doc)
 Export an overloaded free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_0(i_cppClass, i_cppFreeMethod, t_return, s_doc)
 Export an overloaded 0-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_1(i_cppClass, i_cppFreeMethod, t_return, t_P1, s_doc)
 Export an overloaded 1-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_2(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, s_doc)
 Export an overloaded 2-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_3(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, s_doc)
 Export an overloaded 3-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_4(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, s_doc)
 Export an overloaded 4-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_5(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, s_doc)
 Export an overloaded 5-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_6(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, s_doc)
 Export an overloaded 6-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_7(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, s_doc)
 Export an overloaded 7-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_8(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, s_doc)
 Export an overloaded 8-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_9(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, s_doc)
 Export an overloaded 9-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_10(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, s_doc)
 Export an overloaded 10-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_11(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, s_doc)
 Export an overloaded 11-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_12(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, s_doc)
 Export an overloaded 12-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_13(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, s_doc)
 Export an overloaded 13-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_14(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, s_doc)
 Export an overloaded 14-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_DOC_15(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15, s_doc)
 Export an overloaded 15-ary free function as a Python method, with docstring.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED(i_cppClass, i_cppFreeMethod, t_return, t_params)
 Export an overloaded free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_0(i_cppClass, i_cppFreeMethod, t_return)
 Export an overloaded 0-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_1(i_cppClass, i_cppFreeMethod, t_return, t_P1)
 Export an overloaded 1-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_2(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2)
 Export an overloaded 2-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_3(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3)
 Export an overloaded 3-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_4(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4)
 Export an overloaded 4-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_5(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5)
 Export an overloaded 5-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_6(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Export an overloaded 6-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_7(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Export an overloaded 7-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_8(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Export an overloaded 8-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_9(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Export an overloaded 9-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_10(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Export an overloaded 10-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_11(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Export an overloaded 11-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_12(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Export an overloaded 12-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_13(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Export an overloaded 13-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_14(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Export an overloaded 14-ary free function as a Python method.
 
#define PY_CLASS_FREE_METHOD_QUALIFIED_15(i_cppClass, i_cppFreeMethod, t_return, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Export an overloaded 15-ary free function as a Python method.
 
Member Method Properties

Use C++ methods as getter/setter to define a Python property

Non-const and Const Getter

Although Python doesn't know the concept of constness, Python Shadow Classes may contain a reference to a constant shadowee instance. Getters may be overloaded on this constness and the PY_CLASS_MEMBER_* macros will take this into account. This allows you to overload a getter and return a non-const pointer to a member if the shadowee isn't const.

class Foo
{
public:
lass::util::SharedPtr<const Bar> bar() const;
lass::util::SharedPtr<Bar> bar();
};
PY_SHADOW_CLASS(DLL_EXPORT, PyFoo, Foo)
PY_DECLARE_CLASS_NAME(PyFoo, "Foo")
PY_CLASS_MEMBER_R(PyFoo, bar) // will return SharedPtr<const Bar> or SharedPtr<Bar> depending on Foo constness
#define PY_DECLARE_CLASS_NAME(t_cppClass, s_name)
Declare a Python class with custom name but no documentation.
#define PY_CLASS_MEMBER_R(i_cppClass, i_cppGetter)
Export a getter as a read-only Python property.
#define PY_SHADOW_CASTERS(t_ShadowObject)
Define lass::python::ShadoweeTraits for shadow class.

This also works in combination with a setter, using the PY_CLASS_MEMBER_RW* macros.

Two Forms of Setters

Setters may have one of following signatures:

  • take the new value as parameter, and have void as return type:
    void setName(const std::string& name);
  • have no paramater, but return a non-const reference to the member so it can be assigned to.
    float& price();

See example below.

Example
class Parrot: public lass::python::PyObjectPlus
{
public:
bool isAlive() const;
const std::string& name() const;
void setName(const std::string& name); // setter with parameter
float price() const;
float& price(); // setter through non-const reference
};
PY_CLASS_MEMBER_R_NAME_DOC(Parrot, isAlive, "alive", "is True if parrot isn't dead yet") // p.alive
PY_CLASS_MEMBER_RW(Parrot, name, setName) // p.name
PY_CLASS_MEMBER_RW(Parrot, price, price) // p.price
#define PY_CLASS_MEMBER_R_NAME_DOC(i_cppClass, i_cppGetter, s_memberName, s_doc)
Export a getter as a read-only Python property, with custom name and docstring.
#define PY_CLASS_MEMBER_RW(i_cppClass, i_cppGetter, i_cppSetter)
Export a getter/setter pair as a Python property.
Note
Member exports cannot be overloaded on types, and there are no qualified versions of these macros.
#define PY_CLASS_MEMBER_RW_EX(t_cppClass, i_cppGetter, i_cppSetter, s_memberName, s_doc, i_dispatcher)
 Export a getter/setter pair as a Python property, with full control.
 
#define PY_CLASS_MEMBER_RW_NAME_DOC(i_cppClass, i_cppGetter, i_cppSetter, s_memberName, s_doc)
 Export a getter/setter pair as a Python property, with custom name and docstring.
 
#define PY_CLASS_MEMBER_RW_NAME(i_cppClass, i_cppGetter, i_cppSetter, s_memberName)
 Export a getter/setter pair as a Python property, with custom Python name.
 
#define PY_CLASS_MEMBER_RW_DOC(i_cppClass, i_cppGetter, i_cppSetter, s_doc)
 Export a getter/setter pair as a Python property, with docstring.
 
#define PY_CLASS_MEMBER_RW(i_cppClass, i_cppGetter, i_cppSetter)
 Export a getter/setter pair as a Python property.
 
#define PY_CLASS_MEMBER_R_EX(t_cppClass, i_cppGetter, s_memberName, s_doc, i_dispatcher)
 Export a getter as a read-only Python property, with full control.
 
#define PY_CLASS_MEMBER_R_NAME_DOC(i_cppClass, i_cppGetter, s_memberName, s_doc)
 Export a getter as a read-only Python property, with custom name and docstring.
 
#define PY_CLASS_MEMBER_R_NAME(i_cppClass, i_cppGetter, s_memberName)
 Export a getter as a read-only Python property, with custom Python name.
 
#define PY_CLASS_MEMBER_R_DOC(i_cppClass, i_cppGetter, s_doc)
 Export a getter as a read-only Python property, with docstring.
 
#define PY_CLASS_MEMBER_R(i_cppClass, i_cppGetter)
 Export a getter as a read-only Python property.
 
Free Function Properties

Export C/C++ free functions as Python properties.

Use these when the getter/setter can't be a member. This is particularly useful for Python Shadow Classes where adding methods directly to the class is undesirable or impossible.

Example
class Parrot
{
PY_HEADER(python::PyObjectPlus)
public:
std::string name;
};
int getName(const Parrot& self)
{
return self.name;
}
void setName(Parrot& self, const std::string& name)
{
self.name = name;
}
PY_CLASS_FREE_MEMBER_RW_NAME(Parrot, getName, setName, "parrot")
#define PY_CLASS_FREE_MEMBER_RW_NAME(i_cppClass, i_cppFreeGetter, i_cppFreeSetter, s_memberName)
Export free accessors as a read-write Python property, with custom Python name.
Note
Member exports cannot be overloaded on types, and there are no qualified versions of these macros.
#define PY_CLASS_FREE_MEMBER_RW_EX(t_cppClass, i_cppFreeGetter, i_cppFreeSetter, s_memberName, s_doc, i_dispatcher)
 Export free accessors as a read-write Python property, with full control.
 
#define PY_CLASS_FREE_MEMBER_RW_NAME_DOC(i_cppClass, i_cppFreeGetter, i_cppFreeSetter, s_memberName, s_doc)
 Export free accessors as a read-write Python property, with custom name and docstring.
 
#define PY_CLASS_FREE_MEMBER_RW_NAME(i_cppClass, i_cppFreeGetter, i_cppFreeSetter, s_memberName)
 Export free accessors as a read-write Python property, with custom Python name.
 
#define PY_CLASS_FREE_MEMBER_RW_DOC(i_cppClass, i_cppFreeGetter, i_cppFreeSetter, s_doc)
 Export free accessors as a read-write Python property, with docstring.
 
#define PY_CLASS_FREE_MEMBER_RW(i_cppClass, i_cppFreeGetter, i_cppFreeSetter)
 Export free accessors as a read-write Python property.
 
#define PY_CLASS_FREE_MEMBER_R_EX(t_cppClass, i_cppFreeGetter, s_memberName, s_doc, i_dispatcher)
 Export a free accessor as a read-only Python property, with full control.
 
#define PY_CLASS_FREE_MEMBER_R_NAME_DOC(i_cppClass, i_cppFreeGetter, s_memberName, s_doc)
 Export a free accessor as a read-only Python property, with custom name and docstring.
 
#define PY_CLASS_FREE_MEMBER_R_NAME(i_cppClass, i_cppFreeGetter, s_memberName)
 Export a free accessor as a read-only Python property, with custom Python name.
 
#define PY_CLASS_FREE_MEMBER_R_DOC(i_cppClass, i_cppFreeGetter, s_doc)
 Export a free accessor as a read-only Python property, with docstring.
 
#define PY_CLASS_FREE_MEMBER_R(i_cppClass, i_cppFreeGetter)
 Export a free accessor as a read-only Python property.
 
Public Member Properties

Exports a public data member directly as a Python property, allowing both read and write access.

This provides direct access to the C++ member variable without requiring getter/setter methods.

Example
class Parrot
{
PY_HEADER(python::PyObjectPlus)
public:
std::string name;
const Color color;
};
PY_CLASS_PUBLIC_MEMBER_DOC(Parrot, name, "Parrot's name")
#define PY_CLASS_PUBLIC_MEMBER_DOC(i_cppClass, i_cppMember, s_doc)
Export a public member as a read-write Python property, with docstring.
#define PY_CLASS_PUBLIC_MEMBER_R(i_cppClass, i_cppMember)
Export a public member as a read-only Python property.
Note
Member exports cannot be overloaded on types, and there are no qualified versions of these macros.
#define PY_CLASS_PUBLIC_MEMBER_EX(t_cppClass, i_cppMember, s_memberName, s_doc, i_dispatcher)
 Export a public member as a read-write Python property, with full control.
 
#define PY_CLASS_PUBLIC_MEMBER_NAME_DOC(i_cppClass, i_cppMember, s_memberName, s_doc)
 Export a public member as a read-write Python property, with custom name and docstring.
 
#define PY_CLASS_PUBLIC_MEMBER_NAME(i_cppClass, i_cppMember, s_memberName)
 Export a public member as a read-write Python property, with custom Python name.
 
#define PY_CLASS_PUBLIC_MEMBER_DOC(i_cppClass, i_cppMember, s_doc)
 Export a public member as a read-write Python property, with docstring.
 
#define PY_CLASS_PUBLIC_MEMBER(i_cppClass, i_cppMember)
 Export a public member as a read-write Python property.
 
#define PY_CLASS_PUBLIC_MEMBER_R_EX(t_cppClass, i_cppMember, s_memberName, s_doc, i_dispatcher)
 Export a public member as a read-only Python property, with full control.
 
#define PY_CLASS_PUBLIC_MEMBER_R_NAME_DOC(i_cppClass, i_cppMember, s_memberName, s_doc)
 Export a public member as a read-only Python property, with custom name and docstring.
 
#define PY_CLASS_PUBLIC_MEMBER_R_NAME(i_cppClass, i_cppMember, s_memberName)
 Export a public member as a read-only Python property, with custom Python name.
 
#define PY_CLASS_PUBLIC_MEMBER_R_DOC(i_cppClass, i_cppMember, s_doc)
 Export a public member as a read-only Python property, with docstring.
 
#define PY_CLASS_PUBLIC_MEMBER_R(i_cppClass, i_cppMember)
 Export a public member as a read-only Python property.
 
Class Constructor Export Macros

Constructors need to be fully qualified to be exported.

You always need to provide the full list of parameter types to disambiguate overloaded constructors. This is why there are no _QUALIFIED versions of these macros, they already are fully qualified.

The list of parameter types can be passed as a single lass::meta::TypeTuple, or as individual arguments. For the latter, the _<N> tells the number of arguments. The _<N> form is the most often used one, and simply packs its types into a TypeTuple.

There's also the _EX form in case you need a custom dispatcher name, but that should be rarely used.

Form Fixed parameters Adds parameters
PY_CLASS_CONSTRUCTOR i_cppClass t_params as lass::meta::TypeTuple
PY_CLASS_CONSTRUCTOR_EX t_cppClass t_params, i_dispatcher
PY_CLASS_CONSTRUCTOR_<N> i_cppClass t_P1, t_P2, ... t_P<N>
#define PY_CLASS_CONSTRUCTOR_EX(t_cppClass, t_params, i_dispatcher)
 Export C++ constructor as Python class constructor with full control.
 
#define PY_CLASS_CONSTRUCTOR(i_cppClass, t_params)
 Export C++ constructor as Python class constructor.
 
#define PY_CLASS_CONSTRUCTOR_0(i_cppClass)
 Export C++ default constructor as Python class constructor.
 
#define PY_CLASS_CONSTRUCTOR_1(i_cppClass, t_P1)
 Export C++ constructor as Python class constructor with 1 parameters.
 
#define PY_CLASS_CONSTRUCTOR_2(i_cppClass, t_P1, t_P2)
 Export C++ constructor as Python class constructor with 2 parameters.
 
#define PY_CLASS_CONSTRUCTOR_3(i_cppClass, t_P1, t_P2, t_P3)
 Export C++ constructor as Python class constructor with 3 parameters.
 
#define PY_CLASS_CONSTRUCTOR_4(i_cppClass, t_P1, t_P2, t_P3, t_P4)
 Export C++ constructor as Python class constructor with 4 parameters.
 
#define PY_CLASS_CONSTRUCTOR_5(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5)
 Export C++ constructor as Python class constructor with 5 parameters.
 
#define PY_CLASS_CONSTRUCTOR_6(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Export C++ constructor as Python class constructor with 6 parameters.
 
#define PY_CLASS_CONSTRUCTOR_7(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Export C++ constructor as Python class constructor with 7 parameters.
 
#define PY_CLASS_CONSTRUCTOR_8(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Export C++ constructor as Python class constructor with 8 parameters.
 
#define PY_CLASS_CONSTRUCTOR_9(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Export C++ constructor as Python class constructor with 9 parameters.
 
#define PY_CLASS_CONSTRUCTOR_10(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Export C++ constructor as Python class constructor with 10 parameters.
 
#define PY_CLASS_CONSTRUCTOR_11(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Export C++ constructor as Python class constructor with 11 parameters.
 
#define PY_CLASS_CONSTRUCTOR_12(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Export C++ constructor as Python class constructor with 12 parameters.
 
#define PY_CLASS_CONSTRUCTOR_13(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Export C++ constructor as Python class constructor with 13 parameters.
 
#define PY_CLASS_CONSTRUCTOR_14(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Export C++ constructor as Python class constructor with 14 parameters.
 
#define PY_CLASS_CONSTRUCTOR_15(i_cppClass, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Export C++ constructor as Python class constructor with 15 parameters.
 
Free Function Constructor Export Macros

Export factory functions as Python class constructors.

These macros allow C++ functions that return instances of a class to be used as Python constructors. This is useful when you need special construction logic or when the actual constructor is not accessible from Python. The functions must return an instance of the target class.

Form Fixed parameters Adds parameters
PY_CLASS_FREE_CONSTRUCTOR i_cppClass, f_cppFunction t_params as lass::meta::TypeTuple
PY_CLASS_FREE_CONSTRUCTOR_EX t_cppClass, f_cppFunction t_params, i_dispatcher
PY_CLASS_FREE_CONSTRUCTOR_<N> i_cppClass, f_cppFunction t_P1, t_P2, ... t_P<N>
#define PY_CLASS_FREE_CONSTRUCTOR_EX(t_cppClass, f_cppFunction, t_params, i_dispatcher)
 Export free/static C++ factory function as Python constructor with full control.
 
#define PY_CLASS_FREE_CONSTRUCTOR(i_cppClass, f_cppFunction, t_params)
 Export free/static C++ factory function as Python class constructor.
 
#define PY_CLASS_FREE_CONSTRUCTOR_0(i_cppClass, f_cppFunction)
 Export free/static C++ factory function as Python constructor with 0 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_1(i_cppClass, f_cppFunction, t_P1)
 Export free/static C++ factory function as Python constructor with 1 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_2(i_cppClass, f_cppFunction, t_P1, t_P2)
 Export free/static C++ factory function as Python constructor with 2 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_3(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3)
 Export free/static C++ factory function as Python constructor with 3 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_4(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4)
 Export free/static C++ factory function as Python constructor with 4 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_5(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5)
 Export free/static C++ factory function as Python constructor with 5 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_6(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6)
 Export free/static C++ factory function as Python constructor with 6 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_7(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7)
 Export free/static C++ factory function as Python constructor with 7 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_8(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8)
 Export free/static C++ factory function as Python constructor with 8 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_9(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9)
 Export free/static C++ factory function as Python constructor with 9 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_10(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10)
 Export free/static C++ factory function as Python constructor with 10 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_11(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11)
 Export free/static C++ factory function as Python constructor with 11 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_12(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12)
 Export free/static C++ factory function as Python constructor with 12 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_13(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13)
 Export free/static C++ factory function as Python constructor with 13 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_14(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14)
 Export free/static C++ factory function as Python constructor with 14 parameters.
 
#define PY_CLASS_FREE_CONSTRUCTOR_15(i_cppClass, f_cppFunction, t_P1, t_P2, t_P3, t_P4, t_P5, t_P6, t_P7, t_P8, t_P9, t_P10, t_P11, t_P12, t_P13, t_P14, t_P15)
 Export free/static C++ factory function as Python constructor with 15 parameters.
 

Detailed Description

Author
Bram de Greve (bram@.nosp@m.coca.nosp@m.mware.nosp@m..com)
Tom De Muer (tom@c.nosp@m.ocam.nosp@m.ware..nosp@m.com)

*** BEGIN LICENSE INFORMATION ***

The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://lass.sourceforge.net/cpal-license. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Original Code is LASS - Library of Assembled Shared Sources.

The Initial Developer of the Original Code is Bram de Greve and Tom De Muer. The Original Developer is the Initial Developer.

All portions of the code written by the Initial Developer are: Copyright (C) 2004-2026 the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the GPL), in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the GPL.

*** END LICENSE INFORMATION ***

Definition in file pyobject_macros.h.