From e540d86f173b151997313ba23e7fe382bd2623c4 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Tue, 19 Jan 2010 13:55:35 -0300 Subject: 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. --- overloaddata.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'overloaddata.h') 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 overloads() const { return m_overloads; } + const QList& overloads() const { return m_overloads; } OverloadDataList nextOverloadData() const { return m_nextOverloadData; } QList invalidArgumentLengths() const; -- cgit v1.2.3