diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2000-12-17 15:15:12 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2000-12-17 15:15:12 (GMT) |
commit | 00415514455991a9ff44b926c50adda994128924 (patch) | |
tree | 8face58cec7cf3e5e23acec30b6af55f5bed931c /src/sortdict.h | |
parent | 5167cf2076e30ed3f6ddd84b76543a0dff207496 (diff) | |
download | Doxygen-00415514455991a9ff44b926c50adda994128924.zip Doxygen-00415514455991a9ff44b926c50adda994128924.tar.gz Doxygen-00415514455991a9ff44b926c50adda994128924.tar.bz2 |
Release-1.2.3-20001217
Diffstat (limited to 'src/sortdict.h')
-rw-r--r-- | src/sortdict.h | 40 |
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 |