decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR > Class Template Reference

Map template that wraps around a std::map to provide a more user-friendly interface and to provide common functions that do not exist in std::map. More...

#include <src/main/decaf/util/concurrent/ConcurrentStlMap.h>

Inheritance diagram for decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >:
Inheritance graph
[legend]

Data Structures

class  AbstractMapIterator
class  ConstAbstractMapIterator
class  ConstEntryIterator
class  ConstKeyIterator
class  ConstStlMapEntrySet
class  ConstStlMapKeySet
class  ConstStlMapValueCollection
class  ConstValueIterator
class  EntryIterator
class  KeyIterator
class  StlMapEntrySet
class  StlMapKeySet
class  StlMapValueCollection
class  ValueIterator

Public Member Functions

 ConcurrentStlMap ()
 Default constructor - does nothing.
 ConcurrentStlMap (const ConcurrentStlMap &source)
 Copy constructor - copies the content of the given map into this one.
 ConcurrentStlMap (const Map< K, V > &source)
 Copy constructor - copies the content of the given map into this one.
virtual ~ConcurrentStlMap ()
virtual bool equals (const ConcurrentStlMap &source) const
 Compares the specified object with this map for equality.Returns true if the two maps represent the same mappings. More formally, two maps m1 and m2 represent the same mappings if m1.entrySet().equals(m2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.
Parameters:
source Map to compare to this one.
Returns:
true if the Map passed is equal in value to this one.

virtual bool equals (const Map< K, V > &source) const
virtual void copy (const ConcurrentStlMap &source)
 Copies the content of the source map into this map.Erases all existing mappings in this map. The copy is performed by using the entrySet of the source Map and iterating over those entries, inserting each into the target.
Parameters:
source The source object to copy from.

virtual void copy (const Map< K, V > &source)
virtual void clear ()
 Removes all of the mappings from this map (optional operation).The map will be empty after this call returns.
Exceptions:
UnsupportedOperationException if the clear operation is not supported by this map.

virtual bool containsKey (const K &key) const
 Returns true if this map contains a mapping for the specified key.More formally, returns true if and only if this map contains a mapping for a key k such that (key == k). (There can be at most one such mapping.)
Parameters:
key The key to look up.
Returns:
true if this map contains the key mapping, otherwise false.

virtual bool containsValue (const V &value) const
 Returns true if this map maps one or more keys to the specified value.More formally, returns true if and only if this map contains at least one mapping to a value v such that (value==v). This operation will probably require time linear in the map size for most implementations of the Map interface.
Parameters:
value The Value to look up in this Map.
Returns:
true if this map contains at least one mapping for the value, otherwise false.

virtual bool isEmpty () const
 
Returns:
if the Map contains any element or not, TRUE or FALSE

virtual int size () const
 
Returns:
The number of elements (key/value pairs) in this map.

virtual V & get (const K &key)
 Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.
Parameters:
key The search key whose value should be returned if present.
Returns:
A reference to the value for the given key if present in the Map.
Exceptions:
NoSuchElementException if the key requests doesn't exist in the Map.

virtual const V & get (const K &key) const
 Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.
Parameters:
key The search key whose value should be returned if present.
Returns:
A const reference to the value for the given key if present in the Map.
Exceptions:
NoSuchElementException if the key requests doesn't exist in the Map.

virtual bool put (const K &key, const V &value)
 Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)
Parameters:
key The target key.
value The value to be set.
Returns:
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions:
UnsupportedOperationException if this map is unmodifiable.
IllegalArgumentException if some property of the specified key or value prevents it from being stored in this map

virtual bool put (const K &key, const V &value, V &oldValue)
 Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)This method accepts a reference to a value which will be assigned the previous value for the given key (if any). If there was no previous mapping for the given key the out value is not written to. A return of true indicates that a value was replaced by this put operation.
Parameters:
key The target key.
value The value to be set.
oldValue (out) The value previously held in the mapping for this key. .
Returns:
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions:
UnsupportedOperationException if this map is unmodifiable.
IllegalArgumentException if some property of the specified key or value prevents it from being stored in this map

virtual void putAll (const ConcurrentStlMap< K, V, COMPARATOR > &other)
 Copies all of the mappings from the specified map to this map (optional operation).The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.
Parameters:
other A Map instance whose elements are to all be inserted in this Map.
Exceptions:
UnsupportedOperationException If the implementing class does not support the putAll operation.

virtual void putAll (const Map< K, V > &other)
 
virtual V remove (const K &key)
 Removes the value (key/value pair) for the specified key from the map, returns a copy of the value that was mapped to the key.Care must be taken when using this operation as it will throw an exception if there is no mapping for the given key.
Parameters:
key The search key whose mapping is to be removed.
Returns:
a copy of the element that was previously mapped to the given key.
Exceptions:
NoSuchElementException if this key is not in the Map.
UnsupportedOperationException if this map is unmodifiable.

bool putIfAbsent (const K &key, const V &value)
 If the specified key is not already associated with a value, associate it with the given value.
bool remove (const K &key, const V &value)
 Remove entry for key only if currently mapped to given value.
bool replace (const K &key, const V &oldValue, const V &newValue)
 Replace entry for key only if currently mapped to given value.
replace (const K &key, const V &value)
 Replace entry for key only if currently mapped to some value.
virtual Set< MapEntry< K, V > > & entrySet ()
 Returns a Set view of the mappings contained in this map.
virtual const Set< MapEntry< K,
V > > & 
entrySet () const
virtual Set< K > & keySet ()
 Returns a Set view of the keys contained in this map.
virtual const Set< K > & keySet () const
virtual Collection< V > & values ()
 Returns a Collection view of the values contained in this map.
virtual const Collection< V > & values () const
virtual void lock ()
 Locks the object.
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
virtual void unlock ()
 Unlocks the object.
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.

Detailed Description

template<typename K, typename V, typename COMPARATOR = std::less<K>>
class decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >

Map template that wraps around a std::map to provide a more user-friendly interface and to provide common functions that do not exist in std::map.

This version of Map extends the ConcurrentMap inteface and implements all the methods defined in that interface. Unlike a Java ConcurrentHashMap this implementations synchronizes all methods such that any call to this class will block if another thread is already holding a lock, much like the Java HashTable.

Since:
1.0

Constructor & Destructor Documentation

template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap (  )  [inline]

Default constructor - does nothing.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap ( const ConcurrentStlMap< K, V, COMPARATOR > &  source  )  [inline]

Copy constructor - copies the content of the given map into this one.

Parameters:
source The source map.
template<typename K, typename V, typename COMPARATOR = std::less<K>>
decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::ConcurrentStlMap ( const Map< K, V > &  source  )  [inline]

Copy constructor - copies the content of the given map into this one.

Parameters:
source The source map.
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::~ConcurrentStlMap (  )  [inline, virtual]

Member Function Documentation

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::clear (  )  [inline, virtual]

Removes all of the mappings from this map (optional operation).The map will be empty after this call returns.

Exceptions:
UnsupportedOperationException if the clear operation is not supported by this map.

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::copy().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::containsKey ( const K &  key  )  const [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::containsValue ( const V &  value  )  const [inline, virtual]

Returns true if this map maps one or more keys to the specified value.More formally, returns true if and only if this map contains at least one mapping to a value v such that (value==v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Parameters:
value The Value to look up in this Map.
Returns:
true if this map contains at least one mapping for the value, otherwise false.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::copy ( const Map< K, V > &  source  )  [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::copy ( const ConcurrentStlMap< K, V, COMPARATOR > &  source  )  [inline, virtual]

Copies the content of the source map into this map.Erases all existing mappings in this map. The copy is performed by using the entrySet of the source Map and iterating over those entries, inserting each into the target.

Parameters:
source The source object to copy from.

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::ConcurrentStlMap().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Set< MapEntry<K, V> >& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::entrySet (  )  const [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Set< MapEntry<K, V> >& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::entrySet (  )  [inline, virtual]

Returns a Set view of the mappings contained in this map.

The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:
a reference to a Set<MapEntry<K,V>> that is backed by this Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::equals ( const Map< K, V > &  source  )  const [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::equals ( const ConcurrentStlMap< K, V, COMPARATOR > &  source  )  const [inline, virtual]

Compares the specified object with this map for equality.Returns true if the two maps represent the same mappings. More formally, two maps m1 and m2 represent the same mappings if m1.entrySet().equals(m2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

Parameters:
source Map to compare to this one.
Returns:
true if the Map passed is equal in value to this one.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const V& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::get ( const K &  key  )  const [inline, virtual]

Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.

Parameters:
key The search key whose value should be returned if present.
Returns:
A const reference to the value for the given key if present in the Map.
Exceptions:
NoSuchElementException if the key requests doesn't exist in the Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual V& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::get ( const K &  key  )  [inline, virtual]

Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is equivalent to the key provided then a NoSuchElementException is thrown.

Parameters:
key The search key whose value should be returned if present.
Returns:
A reference to the value for the given key if present in the Map.
Exceptions:
NoSuchElementException if the key requests doesn't exist in the Map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::isEmpty (  )  const [inline, virtual]

Returns:
if the Map contains any element or not, TRUE or FALSE

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Set<K>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::keySet (  )  const [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Set<K>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::keySet (  )  [inline, virtual]

Returns a Set view of the keys contained in this map.

The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:
a set view of the keys contained in this map,

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::equals().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::lock (  )  [inline, virtual]

Locks the object.

Exceptions:
RuntimeException if an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::notify (  )  [inline, virtual]

Signals a waiter on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions:
IllegalMonitorStateException - if the current thread is not the owner of the the Synchronizable Object.
RuntimeException if an error occurs while notifying one of the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::notifyAll (  )  [inline, virtual]

Signals the waiters on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions:
IllegalMonitorStateException - if the current thread is not the owner of the the Synchronizable Object.
RuntimeException if an error occurs while notifying the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::put ( const K &  key,
const V &  value,
V &  oldValue 
) [inline, virtual]

Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)This method accepts a reference to a value which will be assigned the previous value for the given key (if any). If there was no previous mapping for the given key the out value is not written to. A return of true indicates that a value was replaced by this put operation.

Parameters:
key The target key.
value The value to be set.
oldValue (out) The value previously held in the mapping for this key. .
Returns:
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions:
UnsupportedOperationException if this map is unmodifiable.
IllegalArgumentException if some property of the specified key or value prevents it from being stored in this map

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::put ( const K &  key,
const V &  value 
) [inline, virtual]

Associates the specified value with the specified key in this map (optional operation).If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters:
key The target key.
value The value to be set.
Returns:
true if the put operation replaced a value that was associated with an existing mapping to the given key or false otherwise.
Exceptions:
UnsupportedOperationException if this map is unmodifiable.
IllegalArgumentException if some property of the specified key or value prevents it from being stored in this map

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::putAll(), decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::putIfAbsent(), and decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::replace().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putAll ( const Map< K, V > &  other  )  [inline, virtual]

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putAll ( const ConcurrentStlMap< K, V, COMPARATOR > &  other  )  [inline, virtual]

Copies all of the mappings from the specified map to this map (optional operation).The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.

Parameters:
other A Map instance whose elements are to all be inserted in this Map.
Exceptions:
UnsupportedOperationException If the implementing class does not support the putAll operation.

Implements decaf::util::Map< K, V >.

Referenced by decaf::util::concurrent::ConcurrentStlMap< Pointer< ProducerId >, Pointer< ProducerState >, ProducerId::COMPARATOR >::copy().

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::putIfAbsent ( const K &  key,
const V &  value 
) [inline, virtual]

If the specified key is not already associated with a value, associate it with the given value.

This is equivalent to

     if( !map.containsKey( key ) ) {
         map.put( key, value );
         return true;
     } else {
         return false;
     }
 

except that the action is performed atomically.

Parameters:
key The key to map the value to.
value The value to map to the given key.
Returns:
true if the put operation was performed otherwise return false which indicates there was a value previously mapped to the key.
Exceptions:
UnsupportedOperationException if the put operation is not supported by this map

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::remove ( const K &  key,
const V &  value 
) [inline, virtual]

Remove entry for key only if currently mapped to given value.

Acts as

 if( map.containsKey( key ) && ( map.get( key ) == value ) ) {
     map.remove( key );
     return true;
 } else {
     return false;
 }
 

except that the action is performed atomically.

Parameters:
key key with which the specified value is associated.
value value associated with the specified key.
Returns:
true if the value was removed, false otherwise

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual V decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::remove ( const K &  key  )  [inline, virtual]

Removes the value (key/value pair) for the specified key from the map, returns a copy of the value that was mapped to the key.Care must be taken when using this operation as it will throw an exception if there is no mapping for the given key.

Parameters:
key The search key whose mapping is to be removed.
Returns:
a copy of the element that was previously mapped to the given key.
Exceptions:
NoSuchElementException if this key is not in the Map.
UnsupportedOperationException if this map is unmodifiable.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
V decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::replace ( const K &  key,
const V &  value 
) [inline, virtual]

Replace entry for key only if currently mapped to some value.

Acts as

 if( map.containsKey( key ) ) {
     return map.put( key, value );
 } else {
     throw NoSuchElementException(...);
 };
 

except that the action is performed atomically.

Parameters:
key key with which the specified value is associated.
value value to be associated with the specified key.
Returns:
copy of the previous value associated with specified key, or throws an NoSuchElementException if there was no mapping for key.
Exceptions:
NoSuchElementException if there was no previous mapping.

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::replace ( const K &  key,
const V &  oldValue,
const V &  newValue 
) [inline, virtual]

Replace entry for key only if currently mapped to given value.

Acts as

 if( map.containsKey( key ) && ( map.get( key ) == oldValue ) ) {
     map.put( key, newValue );
     return true;
 } else {
     return false;
 }
 

except that the action is performed atomically.

Parameters:
key key with which the specified value is associated.
oldValue value expected to be associated with the specified key.
newValue value to be associated with the specified key.
Returns:
true if the value was replaced

Implements decaf::util::concurrent::ConcurrentMap< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual int decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::size (  )  const [inline, virtual]

Returns:
The number of elements (key/value pairs) in this map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual bool decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::tryLock (  )  [inline, virtual]

Attempts to Lock the object, if the lock is already held by another thread than this method returns false.

Returns:
true if the lock was acquired, false if it is already held by another thread.
Exceptions:
RuntimeException if an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::unlock (  )  [inline, virtual]

Unlocks the object.

Exceptions:
RuntimeException if an error occurs while unlocking the object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual const Collection<V>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::values (  )  const [inline, virtual]
template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual Collection<V>& decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::values (  )  [inline, virtual]

Returns a Collection view of the values contained in this map.

The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations. For the const version of this method the Collection can only be used as a view into the Map.

Returns:
a collection view of the values contained in this map.

Implements decaf::util::Map< K, V >.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait ( long long  millisecs,
int  nanos 
) [inline, virtual]

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval. This method is similar to the one argument wait function except that it add a finer grained control over the amount of time that it waits by adding in the additional nanosecond argument.

NOTE: The ability to wait accurately at a nanosecond scale depends on the platform and OS that the Decaf API is running on, some systems do not provide an accurate enough clock to provide this level of granularity.

Parameters:
millisecs the time in milliseconds to wait, or WAIT_INIFINITE
nanos additional time in nanoseconds with a range of 0-999999
Exceptions:
IllegalArgumentException if an error occurs or the nanos argument is not in the range of [0-999999]
RuntimeException if an error occurs while waiting on the object.
InterruptedException if the wait is interrupted before it completes.
IllegalMonitorStateException - if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait ( long long  millisecs  )  [inline, virtual]

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval.

Parameters:
millisecs the time in milliseconds to wait, or WAIT_INIFINITE
Exceptions:
RuntimeException if an error occurs while waiting on the object.
InterruptedException if the wait is interrupted before it completes.
IllegalMonitorStateException - if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

template<typename K, typename V, typename COMPARATOR = std::less<K>>
virtual void decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >::wait (  )  [inline, virtual]

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling.

Exceptions:
RuntimeException if an error occurs while waiting on the object.
InterruptedException if the wait is interrupted before it completes.
IllegalMonitorStateException - if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.


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

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1