CUBRID Engine  latest
lf_hash_table_cpp< Key, T > Class Template Reference

#include <lock_free.h>

Inheritance diagram for lf_hash_table_cpp< Key, T >:
Inheritance graph
Collaboration diagram for lf_hash_table_cpp< Key, T >:
Collaboration graph

Classes

class  iterator
 

Public Member Functions

 lf_hash_table_cpp ()
 
void init (lf_tran_system &transys, int hash_size, int freelist_block_count, int freelist_block_size, lf_entry_descriptor &edes)
 
void destroy ()
 
T * find (lf_tran_entry *t_entry, Key &key)
 
bool find_or_insert (lf_tran_entry *t_entry, Key &key, T *&t)
 
bool insert (lf_tran_entry *t_entry, Key &key, T *&t)
 
bool insert_given (lf_tran_entry *t_entry, Key &key, T *&t)
 
bool erase (lf_tran_entry *t_entry, Key &key)
 
bool erase_locked (lf_tran_entry *t_entry, Key &key, T *&t)
 
void unlock (lf_tran_entry *t_entry, T *&t)
 
void clear (lf_tran_entry *t_entry)
 
T * freelist_claim (lf_tran_entry *t_entry)
 
void freelist_retire (lf_tran_entry *t_entry, T *&t)
 
void start_tran (lf_tran_entry *t_entry)
 
void end_tran (lf_tran_entry *t_entry)
 
size_t get_size () const
 
size_t get_element_count () const
 
lf_hash_tableget_hash_table ()
 
lf_freelistget_freelist ()
 

Private Member Functions

pthread_mutex_t * get_pthread_mutex (T *t)
 
template<typename F >
bool generic_insert (F &ins_func, lf_tran_entry *t_entry, Key &key, T *&t)
 

Private Attributes

lf_freelist m_freelist
 
lf_hash_table m_hash
 

Detailed Description

template<class Key, class T>
class lf_hash_table_cpp< Key, T >

Definition at line 363 of file lock_free.h.

Constructor & Destructor Documentation

Member Function Documentation

template<class Key , class T >
void lf_hash_table_cpp< Key, T >::clear ( lf_tran_entry t_entry)

Definition at line 562 of file lock_free.h.

References lf_hash_clear(), and lf_hash_table_cpp< Key, T >::m_hash.

Referenced by test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), and test_hash_iterator().

Here is the caller graph for this function:

template<class Key , class T >
void lf_hash_table_cpp< Key, T >::destroy ( )

Definition at line 455 of file lock_free.h.

References lf_freelist_destroy(), lf_hash_destroy(), lf_hash_table_cpp< Key, T >::m_freelist, and lf_hash_table_cpp< Key, T >::m_hash.

Referenced by test_hash_iterator(), and test_hash_table().

Here is the caller graph for this function:

template<class Key , class T >
void lf_hash_table_cpp< Key, T >::end_tran ( lf_tran_entry t_entry)

Definition at line 591 of file lock_free.h.

References lf_tran_end_with_mb.

template<class Key, class T >
bool lf_hash_table_cpp< Key, T >::erase ( lf_tran_entry t_entry,
Key &  key 
)

Definition at line 517 of file lock_free.h.

References assert, lf_hash_delete(), lf_hash_table_cpp< Key, T >::m_hash, NO_ERROR, and success().

Referenced by test_clear_proc_1(), test_clear_proc_2(), test_hash_proc_1(), and test_hash_proc_2().

Here is the caller graph for this function:

template<class Key, class T>
bool lf_hash_table_cpp< Key, T >::erase_locked ( lf_tran_entry t_entry,
Key &  key,
T *&  t 
)
template<class Key, class T >
T * lf_hash_table_cpp< Key, T >::find ( lf_tran_entry t_entry,
Key &  key 
)

Definition at line 471 of file lock_free.h.

References assert, lf_hash_find(), lf_hash_table_cpp< Key, T >::m_hash, NO_ERROR, and NULL.

template<class Key, class T>
bool lf_hash_table_cpp< Key, T >::find_or_insert ( lf_tran_entry t_entry,
Key &  key,
T *&  t 
)
template<class Key , class T >
T * lf_hash_table_cpp< Key, T >::freelist_claim ( lf_tran_entry t_entry)

Definition at line 569 of file lock_free.h.

References lf_freelist_claim(), and lf_hash_table_cpp< Key, T >::m_freelist.

template<class Key , class T>
void lf_hash_table_cpp< Key, T >::freelist_retire ( lf_tran_entry t_entry,
T *&  t 
)

Definition at line 576 of file lock_free.h.

References lf_freelist_retire(), lf_hash_table_cpp< Key, T >::m_freelist, and NULL.

template<class Key, class T>
template<typename F >
bool lf_hash_table_cpp< Key, T >::generic_insert ( F &  ins_func,
lf_tran_entry t_entry,
Key &  key,
T *&  t 
)
private
template<class Key , class T >
size_t lf_hash_table_cpp< Key, T >::get_element_count ( ) const
template<class Key , class T >
lf_freelist & lf_hash_table_cpp< Key, T >::get_freelist ( )

Definition at line 629 of file lock_free.h.

References lf_hash_table_cpp< Key, T >::m_freelist.

Referenced by test_hash_iterator(), and test_hash_table().

Here is the caller graph for this function:

template<class Key , class T >
lf_hash_table & lf_hash_table_cpp< Key, T >::get_hash_table ( )
template<class Key , class T>
pthread_mutex_t * lf_hash_table_cpp< Key, T >::get_pthread_mutex ( T *  t)
private
template<class Key , class T >
size_t lf_hash_table_cpp< Key, T >::get_size ( void  ) const
template<class Key, class T>
void lf_hash_table_cpp< Key, T >::init ( lf_tran_system transys,
int  hash_size,
int  freelist_block_count,
int  freelist_block_size,
lf_entry_descriptor edes 
)

Referenced by lf_hash_table_cpp< Key, T >::lf_hash_table_cpp(), test_hash_iterator(), and test_hash_table().

Here is the caller graph for this function:

template<class Key, class T>
bool lf_hash_table_cpp< Key, T >::insert ( lf_tran_entry t_entry,
Key &  key,
T *&  t 
)

Definition at line 503 of file lock_free.h.

References lf_hash_table_cpp< Key, T >::generic_insert(), and lf_hash_insert().

template<class Key, class T>
bool lf_hash_table_cpp< Key, T >::insert_given ( lf_tran_entry t_entry,
Key &  key,
T *&  t 
)
template<class Key , class T >
void lf_hash_table_cpp< Key, T >::start_tran ( lf_tran_entry t_entry)

Definition at line 584 of file lock_free.h.

References lf_tran_start_with_mb.

Member Data Documentation


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