diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-10-19 11:35:45 -0300 |
---|---|---|
committer | Luciano Miguel Wolf <luciano.wolf@indt.org.br> | 2009-10-21 16:34:20 -0300 |
commit | fa5c2fa99cd0dae464f3cfa6686e2a31f2684687 (patch) | |
tree | 7b6a2c2ff82129452cff85a787bf69800bd3ff3b | |
parent | f2bb27557caa1a97f73b690650bcad746418a7c7 (diff) |
added AddFunction struct to type system collection of objects;
the purpose is to allow the creation of new function/method signatures
-rw-r--r-- | typesystem.cpp | 6 | ||||
-rw-r--r-- | typesystem.h | 46 |
2 files changed, 52 insertions, 0 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index 9a31a8da5..bed0b3512 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -1994,6 +1994,12 @@ QString FunctionModification::toString() const return str; } +AddedFunction::AddedFunction(QString signature, TypeEntry* returnType) + : m_returnType(returnType) +{ + +} + /* static void injectCode(ComplexTypeEntry *e, const char *signature, diff --git a/typesystem.h b/typesystem.h index 945461a2d..80e5bfdc1 100644 --- a/typesystem.h +++ b/typesystem.h @@ -441,6 +441,52 @@ struct FieldModification: public Modification }; typedef QList<FieldModification> FieldModificationList; +struct AddedFunction +{ + AddedFunction(QString signature, TypeEntry* returnType); + + QString name() const + { + return m_name; + } + + TypeEntry* returnType() const + { + return m_returnType; + } + + CodeSnipList codeSnips() const + { + return m_codeSnips; + } + + void setCodeSnips(const CodeSnipList& codeSnips) + { + m_codeSnips = codeSnips; + } + + void addCodeSnip(const CodeSnip& codeSnip) + { + m_codeSnips << codeSnip; + } + + QList<QPair<ArgumentPair, const TypeEntry*> > arguments() + { + return m_arguments; + } + + // ArgumentPair.first: argument name + // ArgumentPair.second: default value + typedef QPair<QString, QString> ArgumentPair; + +private: + QString m_name; + QList<QPair<ArgumentPair, const TypeEntry*> > m_arguments; + TypeEntry* m_returnType; + CodeSnipList m_codeSnips; +}; +typedef QList<AddedFunction> AddedFunctionList; + struct ExpensePolicy { ExpensePolicy() : limit(-1) {} |