Fawkes API  Fawkes Development Version
fawkes::LockMultiMap Class Reference

Multi-Map with a lock. More...

#include <>>

Inheritance diagram for fawkes::LockMultiMap:

List of all members.

Public Member Functions

 LockMultiMap ()
 Constructor.
 LockMultiMap (const LockMultiMap< KeyType, ValueType, LessKey > &lm)
 Copy constructor.
virtual ~LockMultiMap ()
 Destructor.
void lock () const
 Lock list.
bool try_lock () const
 Try to lock list.
void unlock () const
 Unlock list.
RefPtr< Mutexmutex () const
 Get access to the internal mutex.
void erase_locked (const KeyType &key)
 Remove item with lock.
LockMultiMap< KeyType,
ValueType, LessKey > & 
operator= (const LockMultiMap< KeyType, ValueType, LessKey > &ll)
 Copy values from another LockMultiMap.
LockMultiMap< KeyType,
ValueType, LessKey > & 
operator= (const std::map< KeyType, ValueType, LessKey > &l)
 Copy values from a standard map.

Detailed Description

Multi-Map with a lock.

This class provides a multimap 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::LockMultiMap::LockMultiMap ( )

Constructor.

Definition at line 76 of file lock_multimap.h.

fawkes::LockMultiMap::LockMultiMap ( const LockMultiMap< KeyType, ValueType, LessKey > &  lm)

Copy constructor.

Parameters:
lmLockMultiMap to copy

Definition at line 85 of file lock_multimap.h.

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

Destructor.

Definition at line 93 of file lock_multimap.h.


Member Function Documentation

void fawkes::LockMultiMap::erase_locked ( const KeyType &  key)

Remove item with lock.

The map is automatically locked and unlocked during the removal.

Parameters:
keykey of the value to erase

Definition at line 132 of file lock_multimap.h.

void fawkes::LockMultiMap::lock ( ) const

Lock list.

Definition at line 100 of file lock_multimap.h.

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

Get access to the internal mutex.

Can be used with MutexLocker.

Returns:
internal mutex

Definition at line 146 of file lock_multimap.h.

LockMultiMap< KeyType, ValueType, LessKey > & fawkes::LockMultiMap::operator= ( const LockMultiMap< KeyType, ValueType, LessKey > &  ll)

Copy values from another LockMultiMap.

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

Parameters:
llmap to copy
Returns:
reference to this instance

Definition at line 161 of file lock_multimap.h.

LockMultiMap< KeyType, ValueType, LessKey > & fawkes::LockMultiMap::operator= ( const std::map< KeyType, ValueType, LessKey > &  l)

Copy values from a standard map.

Copies the values one by one. This instance is locked during the copying and cleared.

Parameters:
lmap to copy
Returns:
reference to this instance

Definition at line 185 of file lock_multimap.h.

bool fawkes::LockMultiMap::try_lock ( ) const

Try to lock list.

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

Definition at line 111 of file lock_multimap.h.

void fawkes::LockMultiMap::unlock ( ) const

Unlock list.

Definition at line 120 of file lock_multimap.h.


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