aboutsummaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-07-29 01:48:02 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:06 -0300
commit34395eeb8c57f2225c7f20b9e20f9d92f2131ce7 (patch)
treec81d6dec4f2087f4b3d48c93f0cf523a1bf6dc6f /generator/cppgenerator.h
parent0c99d3754d54cf9f9e6f8c7c608534bdcad4a3e3 (diff)
Added a method to retrieve a function's argument type
The method in question is CppGenerator::getArgumentType(), and it resolves any type modification made in the type system. Also remove an unused convenience method for writeArgumentConversion, and unused variable on rich comparison writer function.
Diffstat (limited to 'generator/cppgenerator.h')
-rw-r--r--generator/cppgenerator.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/generator/cppgenerator.h b/generator/cppgenerator.h
index df3a6604f..19e8f0c50 100644
--- a/generator/cppgenerator.h
+++ b/generator/cppgenerator.h
@@ -86,14 +86,19 @@ private:
const QString& argName, const QString& pyArgName,
const AbstractMetaClass* context = 0,
const QString& defaultValue = QString());
- /// Convenience method to call writeArgumentConversion with an AbstractMetaArgument instead of an AbstractMetaType.
- void writeArgumentConversion(QTextStream& s, const AbstractMetaArgument* arg,
- const QString& argName, const QString& pyArgName,
- const AbstractMetaClass* context = 0,
- const QString& defaultValue = QString())
- {
- writeArgumentConversion(s, arg->type(), argName, pyArgName, context, defaultValue);
- }
+
+ /**
+ * Returns the AbstractMetaType for a function argument.
+ * If the argument type was modified in the type system, this method will
+ * try to build a new type based on the type name defined in the type system.
+ * \param func The function which owns the argument.
+ * \param argPos Argument position in the function signature.
+ * Note that the position 0 represents the return value, and the function
+ * parameters start counting on 1.
+ * \param newType It is set to true if the type returned is a new object that must be deallocated.
+ * \return The type of the argument indicated by \p argPos.
+ */
+ const AbstractMetaType* getArgumentType(const AbstractMetaFunction* func, int argPos, bool* newType);
void writePythonToCppTypeConversion(QTextStream& s,
const AbstractMetaType* type,
@@ -240,4 +245,3 @@ private:
};
#endif // CPPGENERATOR_H
-