2005/5/9

     
 

class core_flathashmap

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::sys::core_flathashmap< K, V > Class Template Reference

#include <core_hashmap.h>

List of all members.


Detailed Description

template<class K, class V>
class acdk::lang::sys::core_flathashmap< K, V >

very basic & specialized implementation of an hashmap hashmap.

Author:
Roger Rene Kommer This implementention is designed to store Keys and Values, which are basic types, pointers or dump structure. There are some asumptions: ((*int)(K*)) == 0 is an invalid key; Requirements: K and V: copy constructors. K: operator== V constructor V(int i = 0) int hash(const K& k);


Public Types

typedef hashmap_iterator<
K, V > 
iterator
typedef acdk::lang::sys::core_pair<
K, V > 
value_type

Public Member Functions

 core_flathashmap (int size=10, bool asmultimap=false, float treshhold=2.0)
 intitialize it with double size of maximum expected members

 ~core_flathashmap ()
int _hash (const K &k, int maxsize)
void put (const K &k, const V &v)
void insert (const value_type &v)
bool _put (const K &k, const V &v, container *buffer, int maxsize)
iterator get (const K &k)
 in case of multimap only return first

bool _isValide (int pos)
K & key (int pos)
const K & key (int pos) const
V & value (int pos)
const V & value (int pos) const
int capacity () const
value_typeget_value_type (int pos)
const value_typeget_value_type (int pos) const
int size () const
iterator begin ()
iterator end ()
iterator find (const K &key)
void erase (iterator it)
void erase (iterator it, iterator &e)
void eraseAll (hashmap_iterator< K, V > &it)
 in case of multmap, erases all k


Protected Member Functions

void _destroy ()
void _resize (int newsize)

Private Member Functions

 core_flathashmap (const core_flathashmap< K, V > &other)
 doesn't allow copy construction


Private Attributes

bool _multimap
 allows multiple entries

int _size
container_buffer
float _treshhold
 more slots than


Member Typedef Documentation

template<class K, class V>
typedef hashmap_iterator<K, V> acdk::lang::sys::core_flathashmap< K, V >::iterator
 

template<class K, class V>
typedef acdk::lang::sys::core_pair<K, V> acdk::lang::sys::core_flathashmap< K, V >::value_type
 


Constructor & Destructor Documentation

template<class K, class V>
acdk::lang::sys::core_flathashmap< K, V >::core_flathashmap const core_flathashmap< K, V > &  other  )  [private]
 

doesn't allow copy construction

template<class K, class V>
acdk::lang::sys::core_flathashmap< K, V >::core_flathashmap int  size = 10,
bool  asmultimap = false,
float  treshhold = 2.0
[inline]
 

intitialize it with double size of maximum expected members

template<class K, class V>
acdk::lang::sys::core_flathashmap< K, V >::~core_flathashmap  )  [inline]
 


Member Function Documentation

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::_destroy  )  [inline, protected]
 

template<class K, class V>
int acdk::lang::sys::core_flathashmap< K, V >::_hash const K &  k,
int  maxsize
[inline]
 

template<class K, class V>
bool acdk::lang::sys::core_flathashmap< K, V >::_isValide int  pos  )  [inline]
 

template<class K, class V>
bool acdk::lang::sys::core_flathashmap< K, V >::_put const K &  k,
const V &  v,
container buffer,
int  maxsize
[inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::_resize int  newsize  )  [inline, protected]
 

template<class K, class V>
iterator acdk::lang::sys::core_flathashmap< K, V >::begin  )  [inline]
 

template<class K, class V>
int acdk::lang::sys::core_flathashmap< K, V >::capacity  )  const [inline]
 

template<class K, class V>
iterator acdk::lang::sys::core_flathashmap< K, V >::end  )  [inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::erase iterator  it,
iterator e
[inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::erase iterator  it  )  [inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::eraseAll hashmap_iterator< K, V > &  it  )  [inline]
 

in case of multmap, erases all k

template<class K, class V>
iterator acdk::lang::sys::core_flathashmap< K, V >::find const K &  key  )  [inline]
 

template<class K, class V>
iterator acdk::lang::sys::core_flathashmap< K, V >::get const K &  k  )  [inline]
 

in case of multimap only return first

template<class K, class V>
const value_type& acdk::lang::sys::core_flathashmap< K, V >::get_value_type int  pos  )  const [inline]
 

template<class K, class V>
value_type& acdk::lang::sys::core_flathashmap< K, V >::get_value_type int  pos  )  [inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::insert const value_type v  )  [inline]
 

template<class K, class V>
const K& acdk::lang::sys::core_flathashmap< K, V >::key int  pos  )  const [inline]
 

template<class K, class V>
K& acdk::lang::sys::core_flathashmap< K, V >::key int  pos  )  [inline]
 

template<class K, class V>
void acdk::lang::sys::core_flathashmap< K, V >::put const K &  k,
const V &  v
[inline]
 

template<class K, class V>
int acdk::lang::sys::core_flathashmap< K, V >::size  )  const [inline]
 

template<class K, class V>
const V& acdk::lang::sys::core_flathashmap< K, V >::value int  pos  )  const [inline]
 

template<class K, class V>
V& acdk::lang::sys::core_flathashmap< K, V >::value int  pos  )  [inline]
 


Member Data Documentation

template<class K, class V>
container* acdk::lang::sys::core_flathashmap< K, V >::_buffer [private]
 

template<class K, class V>
bool acdk::lang::sys::core_flathashmap< K, V >::_multimap [private]
 

allows multiple entries

template<class K, class V>
int acdk::lang::sys::core_flathashmap< K, V >::_size [private]
 

template<class K, class V>
float acdk::lang::sys::core_flathashmap< K, V >::_treshhold [private]
 

more slots than