summaryrefslogtreecommitdiffstats
path: root/overloaddata.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-29 11:51:53 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-10-30 14:24:20 -0300
commitcb4b14c179887735ffa925ea01de333c3ed41677 (patch)
treeacdcc074079d3b7ca368ad9c108b82b40dffd841 /overloaddata.h
parent10b5327e02c3ce3f7339226c6289ce0daf230d95 (diff)
downloadshiboken-cb4b14c179887735ffa925ea01de333c3ed41677.tar.gz
shiboken-cb4b14c179887735ffa925ea01de333c3ed41677.tar.xz
shiboken-cb4b14c179887735ffa925ea01de333c3ed41677.zip
improved OverloadData class to sort the alternative arguments putting
the primitive types first and moving down the wrapper objects with more implicit converversions; this ordering scheme is needed to avoid unnecessary (and sometimes wrong) conversions
Diffstat (limited to 'overloaddata.h')
-rw-r--r--overloaddata.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/overloaddata.h b/overloaddata.h
index 508aca78..5fd6ff54 100644
--- a/overloaddata.h
+++ b/overloaddata.h
@@ -28,13 +28,15 @@
#include <QtCore/QList>
#include <QtCore/QBitArray>
+#include "shibokengenerator.h"
+
class OverloadData;
typedef QList<OverloadData*> OverloadDataList;
class OverloadData
{
public:
- OverloadData(const AbstractMetaFunctionList overloads);
+ OverloadData(const AbstractMetaFunctionList overloads, const ShibokenGenerator* generator);
int minArgs() const { return m_headOverloadData->m_minArgs; }
int maxArgs() const { return m_headOverloadData->m_maxArgs; }
@@ -61,11 +63,13 @@ public:
void dumpGraph(QString filename) const;
QString dumpGraph() const;
+ int argTypeWeight() const { return m_argTypeWeight; }
+
~OverloadData();
private:
OverloadData(OverloadData* headOverloadData, const AbstractMetaFunction* func,
- const AbstractMetaType* argType, int argPos);
+ const AbstractMetaType* argType, int argPos);
void addOverload(const AbstractMetaFunction* func);
OverloadData* addOverloadData(const AbstractMetaFunction* func, const AbstractMetaType* argType);
@@ -77,10 +81,12 @@ private:
int m_maxArgs;
int m_argPos;
const AbstractMetaType* m_argType;
+ int m_argTypeWeight;
QList<const AbstractMetaFunction*> m_overloads;
OverloadData* m_headOverloadData;
OverloadDataList m_nextOverloadData;
+ const ShibokenGenerator* m_generator;
};