MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DLHashTableImpl< P, T, U > Class Template Reference

#include <DLHashTable.hpp>

Classes

class  Iterator

Public Member Functions

 DLHashTableImpl (P &thePool)
bool setSize (Uint32 noOfElements)
bool seize (Ptr< T > &)
void add (Ptr< T > &)
bool find (Ptr< T > &, const T &key) const
void getPtr (Ptr< T > &, Uint32 i) const
void getPtr (Ptr< T > &) const
T * getPtr (Uint32 i) const
void remove (Ptr< T > &, const T &key)
void remove (Uint32 i)
void remove (Ptr< T > &)
void removeAll ()
void release (Uint32 i)
void release (Ptr< T > &)
void getPtr (Iterator &iter) const
bool first (Iterator &iter) const
bool next (Iterator &iter) const
bool next (Uint32 bucket, Iterator &iter) const

Detailed Description

template<typename P, typename T, typename U = T>
class DLHashTableImpl< P, T, U >

DLHashTable implements a hashtable using chaining (with a double linked list)

The entries in the hashtable must have the following methods:

  1. bool equal(const class T &) const; Which should return equal if the to objects have the same key
  2. Uint32 hashValue() const; Which should return a 32 bit hashvalue

Definition at line 36 of file DLHashTable.hpp.

Member Function Documentation

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::add ( Ptr< T > &  obj)
inline

Add an object to the hashtable

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 212 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T, typename U >
bool DLHashTableImpl< P, T, U >::find ( Ptr< T > &  ptr,
const T &  key 
) const
inline
template<typename P , typename T , typename U >
bool DLHashTableImpl< P, T, U >::first ( Iterator iter) const
inline

First element in bucket

First element

Definition at line 240 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::getPtr ( Ptr< T > &  ptr,
Uint32  i 
) const
inline

Update i & p value according to i

Definition at line 469 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::getPtr ( Ptr< T > &  ptr) const
inline

Get element using ptr.i (update ptr.p)

Definition at line 478 of file DLHashTable.hpp.

template<typename P , typename T, typename U >
T * DLHashTableImpl< P, T, U >::getPtr ( Uint32  i) const
inline

Get P value for i

Definition at line 486 of file DLHashTable.hpp.

template<typename P, typename T, typename U = T>
void DLHashTableImpl< P, T, U >::getPtr ( Iterator iter) const

Sets curr.p according to curr.i

template<typename P , typename T , typename U >
bool DLHashTableImpl< P, T, U >::next ( Iterator iter) const
inline

Next Element

param iter - A "fully set" iterator

Definition at line 261 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T , typename U >
bool DLHashTableImpl< P, T, U >::next ( Uint32  bucket,
Iterator iter 
) const
inline

Get next element starting from bucket

Parameters
bucket- Which bucket to start from
iter- An "uninitialized" iterator

Definition at line 436 of file DLHashTable.hpp.

template<typename P , typename T , typename U >
void DLHashTableImpl< P, T, U >::release ( Uint32  i)
inline

Remove element and return to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 346 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::release ( Ptr< T > &  ptr)
inline

Remove element and return to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 391 of file DLHashTable.hpp.

Here is the call graph for this function:

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::remove ( Ptr< T > &  ptr,
const T &  key 
)
inline

Remove element (and set Ptr to removed element) Note does not return to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 289 of file DLHashTable.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::remove ( Uint32  i)
inline

Remove element Note does not return to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 335 of file DLHashTable.hpp.

template<typename P , typename T, typename U >
void DLHashTableImpl< P, T, U >::remove ( Ptr< T > &  ptr)
inline

Remove element Note does not return to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 357 of file DLHashTable.hpp.

Here is the call graph for this function:

template<typename P , typename T , typename U >
void DLHashTableImpl< P, T, U >::removeAll ( )
inline

Remove all elements, but dont return them to pool

Reimplemented in DLCHashTable< T, U >, and DLCHashTable< Page_entry >.

Definition at line 427 of file DLHashTable.hpp.

template<typename P , typename T, typename U >
bool DLHashTableImpl< P, T, U >::seize ( Ptr< T > &  ptr)
inline

Seize element from pool - return i

Note must be added using add (even before hash.release) or be released using pool

Definition at line 457 of file DLHashTable.hpp.

Here is the caller graph for this function:

template<typename P , typename T , typename U >
bool DLHashTableImpl< P, T, U >::setSize ( Uint32  noOfElements)
inline

Set the no of bucket in the hashtable

Note, can currently only be called once

The size is already set to size

The mask is already set

Definition at line 180 of file DLHashTable.hpp.

Here is the caller graph for this function:


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