aboutsummaryrefslogtreecommitdiffstats
path: root/overloaddata.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-01-19 13:55:35 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-01-19 14:36:12 -0300
commite540d86f173b151997313ba23e7fe382bd2623c4 (patch)
tree85f4b84135956a1aa31f13d15189da37bf028219 /overloaddata.h
parent2e7bab62943ada0320ce0cd7c8a6d6be6e64a6f3 (diff)
Adds helpers to OverloadData to check for static and non-static methods.
OverloadDecisor received some new methods: hasStaticFunction, hasInstanceFunction and hasStaticAndInstanceFunctions. They are useful to check if an overload contains both static and non-static signatures.
Diffstat (limited to 'overloaddata.h')
-rw-r--r--overloaddata.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/overloaddata.h b/overloaddata.h
index 86c93cfef..4b324f5b5 100644
--- a/overloaddata.h
+++ b/overloaddata.h
@@ -57,6 +57,24 @@ public:
/// Returns true if any of the overloads for the current OverloadData allows threads when called.
bool hasAllowThread() const;
+ /// Returns true if any of the overloads for the current OverloadData is static.
+ bool hasStaticFunction() const;
+
+ /// Returns true if any of the overloads passed as argument is static.
+ static bool hasStaticFunction(const AbstractMetaFunctionList& overloads);
+
+ /// Returns true if any of the overloads for the current OverloadData is not static.
+ bool hasInstanceFunction() const;
+
+ /// Returns true if any of the overloads passed as argument is not static.
+ static bool hasInstanceFunction(const AbstractMetaFunctionList& overloads);
+
+ /// Returns true if among the overloads for the current OverloadData there are static and non-static methods altogether.
+ bool hasStaticAndInstanceFunctions() const;
+
+ /// Returns true if among the overloads passed as argument there are static and non-static methods altogether.
+ static bool hasStaticAndInstanceFunctions(const AbstractMetaFunctionList& overloads);
+
const AbstractMetaFunction* referenceFunction() const;
const AbstractMetaArgument* argument(const AbstractMetaFunction* func) const;
OverloadDataList overloadDataOnPosition(int argPos) const;
@@ -74,7 +92,7 @@ public:
OverloadData* findNextArgWithDefault();
bool isFinalOccurrence(const AbstractMetaFunction* func) const;
- QList<const AbstractMetaFunction*> overloads() const { return m_overloads; }
+ const QList<const AbstractMetaFunction*>& overloads() const { return m_overloads; }
OverloadDataList nextOverloadData() const { return m_nextOverloadData; }
QList<int> invalidArgumentLengths() const;