Fawkes API  Fawkes Development Version
fawkes::LockHashMap Class Reference

Hash map with a lock. More...

#include <core/utils/lock_hashmap.h>

Inheritance diagram for fawkes::LockHashMap:

List of all members.

Public Member Functions

 LockHashMap ()
 Constructor.
 LockHashMap (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &lh)
 Copy constructor.
virtual ~LockHashMap ()
 Destructor.
void lock () const
 Lock map.
bool try_lock () const
 Try to lock map.
void unlock () const
 Unlock map.
RefPtr< Mutexmutex () const
 Get access to the internal mutex.
LockHashMap< KeyType,
ValueType, HashFunction,
EqualKey > & 
operator= (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &ll)
 Copy values from another LockHashMap.

Detailed Description

Hash map with a lock.

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

See also:
Mutex
Author:
Tim Niemueller

Constructor & Destructor Documentation

fawkes::LockHashMap::LockHashMap ( )

Constructor.

Definition at line 82 of file lock_hashmap.h.

fawkes::LockHashMap::LockHashMap ( const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &  lh)

Copy constructor.

Parameters:
lhLockHashMap to copy

Definition at line 92 of file lock_hashmap.h.

fawkes::LockHashMap::~LockHashMap ( ) [virtual]

Destructor.

Definition at line 105 of file lock_hashmap.h.


Member Function Documentation

void fawkes::LockHashMap::lock ( ) const

Lock map.

Definition at line 113 of file lock_hashmap.h.

RefPtr< Mutex > fawkes::LockHashMap::mutex ( ) const

Get access to the internal mutex.

Can be used with MutexLocker.

Returns:
internal mutex

Definition at line 145 of file lock_hashmap.h.

LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & fawkes::LockHashMap::operator= ( const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &  ll)

Copy values from another LockHashMap.

Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.

Parameters:
llhash map to copy
Returns:
reference to this instance

Definition at line 159 of file lock_hashmap.h.

bool fawkes::LockHashMap::try_lock ( ) const

Try to lock map.

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

Definition at line 124 of file lock_hashmap.h.

void fawkes::LockHashMap::unlock ( ) const

Unlock map.

Definition at line 133 of file lock_hashmap.h.


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