qdictbase.h File Reference


Detailed Description

Defines classes used in implementing QTL dictionary classes.

#include "FXException.h"
#include "FXStream.h"
#include "FXProcess.h"
#include <utility>
#include <vector>
#include <map>

Include dependency graph for qdictbase.h:

This graph shows which files directly or indirectly include this file:


Namespaces

namespace  FX

Classes

class  FX::QDictBase< keytype, type >
 Base implementation class for all QTL dictionary classes. More...
class  FX::QDictBaseIterator< keytype, type >
 An iterator for a FX::QDictBase. More...

Defines

#define QDICTDYNRESIZE(dict)
#define QDICTDYNRESIZEAGGR(dict)

Typedefs

typedef FXuint FX::uint

Functions

template<class dicttype>
bool FX::QDictByMemLoadResize (dicttype &dict, const char *file=0, int lineno=0)
template<class dicttype>
bool FX::QDictByMemLoadResizeAggr (dicttype &dict, const char *file=0, int lineno=0)

Define Documentation

#define QDICTDYNRESIZE ( dict   ) 

Useful macro which dynamically resizes a FX::QDictBase subclass according to a number of runtime factors:

  • If there aren't many items in the container (up to 64 or 16 if using a string key), uses a table size of one (ie; causes pure binary search). Depending on compile time defines will do the same if the container is doing more inserts/removals than lookups (via QDictBase::dictionaryBias()).
  • If memory load is low (0), will only shrink when dictionary contents fall below one quarter of the dictionary table size.
Otherwise it ensures dictionary table size is twice that of contents and is a prime number (via FX::fx2powerprimes) shifted right by memory load.

#define QDICTDYNRESIZEAGGR ( dict   ) 

Useful macro which dynamically resizes a FX::QDictBase subclass similarly to QDICTDYNRESIZE but more aggressively for speed:

  • Table is only ever shrunk when memory is loaded and even then, only when contents fall below one eighth that of the table size.
  • Table size is always double the contents or higher


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