Public Member Functions | Private Member Functions | List of all members
LetterToIndexMap< T > Class Template Reference

maps a unicode character code to a list of T::ElementType's More...

#include <util.h>

Inheritance diagram for LetterToIndexMap< T >:
SIntDict< T >

Public Member Functions

 LetterToIndexMap ()
 
void append (uint letter, typename T::ElementType *elem)
 
- Public Member Functions inherited from SIntDict< T >
 SIntDict (int size=17)
 
virtual ~SIntDict ()
 
void append (int key, const T *d)
 
void prepend (int key, const T *d)
 
bool remove (int key)
 
void sort ()
 
void inSort (int key, const T *d)
 
void setAutoDelete (bool val)
 
T * find (int key)
 
T * operator[] (int key) const
 
T * at (uint i)
 
void clear ()
 
int count ()
 

Private Member Functions

int compareValues (const T *l1, const T *l2) const
 

Detailed Description

template<class T>
class LetterToIndexMap< T >

maps a unicode character code to a list of T::ElementType's

Definition at line 96 of file util.h.

Constructor & Destructor Documentation

template<class T>
LetterToIndexMap< T >::LetterToIndexMap ( )
inline

Definition at line 99 of file util.h.

void setAutoDelete(bool val)
Definition: sortdict.h:545
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

template<class T>
void LetterToIndexMap< T >::append ( uint  letter,
typename T::ElementType *  elem 
)
inline

Definition at line 100 of file util.h.

101  {
102  T *l = SIntDict<T>::find((int)letter);
103  if (l==0)
104  {
105  l = new T(letter);
106  SIntDict<T>::inSort((int)letter,l);
107  }
108  l->append(elem);
109  }
T * find(int key)
Definition: sortdict.h:555
static QStrList * l
Definition: config.cpp:1044
void inSort(int key, const T *d)
Definition: sortdict.h:532
template<class T>
int LetterToIndexMap< T >::compareValues ( const T *  item1,
const T *  item2 
) const
inlineprivatevirtual

Function that is used to compare two items when sorting. Overload this to properly sort items.

See also
inSort()

Reimplemented from SIntDict< T >.

Definition at line 111 of file util.h.

112  {
113  return (int)l1->letter()-(int)l2->letter();
114  }

The documentation for this class was generated from the following file: