|
activemq-cpp-3.9.0
|
Interface for a Map type that provides additional atomic putIfAbsent, remove, and replace methods alongside the already available Map interface. More...
#include <src/main/decaf/util/concurrent/ConcurrentMap.h>

Public Member Functions | |
| virtual | ~ConcurrentMap () |
| virtual bool | putIfAbsent (const K &key, const V &value)=0 |
| If the specified key is not already associated with a value, associate it with the given value. More... | |
| virtual bool | remove (const K &key, const V &value)=0 |
| Remove entry for key only if currently mapped to given value. More... | |
| virtual bool | replace (const K &key, const V &oldValue, const V &newValue)=0 |
| Replace entry for key only if currently mapped to given value. More... | |
| virtual V | replace (const K &key, const V &value)=0 |
| Replace entry for key only if currently mapped to some value. More... | |
Public Member Functions inherited from decaf::util::Map< K, V > | |
| Map () | |
| Default constructor - does nothing. More... | |
| virtual | ~Map () |
| virtual bool | equals (const Map &source) const =0 |
| Compares the specified object with this map for equality. More... | |
| virtual void | copy (const Map &source)=0 |
| Copies the content of the source map into this map. More... | |
| virtual void | clear ()=0 |
| Removes all of the mappings from this map (optional operation). More... | |
| virtual bool | containsKey (const K &key) const =0 |
| Returns true if this map contains a mapping for the specified key. More... | |
| virtual bool | containsValue (const V &value) const =0 |
| Returns true if this map maps one or more keys to the specified value. More... | |
| virtual bool | isEmpty () const =0 |
| virtual int | size () const =0 |
| virtual V & | get (const K &key)=0 |
| Gets the value mapped to the specified key in the Map. More... | |
| virtual const V & | get (const K &key) const =0 |
| Gets the value mapped to the specified key in the Map. More... | |
| virtual bool | put (const K &key, const V &value)=0 |
| Associates the specified value with the specified key in this map (optional operation). More... | |
| virtual bool | put (const K &key, const V &value, V &oldValue)=0 |
| Associates the specified value with the specified key in this map (optional operation). More... | |
| virtual void | putAll (const Map< K, V > &other)=0 |
| Copies all of the mappings from the specified map to this map (optional operation). More... | |
| virtual V | remove (const K &key)=0 |
| 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. More... | |
| virtual Set< MapEntry< K, V > > & | entrySet ()=0 |
| Returns a Set view of the mappings contained in this map. More... | |
| virtual const Set< MapEntry< K, V > > & | entrySet () const =0 |
| virtual Set< K > & | keySet ()=0 |
| Returns a Set view of the keys contained in this map. More... | |
| virtual const Set< K > & | keySet () const =0 |
| virtual Collection< V > & | values ()=0 |
| Returns a Collection view of the values contained in this map. More... | |
| virtual const Collection< V > & | values () const =0 |
Public Member Functions inherited from decaf::util::concurrent::Synchronizable | |
| virtual | ~Synchronizable () |
| virtual void | lock ()=0 |
| Locks the object. More... | |
| virtual bool | tryLock ()=0 |
| Attempts to Lock the object, if the lock is already held by another thread than this method returns false. More... | |
| virtual void | unlock ()=0 |
| Unlocks the object. More... | |
| virtual void | wait ()=0 |
| Waits on a signal from this object, which is generated by a call to Notify. More... | |
| virtual void | wait (long long millisecs)=0 |
| Waits on a signal from this object, which is generated by a call to Notify. More... | |
| virtual void | wait (long long millisecs, int nanos)=0 |
| Waits on a signal from this object, which is generated by a call to Notify. More... | |
| virtual void | notify ()=0 |
| Signals a waiter on this object that it can now wake up and continue. More... | |
| virtual void | notifyAll ()=0 |
| Signals the waiters on this object that it can now wake up and continue. More... | |
Interface for a Map type that provides additional atomic putIfAbsent, remove, and replace methods alongside the already available Map interface.
|
inlinevirtual |
|
pure 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.
| key | The key to map the value to. |
| value | The value to map to the given key. |
| UnsupportedOperationException | if the put operation is not supported by this map |
Implemented in decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ProducerId >, decaf::lang::Pointer< activemq::state::ProducerState >, activemq::commands::ProducerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ConsumerId >, decaf::lang::Pointer< activemq::state::ConsumerState >, activemq::commands::ConsumerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::LocalTransactionId >, decaf::lang::Pointer< activemq::state::TransactionState >, activemq::commands::LocalTransactionId::COMPARATOR >, and decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::SessionId >, decaf::lang::Pointer< activemq::state::SessionState >, activemq::commands::SessionId::COMPARATOR >.
|
pure 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.
| key | key with which the specified value is associated. |
| value | value associated with the specified key. |
Implemented in decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ProducerId >, decaf::lang::Pointer< activemq::state::ProducerState >, activemq::commands::ProducerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ConsumerId >, decaf::lang::Pointer< activemq::state::ConsumerState >, activemq::commands::ConsumerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::LocalTransactionId >, decaf::lang::Pointer< activemq::state::TransactionState >, activemq::commands::LocalTransactionId::COMPARATOR >, and decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::SessionId >, decaf::lang::Pointer< activemq::state::SessionState >, activemq::commands::SessionId::COMPARATOR >.
|
pure 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.
| 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. |
Implemented in decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ProducerId >, decaf::lang::Pointer< activemq::state::ProducerState >, activemq::commands::ProducerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ConsumerId >, decaf::lang::Pointer< activemq::state::ConsumerState >, activemq::commands::ConsumerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::LocalTransactionId >, decaf::lang::Pointer< activemq::state::TransactionState >, activemq::commands::LocalTransactionId::COMPARATOR >, and decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::SessionId >, decaf::lang::Pointer< activemq::state::SessionState >, activemq::commands::SessionId::COMPARATOR >.
|
pure 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.
| key | key with which the specified value is associated. |
| value | value to be associated with the specified key. |
| NoSuchElementException | if there was no previous mapping. |
Implemented in decaf::util::concurrent::ConcurrentStlMap< K, V, COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ProducerId >, decaf::lang::Pointer< activemq::state::ProducerState >, activemq::commands::ProducerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::ConsumerId >, decaf::lang::Pointer< activemq::state::ConsumerState >, activemq::commands::ConsumerId::COMPARATOR >, decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::LocalTransactionId >, decaf::lang::Pointer< activemq::state::TransactionState >, activemq::commands::LocalTransactionId::COMPARATOR >, and decaf::util::concurrent::ConcurrentStlMap< decaf::lang::Pointer< activemq::commands::SessionId >, decaf::lang::Pointer< activemq::state::SessionState >, activemq::commands::SessionId::COMPARATOR >.