Q3AsciiCache< type > Class Template Reference

#include <q3asciicache.h>

Inheritance diagram for Q3AsciiCache< type >:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class type>
class Q3AsciiCache< type >

Definition at line 34 of file q3asciicache.h.

Public Member Functions

 Q3AsciiCache (const Q3AsciiCache< type > &c)
 Q3AsciiCache (int maxCost=100, int size=17, bool caseSensitive=true, bool copyKeys=true)
 ~Q3AsciiCache ()
Q3AsciiCache< type > & operator= (const Q3AsciiCache< type > &c)
int maxCost () const
int totalCost () const
void setMaxCost (int m)
uint count () const
uint size () const
bool isEmpty () const
void clear ()
bool insert (const char *k, const type *d, int c=1, int p=0)
bool remove (const char *k)
typetake (const char *k)
typefind (const char *k, bool ref=true) const
typeoperator[] (const char *k) const
void statistics () const
template<>
void deleteItem (Q3PtrCollection::Item)

Private Member Functions

void deleteItem (Item d)


Constructor & Destructor Documentation

template<class type>
Q3AsciiCache< type >::Q3AsciiCache ( const Q3AsciiCache< type > &  c  )  [inline]

Definition at line 42 of file q3asciicache.h.

00042 : Q3GCache(c) {}

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

Definition at line 43 of file q3asciicache.h.

00045   : Q3GCache(maxCost, size, AsciiKey, caseSensitive, copyKeys) {}

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

Definition at line 46 of file q3asciicache.h.

References clear().

00046 { clear(); }

Here is the call graph for this function:


Member Function Documentation

template<class type>
Q3AsciiCache<type>& Q3AsciiCache< type >::operator= ( const Q3AsciiCache< type > &  c  )  [inline]

Definition at line 47 of file q3asciicache.h.

References c, and Q3GCache::operator=().

Here is the call graph for this function:

template<class type>
int Q3AsciiCache< type >::maxCost (  )  const [inline]

Returns the maximum cache cost.

Reimplemented from Q3GCache.

Definition at line 49 of file q3asciicache.h.

References Q3GCache::maxCost().

00049 { return Q3GCache::maxCost(); }

Here is the call graph for this function:

template<class type>
int Q3AsciiCache< type >::totalCost (  )  const [inline]

Returns the total cache cost.

Reimplemented from Q3GCache.

Definition at line 50 of file q3asciicache.h.

References Q3GCache::totalCost().

00050 { return Q3GCache::totalCost(); }

Here is the call graph for this function:

template<class type>
void Q3AsciiCache< type >::setMaxCost ( int  m  )  [inline]

Sets the maximum cache cost to maxCost.

Reimplemented from Q3GCache.

Definition at line 51 of file q3asciicache.h.

References Q3GCache::setMaxCost().

00051 { Q3GCache::setMaxCost(m); }

Here is the call graph for this function:

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

Returns the number of items in the cache.

Reimplemented from Q3GCache.

Definition at line 52 of file q3asciicache.h.

References Q3GCache::count().

00052 { return Q3GCache::count(); }

Here is the call graph for this function:

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

Returns the size of the hash array.

Reimplemented from Q3GCache.

Definition at line 53 of file q3asciicache.h.

References Q3GCache::size().

00053 { return Q3GCache::size(); }

Here is the call graph for this function:

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

Definition at line 54 of file q3asciicache.h.

References Q3GCache::count().

00054 { return Q3GCache::count() == 0; }

Here is the call graph for this function:

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

Clears the cache.

Reimplemented from Q3GCache.

Definition at line 55 of file q3asciicache.h.

References Q3GCache::clear().

00055 { Q3GCache::clear(); }

Here is the call graph for this function:

template<class type>
bool Q3AsciiCache< type >::insert ( const char *  k,
const type d,
int  c = 1,
int  p = 0 
) [inline]

Definition at line 56 of file q3asciicache.h.

References c, Q3GCache::insert_other(), and p.

00057       { return Q3GCache::insert_other(k,(Item)d,c,p);}

Here is the call graph for this function:

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

Definition at line 58 of file q3asciicache.h.

References Q3GCache::remove_other().

00059       { return Q3GCache::remove_other(k); }

Here is the call graph for this function:

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

Definition at line 60 of file q3asciicache.h.

References Q3GCache::take_other(), and type.

00061       { return (type *)Q3GCache::take_other(k); }

Here is the call graph for this function:

template<class type>
type* Q3AsciiCache< type >::find ( const char *  k,
bool  ref = true 
) const [inline]

Definition at line 62 of file q3asciicache.h.

References Q3GCache::find_other(), and type.

00063       { return (type *)Q3GCache::find_other(k,ref);}

Here is the call graph for this function:

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

Definition at line 64 of file q3asciicache.h.

References Q3GCache::find_other(), and type.

00065       { return (type *)Q3GCache::find_other(k);}

Here is the call graph for this function:

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

Outputs debug statistics.

Reimplemented from Q3GCache.

Definition at line 66 of file q3asciicache.h.

References Q3GCache::statistics().

00066 { Q3GCache::statistics(); }

Here is the call graph for this function:

template<class type>
void Q3AsciiCache< 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 Q3AsciiCache< type >::deleteItem ( Q3PtrCollection::Item  d  )  [inline]

Definition at line 72 of file q3asciicache.h.

00073 {
00074 }


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