From fa5c2fa99cd0dae464f3cfa6686e2a31f2684687 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Mon, 19 Oct 2009 11:35:45 -0300 Subject: added AddFunction struct to type system collection of objects; the purpose is to allow the creation of new function/method signatures --- typesystem.cpp | 6 ++++++ typesystem.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) 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 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 > arguments() + { + return m_arguments; + } + + // ArgumentPair.first: argument name + // ArgumentPair.second: default value + typedef QPair ArgumentPair; + +private: + QString m_name; + QList > m_arguments; + TypeEntry* m_returnType; + CodeSnipList m_codeSnips; +}; +typedef QList AddedFunctionList; + struct ExpensePolicy { ExpensePolicy() : limit(-1) {} -- cgit v1.2.3