diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-20 14:09:18 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-20 14:37:41 -0300 |
commit | 63745320ed1c2f61f472d7f438317cef0808fe35 (patch) | |
tree | bcc215e52f6d5a6cf6ccfbc8faccea9acc71a6c5 /cppgenerator.h | |
parent | d4325c727704f294019a759d20a4fda57bb4d5dc (diff) |
Added the writeNoneReturn method to CppGenerator to attribute Py_None
to the Python method wrapper return variable, after a call to a C++
function that returns void, but only when any of its other overloads
has a return type different from void.
Also documented the CppGenerator::writeOverloadedMethodDecisor method.
Diffstat (limited to 'cppgenerator.h')
-rw-r--r-- | cppgenerator.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cppgenerator.h b/cppgenerator.h index a90e3da22..237dc68b7 100644 --- a/cppgenerator.h +++ b/cppgenerator.h @@ -82,6 +82,23 @@ private: writeArgumentConversion(s, arg->type(), argName, pyArgName, context); } + /** + * Set the Python method wrapper return value variable to Py_None if + * there are return types different from void in any of the other overloads + * for the function passed as parameter. + * \param s text stream to write + * \param func a pointer to the function that will possibly return Py_None + * \param thereIsReturnValue indicates if the return type of any of the other overloads + * for this function is different from 'void' + */ + void writeNoneReturn(QTextStream& s, const AbstractMetaFunction* func, bool thereIsReturnValue); + + /** + * Writes the Python method wrapper overload decisor that selects which C++ + * method/function to call with the received Python arguments. + * \param s text stream to write + * \param parentOverloadData a pointer to overload data describing the argument being evaluated + */ void writeOverloadedMethodDecisor(QTextStream& s, OverloadData* parentOverloadData); void writeMethodCall(QTextStream& s, const AbstractMetaFunction* func, int maxArgs = 0); |