Q3AsciiDict< type > Class Template Reference

#include <q3asciidict.h>

Inheritance diagram for Q3AsciiDict< type >:

Inheritance graph
[legend]
Collaboration diagram for Q3AsciiDict< type >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class type>
class Q3AsciiDict< type >

Definition at line 34 of file q3asciidict.h.

Public Member Functions

 Q3AsciiDict (int size=17, bool caseSensitive=true, bool copyKeys=true)
 Q3AsciiDict (const Q3AsciiDict< type > &d)
 ~Q3AsciiDict ()
Q3AsciiDict< type > & operator= (const Q3AsciiDict< type > &d)
uint count () const
uint size () const
bool isEmpty () const
void insert (const char *k, const type *d)
void replace (const char *k, const type *d)
bool remove (const char *k)
typetake (const char *k)
typefind (const char *k) const
typeoperator[] (const char *k) const
void clear ()
void resize (uint n)
void statistics () const
template<>
void deleteItem (Q3PtrCollection::Item)

Private Member Functions

void deleteItem (Item d)


Constructor & Destructor Documentation

template<class type>
Q3AsciiDict< type >::Q3AsciiDict ( int  size = 17,
bool  caseSensitive = true,
bool  copyKeys = true 
) [inline]

Definition at line 42 of file q3asciidict.h.

00043   : Q3GDict(size,AsciiKey,caseSensitive,copyKeys) {}

template<class type>
Q3AsciiDict< type >::Q3AsciiDict ( const Q3AsciiDict< type > &  d  )  [inline]

Definition at line 44 of file q3asciidict.h.

00044 : Q3GDict(d) {}

template<class type>
Q3AsciiDict< type >::~Q3AsciiDict (  )  [inline]

Definition at line 45 of file q3asciidict.h.

00045 { clear(); }


Member Function Documentation

template<class type>
Q3AsciiDict<type>& Q3AsciiDict< type >::operator= ( const Q3AsciiDict< type > &  d  )  [inline]

Definition at line 46 of file q3asciidict.h.

Referenced by Q3ObjectDictionary::operator=().

00047       { return (Q3AsciiDict<type>&)Q3GDict::operator=(d); }

template<class type>
uint Q3AsciiDict< type >::count (  )  const [inline, virtual]

Returns the number of items in the dictionary.

Reimplemented from Q3GDict.

Definition at line 48 of file q3asciidict.h.

00048 { return Q3GDict::count(); }

template<class type>
uint Q3AsciiDict< type >::size (  )  const [inline]

Returns the size of the hash array.

Reimplemented from Q3GDict.

Definition at line 49 of file q3asciidict.h.

00049 { return Q3GDict::size(); }

template<class type>
bool Q3AsciiDict< type >::isEmpty (  )  const [inline]

Definition at line 50 of file q3asciidict.h.

00050 { return Q3GDict::count() == 0; }

template<class type>
void Q3AsciiDict< type >::insert ( const char *  k,
const type d 
) [inline]

Definition at line 52 of file q3asciidict.h.

00053           { Q3GDict::look_ascii(k,(Item)d,1); }

template<class type>
void Q3AsciiDict< type >::replace ( const char *  k,
const type d 
) [inline]

Definition at line 54 of file q3asciidict.h.

00055           { Q3GDict::look_ascii(k,(Item)d,2); }

template<class type>
bool Q3AsciiDict< type >::remove ( const char *  k  )  [inline]

Definition at line 56 of file q3asciidict.h.

00056 { return Q3GDict::remove_ascii(k); }

template<class type>
type* Q3AsciiDict< type >::take ( const char *  k  )  [inline]

Definition at line 57 of file q3asciidict.h.

00057 { return (type *)Q3GDict::take_ascii(k); }

template<class type>
type* Q3AsciiDict< type >::find ( const char *  k  )  const [inline]

Definition at line 58 of file q3asciidict.h.

00059     { return (type *)((Q3GDict*)this)->Q3GDict::look_ascii(k,0,0); }

template<class type>
type* Q3AsciiDict< type >::operator[] ( const char *  k  )  const [inline]

Definition at line 60 of file q3asciidict.h.

00061     { return (type *)((Q3GDict*)this)->Q3GDict::look_ascii(k,0,0); }

template<class type>
void Q3AsciiDict< type >::clear (  )  [inline, virtual]

Removes all items from the dictionary.

Reimplemented from Q3GDict.

Definition at line 63 of file q3asciidict.h.

00063 { Q3GDict::clear(); }

template<class type>
void Q3AsciiDict< type >::resize ( uint  n  )  [inline]

Changes the size of the hashtable to newsize. The contents of the dictionary are preserved, but all iterators on the dictionary become invalid.

Reimplemented from Q3GDict.

Definition at line 64 of file q3asciidict.h.

00064 { Q3GDict::resize(n); }

template<class type>
void Q3AsciiDict< type >::statistics (  )  const [inline]

Outputs debug statistics.

Reimplemented from Q3GDict.

Definition at line 65 of file q3asciidict.h.

00065 { Q3GDict::statistics(); }

template<class type>
void Q3AsciiDict< type >::deleteItem ( Item  d  )  [private, virtual]

Reimplement this function if you want to be able to delete items.

Deletes an item that is about to be removed from the collection.

This function has to reimplemented in the collection template classes, and should only delete item d if auto-delete has been enabled.

Warning:
If you reimplement this function you must also reimplement the destructor and call the virtual function clear() from your destructor. This is due to the way virtual functions and destructors work in C++: Virtual functions in derived classes cannot be called from a destructor. If you do not do this, your deleteItem() function will not be called when the container is destroyed.
See also:
newItem(), setAutoDelete()

Implements Q3PtrCollection.

template<>
void Q3AsciiDict< type >::deleteItem ( Q3PtrCollection::Item  d  )  [inline]

Definition at line 78 of file q3asciidict.h.

00079 {
00080 }


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 15:41:20 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1