fawkes::LockHashSet< KeyType, HashFunction, EqualKey > Class Template Reference
[Fawkes Core Library]

Hash set with a lock. More...

#include <core/utils/lock_hashset.h>

Inheritance diagram for fawkes::LockHashSet< KeyType, HashFunction, EqualKey >:

List of all members.


Public Member Functions

 LockHashSet ()
 Constructor.
 LockHashSet (const LockHashSet< KeyType, HashFunction, EqualKey > &lh)
 Copy constructor.
virtual ~LockHashSet ()
 Destructor.
void lock ()
 Lock list.
bool try_lock ()
 Try to lock list.
void unlock ()
 Unlock list.
RefPtr< Mutexmutex () const
 Get access to the internal mutex.
void insert_locked (const KeyType &x)
 Insert element to hash set with lock protection.

Detailed Description

template<class KeyType, class HashFunction = __gnu_cxx::hash<KeyType>, class EqualKey = std::equal_to<KeyType>>
class fawkes::LockHashSet< KeyType, HashFunction, EqualKey >

Hash set with a lock.

This class provides a hash set that has an intrinsic lock. The lock can be applied with the regular locking methods.

See also:
Mutex
Author:
Tim Niemueller

Definition at line 47 of file lock_hashset.h.


Constructor & Destructor Documentation

template<class KeyType , class HashFunction , class EqualKey >
fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::LockHashSet (  )  [inline]

Constructor.

Definition at line 81 of file lock_hashset.h.

template<class KeyType, class HashFunction, class EqualKey>
fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::LockHashSet ( const LockHashSet< KeyType, HashFunction, EqualKey > &  lh  )  [inline]

Copy constructor.

Parameters:
lh LockHashSet to copy

Definition at line 90 of file lock_hashset.h.

template<class KeyType , class HashFunction , class EqualKey >
fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::~LockHashSet (  )  [inline, virtual]

Destructor.

Definition at line 102 of file lock_hashset.h.


Member Function Documentation

template<class KeyType, class HashFunction , class EqualKey >
void fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::insert_locked ( const KeyType &  x  )  [inline]

Insert element to hash set with lock protection.

Parameters:
x element to add

Definition at line 140 of file lock_hashset.h.

template<class KeyType , class HashFunction , class EqualKey >
void fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::lock (  )  [inline]

Lock list.

Definition at line 109 of file lock_hashset.h.

template<typename KeyType , class HashFunction , class EqualKey >
RefPtr< Mutex > fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::mutex (  )  const [inline]

Get access to the internal mutex.

Can be used with MutexLocker.

Returns:
internal mutex

Definition at line 154 of file lock_hashset.h.

template<class KeyType , class HashFunction , class EqualKey >
bool fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::try_lock (  )  [inline]

Try to lock list.

Returns:
true, if the lock has been aquired, false otherwise.

Definition at line 120 of file lock_hashset.h.

template<class KeyType , class HashFunction , class EqualKey >
void fawkes::LockHashSet< KeyType, HashFunction, EqualKey >::unlock (  )  [inline]

Unlock list.

Definition at line 129 of file lock_hashset.h.


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