aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-19 11:35:45 -0300
committerLuciano Miguel Wolf <luciano.wolf@indt.org.br>2009-10-21 16:34:20 -0300
commitfa5c2fa99cd0dae464f3cfa6686e2a31f2684687 (patch)
tree7b6a2c2ff82129452cff85a787bf69800bd3ff3b /typesystem.h
parentf2bb27557caa1a97f73b690650bcad746418a7c7 (diff)
added AddFunction struct to type system collection of objects;
the purpose is to allow the creation of new function/method signatures
Diffstat (limited to 'typesystem.h')
-rw-r--r--typesystem.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/typesystem.h b/typesystem.h
index 945461a2..80e5bfdc 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) {}