FX::QInt64Dict< type > Class Template Reference
[Qt Template Library]

#include <qint64dict.h>

Inheritance diagram for FX::QInt64Dict< type >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class type>
class FX::QInt64Dict< type >

A QIntDict with 64 bit keys.

See also:
FX::QDict

Public Types

enum  
typedef FXlong KeyType
typedef type ItemType

Public Member Functions

 QInt64Dict (int size=13, bool wantAutoDel=false)
void insert (FXlong k, const type *d)
void replace (FXlong k, const type *d)
bool remove (FXlong k)
type * take (FXlong k)
type * find (FXlong k) const
type * operator[] (FXlong k) const
template<>
void deleteItem (void *)
bool autoDelete () const
void setAutoDelete (bool a)
uint count () const
bool isEmpty () const
uint size () const
void clear ()
void append (const QDictBase< FXlong, type > &o)
QDictBase< FXlong, type > & operator+= (const QDictBase< FXlong, type > &o)
void resize (uint newsize)
void safeResize (uint newsize) throw ()
void spread (float *full, float *slotsspread, float *avrgkeysperslot, float *spread) const
void statistics () const
FXint dictionaryBias () const throw ()

Protected Types

typedef std::map< FXlong,
hashitemlist > 
keyitemlist
typedef keyitemlist::value_type keyitem

Protected Member Functions

virtual void deleteItem (type *d)
keyitem * findKey (FXuint h, const FXlong &k)
const keyitem * findKey (FXuint h, const FXlong &k) const
void insert (FXuint h, const FXlong &k, type *d)
void replace (FXuint h, const FXlong &k, type *d)
bool remove (FXuint h, const FXlong &k)
type * take (FXuint h, const FXlong &k)
type * find (FXuint h, const FXlong &k) const

Member Typedef Documentation

typedef FXlong FX::QDictBase< FXlong , type >::KeyType [inherited]

The type of the key.

typedef type FX::QDictBase< FXlong , type >::ItemType [inherited]

The type of the container's item.


Constructor & Destructor Documentation

template<class type>
FX::QInt64Dict< type >::QInt64Dict ( int  size = 13,
bool  wantAutoDel = false 
) [inline, explicit]

Creates a hash table indexed by FXlong's. Choose a prime for size.


Member Function Documentation

template<class type>
void FX::QInt64Dict< type >::insert ( FXlong  k,
const type *  d 
) [inline]

Inserts item d into the dictionary under key k.

template<class type>
void FX::QInt64Dict< type >::replace ( FXlong  k,
const type *  d 
) [inline]

Replaces item d in the dictionary under key k.

template<class type>
bool FX::QInt64Dict< type >::remove ( FXlong  k  )  [inline]

Deletes the most recently placed item in the dictionary under key k.

template<class type>
type* FX::QInt64Dict< type >::take ( FXlong  k  )  [inline]

Removes the most recently placed item in the dictionary under key k without auto-deletion.

template<class type>
type* FX::QInt64Dict< type >::find ( FXlong  k  )  const [inline]

Finds the most recently placed item in the dictionary under key k.

bool FX::QDictBase< FXlong , type >::autoDelete (  )  const [inline, inherited]

Returns if auto-deletion is enabled.

void FX::QDictBase< FXlong , type >::setAutoDelete ( bool  a  )  [inline, inherited]

Sets if auto-deletion is enabled.

uint FX::QDictBase< FXlong , type >::count (  )  const [inline, inherited]

Returns the number of items in the list.

bool FX::QDictBase< FXlong , type >::isEmpty (  )  const [inline, inherited]

Returns true if the list is empty.

uint FX::QDictBase< FXlong , type >::size (  )  const [inline, inherited]

Returns the size of the hash table.

void FX::QDictBase< FXlong , type >::clear (  )  [inline, inherited]

Clears the list of items, auto-deleting if enabled.

void FX::QDictBase< FXlong , type >::append ( const QDictBase< FXlong , type > &  o  )  [inherited]

Appends the contents of another dictionary.

QDictBase<FXlong , type >& FX::QDictBase< FXlong , type >::operator+= ( const QDictBase< FXlong , type > &  o  )  [inline, inherited]

void FX::QDictBase< FXlong , type >::resize ( uint  newsize  )  [inline, inherited]

Resizes the hash table (see QDICTDYNRESIZE()). Invalidates all iterators.

void FX::QDictBase< FXlong , type >::safeResize ( uint  newsize  )  throw () [inline, inherited]

Resizes the hash table with no threat of memory full exceptions. Invalidates all iterators.

void FX::QDictBase< FXlong , type >::spread ( float *  full,
float *  slotsspread,
float *  avrgkeysperslot,
float *  spread 
) const [inline, inherited]

Returns statistics useful for dynamic balancing of the table. If full exceeds 100%, then there are more items than slots and the table is no longer performing at maximum efficiency. If slotsspread is less than 50% then the hash function is broken. Ideally for performance purposes avrgkeysperslot should be near 1.0 and finally spread is slotsspread divided by avrgskeysperslot which is an overall indication of spread and thus efficiency of the table. Of course maximum efficiency is pointless for very large sets of data where avrgkeysperslot could be as much as eight - but slotsspread should always be near 100%

void FX::QDictBase< FXlong , type >::statistics (  )  const [inline, inherited]

Prints some statistics about the hash table (only debug builds).

FXint FX::QDictBase< FXlong , type >::dictionaryBias (  )  const throw () [inline, inherited]

Returns a number indicating how biased between lookups and insert/removals the usage of this dictionary has been so far. Is negative for more insert/removals than lookups and positive for the opposite.


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:27:51 2008 for TnFOX by doxygen v1.5.6