Aleph-w  1.5a.2
Biblioteca general de algoritmos y estructuras de datos
 Todo Clases Archivos Funciones Variables 'typedefs' Enumeraciones Amigas Grupos Páginas
Referencia de la plantilla de la Clase Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >
+ Diagrama de herencias de Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >
+ Diagrama de colaboración para Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >:

Tipos públicos

typedef Data Value_Type
 
typedef size_t(* Hash_Fct )(const Key &)
 
typedef HashTable< Key, Cmp > Base
 
- Tipos públicos heredados desde Aleph::DynHashTable< std::pair< Key, Data >, Cmp, HashTable >
typedef Base::Hash_Fct Hash_Fct
 El tipo de función hash.
 
typedef std::pair< Key, Data > Key_Type
 
typedef std::pair< Key, Data > Item_Type
 

Métodos públicos

Data & get_data (const Key &key)
 
const Key & get_key (Data *data_ptr)
 
 DynMapHashTable (typename Base::Hash_Fct hash_fct=wrapper< Aleph::dft_hash_fct< Key >>, const size_t len=Primes::DefaultPrime, const float lower_alpha=hash_default_lower_alpha, const float upper_alpha=hash_default_upper_alpha)
 
Key * insert (const Key &key, const Data &data)
 
Key * insert (const Key &key, Data &&data)
 
Key * insert (Key &&key, Data &&data)
 
Key * insert (Key &&key, const Data &data)
 
Data * search (const Key &key) const
 
bool has (const Key &key)
 
Data & find (const Key &key)
 
void remove_by_data (Data &data)
 
void remove (const Key &key)
 
 Map_Sequences_Methods ()
 
 Generate_Proxy_Operator (DynMapHashTable)
 
- Métodos públicos heredados desde Aleph::DynHashTable< std::pair< Key, Data >, Cmp, HashTable >
 DynHashTable (Hash_Fct hash_fct=Aleph::dft_hash_fct< std::pair< Key, Data > >, const size_t len=Primes::DefaultPrime, const float lower_alpha=hash_default_lower_alpha, const float upper_alpha=hash_default_upper_alpha)
 
 DynHashTable (const DynHashTable &other)
 
 DynHashTable (DynHashTable &&other)
 
DynHashTableoperator= (const DynHashTable &other)
 
DynHashTableoperator= (DynHashTable &&other)
 
std::pair< Key, Data > * insert (const std::pair< Key, Data > &key)
 
std::pair< Key, Data > * insert (std::pair< Key, Data > &&key)
 
std::pair< Key, Data > * add (const std::pair< Key, Data > &key)
 
std::pair< Key, Data > * add (std::pair< Key, Data > &&key)
 
std::pair< Key, Data > * search (const std::pair< Key, Data > &key) const
 
bool has (const std::pair< Key, Data > &key) const
 
bool contains (const std::pair< Key, Data > &key) const
 
std::pair< Key, Data > & find (const std::pair< Key, Data > &key)
 
 Generic_Keys (std::pair< Key, Data >)
 returns a container with all the keys of the table
 
void remove (std::pair< Key, Data > *key)
 
void remove (const std::pair< Key, Data > &key)
 
 Generic_Traverse (std::pair< Key, Data >)
 
 Functional_Methods (std::pair< Key, Data >)
 
 Equal_To_Method (DynHashTable)
 

Métodos públicos estáticos

template<size_t(*)(const Key &k) fct>
static size_t wrapper (const std::pair< Key, Data > &p)
 

Otros miembros heredados

- Tipos protegidos heredados desde Aleph::DynHashTable< std::pair< Key, Data >, Cmp, HashTable >
typedef HashTable< std::pair
< Key, Data >, Cmp > 
Base
 
typedef HashTable< std::pair
< Key, Data >, Cmp >::Bucket 
Bucket
 
- Métodos protegidos heredados desde Aleph::DynHashTable< std::pair< Key, Data >, Cmp, HashTable >
std::pair< Key, Data > * insert_bucket (Bucket *bucket)
 
- Métodos protegidos estáticos heredados desde Aleph::DynHashTable< std::pair< Key, Data >, Cmp, HashTable >
static Bucket * key_to_bucket (std::pair< Key, Data > *key)
 

Documentación del constructor y destructor

template<typename Key, typename Data, class Cmp = Dft_Pair_Cmp<Key, Data, Aleph::equal_to<Key>>, template< class, class > class HashTable = LinearHashTable>
Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >::DynMapHashTable ( typename Base::Hash_Fct  hash_fct = wrapper<Aleph::dft_hash_fct<Key>>,
const size_t  len = Primes::DefaultPrime,
const float  lower_alpha = hash_default_lower_alpha,
const float  upper_alpha = hash_default_upper_alpha 
)
inline

Constructor.

Please note that although the hash_fct parameter defines a hash function for std::pair<Key, Data> types, the hash function MUST only compute on the first field of pair. If you do not do so, then the mapping will fail, since it will be a set of pairs.

Atención
READ VERY CAREFULLY IF YOU PLAN PASS YOUR OWN HASH FUNCTION

Documentación de las funciones miembro

template<typename Key, typename Data, class Cmp = Dft_Pair_Cmp<Key, Data, Aleph::equal_to<Key>>, template< class, class > class HashTable = LinearHashTable>
Key* Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >::insert ( const Key &  key,
const Data &  data 
)
inline

Inserta en el mapeo hash el par (key,record) indizado por la clave key. Retorna un puntero al registro dentro de la tabla. Dispara la excepción bad_alloc si no hay suficiente memoria.

template<typename Key, typename Data, class Cmp = Dft_Pair_Cmp<Key, Data, Aleph::equal_to<Key>>, template< class, class > class HashTable = LinearHashTable>
void Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >::remove_by_data ( Data &  data)
inline

Elimina de la tabla la clave key cuyo puntero debe ser resultante de una inserción o búsqueda.

template<typename Key, typename Data, class Cmp = Dft_Pair_Cmp<Key, Data, Aleph::equal_to<Key>>, template< class, class > class HashTable = LinearHashTable>
Data* Aleph::DynMapHashTable< Key, Data, Cmp, HashTable >::search ( const Key &  key) const
inline

Busca la clave key y, si se encuentra, entonces retorna un puntero dentro de la tabla al registro asociado. De lo contrario -no se encuentra la clave-, se retorna NULL:


La documentación para esta clase fue generada a partir del siguiente fichero:

Leandro Rabindranath León