summaryrefslogtreecommitdiffstats
path: root/src/sortdict.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-12-17 15:15:12 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-12-17 15:15:12 (GMT)
commit6505abff80c988faf734b2e4c31cd2a94c2c10b5 (patch)
tree8face58cec7cf3e5e23acec30b6af55f5bed931c /src/sortdict.h
parentfe67b8eb68129713327965c201f2d7226b83202f (diff)
downloadDoxygen-6505abff80c988faf734b2e4c31cd2a94c2c10b5.zip
Doxygen-6505abff80c988faf734b2e4c31cd2a94c2c10b5.tar.gz
Doxygen-6505abff80c988faf734b2e4c31cd2a94c2c10b5.tar.bz2
Release-1.2.3-20001217
Diffstat (limited to 'src/sortdict.h')
-rw-r--r--src/sortdict.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/sortdict.h b/src/sortdict.h
index 471a447..9c46e9b 100644
--- a/src/sortdict.h
+++ b/src/sortdict.h
@@ -23,6 +23,25 @@
#include <qlist.h>
#include <qdict.h>
+template<class T> class SDict;
+
+/*! internal wrapper class that redirects compareItems() to the
+ * dictionary
+ */
+template<class T>
+class SList : public QList<T>
+{
+ public:
+ SList(SDict<T> *owner) : m_owner(owner) {}
+ ~SList() {}
+ int compareItems(GCI item1,GCI item2)
+ {
+ return m_owner->compareItems(item1,item2);
+ }
+ private:
+ SDict<T> *m_owner;
+};
+
/*! Ordered dictionary of elements of type T.
* Internally uses a QList<T> and a QDict<T>.
*/
@@ -30,23 +49,7 @@ template<class T>
class SDict
{
private:
-
- /*! internal wrapper class that redirects compareItems() to the
- * dictionary
- */
- class SList : public QList<T>
- {
- public:
- SList(SDict<T> *owner) : m_owner(owner) {}
- ~SList() {}
- int compareItems(GCI item1,GCI item2)
- {
- return m_owner->compareItems(item1,item2);
- }
- private:
- SDict<T> *m_owner;
- };
- SList *m_list;
+ SList<T> *m_list;
QDict<T> *m_dict;
public:
@@ -56,7 +59,7 @@ class SDict
*/
SDict(int size)
{
- m_list = new SList(this);
+ m_list = new SList<T>(this);
m_dict = new QDict<T>(size);
}
/*! Destroys the dictionary */
@@ -169,5 +172,4 @@ class SDict
};
-
#endif