activemq-cpp-3.4.0
|
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/StlMap.h>
Public Member Functions | |||||||
StlMap () | |||||||
Default constructor - does nothing. | |||||||
StlMap (const StlMap &source) | |||||||
Copy constructor - copies the content of the given map into this one. | |||||||
StlMap (const Map< K, V, COMPARATOR > &source) | |||||||
Copy constructor - copies the content of the given map into this one. | |||||||
virtual | ~StlMap () | ||||||
virtual bool | equals (const StlMap &source) const | ||||||
| |||||||
virtual bool | equals (const Map< K, V, COMPARATOR > &source) const | ||||||
Comparison, equality is dependent on the method of determining if the element are equal.
| |||||||
virtual void | copy (const StlMap &source) | ||||||
| |||||||
virtual void | copy (const Map< K, V, COMPARATOR > &source) | ||||||
Copies the content of the source map into this map.Erases all existing data in this map.
| |||||||
virtual void | clear () | ||||||
Removes all keys and values from this map.
| |||||||
virtual bool | containsKey (const K &key) const | ||||||
Indicates whether or this map contains a value for the given key.
| |||||||
virtual bool | containsValue (const V &value) const | ||||||
Indicates whether or this map contains a value for the given value, i.e.they are equal, this is done by operator== so the types must pass equivalence testing in this manner.
| |||||||
virtual bool | isEmpty () const | ||||||
| |||||||
virtual int | size () const | ||||||
| |||||||
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.
| |||||||
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.
| |||||||
virtual void | put (const K &key, const V &value) | ||||||
Sets the value for the specified key.
| |||||||
virtual void | putAll (const StlMap< K, V, COMPARATOR > &other) | ||||||
| |||||||
virtual void | putAll (const Map< K, V, COMPARATOR > &other) | ||||||
Stores a copy of the Mappings contained in the other Map in this one.
| |||||||
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.
| |||||||
virtual std::vector< K > | keySet () const | ||||||
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.
| |||||||
virtual std::vector< 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. |
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.
decaf::util::StlMap< K, V, COMPARATOR >::StlMap | ( | ) | [inline] |
Default constructor - does nothing.
decaf::util::StlMap< K, V, COMPARATOR >::StlMap | ( | const StlMap< K, V, COMPARATOR > & | source | ) | [inline] |
Copy constructor - copies the content of the given map into this one.
source | The source map. |
decaf::util::StlMap< K, V, COMPARATOR >::StlMap | ( | const Map< K, V, COMPARATOR > & | source | ) | [inline] |
Copy constructor - copies the content of the given map into this one.
source | The source map. |
virtual decaf::util::StlMap< K, V, COMPARATOR >::~StlMap | ( | ) | [inline, virtual] |
virtual void decaf::util::StlMap< K, V, COMPARATOR >::clear | ( | ) | [inline, virtual] |
Removes all keys and values from this map.
UnsupportedOperationException | if this map is unmodifiable. |
Implements decaf::util::Map< K, V, COMPARATOR >.
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::copy().
virtual bool decaf::util::StlMap< K, V, COMPARATOR >::containsKey | ( | const K & | key | ) | const [inline, virtual] |
Indicates whether or this map contains a value for the given key.
key | The key to look up. |
Implements decaf::util::Map< K, V, COMPARATOR >.
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::equals().
virtual bool decaf::util::StlMap< K, V, COMPARATOR >::containsValue | ( | const V & | value | ) | const [inline, virtual] |
Indicates whether or this map contains a value for the given value, i.e.they are equal, this is done by operator== so the types must pass equivalence testing in this manner.
value | The Value to look up. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual void decaf::util::StlMap< K, V, COMPARATOR >::copy | ( | const StlMap< K, V, COMPARATOR > & | source | ) | [inline, virtual] |
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::StlMap().
virtual void decaf::util::StlMap< K, V, COMPARATOR >::copy | ( | const Map< K, V, COMPARATOR > & | source | ) | [inline, virtual] |
Copies the content of the source map into this map.Erases all existing data in this map.
source | The source object to copy from. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual bool decaf::util::StlMap< K, V, COMPARATOR >::equals | ( | const Map< K, V, COMPARATOR > & | source | ) | const [inline, virtual] |
Comparison, equality is dependent on the method of determining if the element are equal.
source | - Map to compare to this one. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual bool decaf::util::StlMap< K, V, COMPARATOR >::equals | ( | const StlMap< K, V, COMPARATOR > & | source | ) | const [inline, virtual] |
virtual V& decaf::util::StlMap< 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.
key | The search key. |
NoSuchElementException | if the key requests doesn't exist in the Map. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual const V& decaf::util::StlMap< 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.
key | The search key. |
NoSuchElementException | if the key requests doesn't exist in the Map. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual bool decaf::util::StlMap< K, V, COMPARATOR >::isEmpty | ( | ) | const [inline, virtual] |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual std::vector<K> decaf::util::StlMap< K, V, COMPARATOR >::keySet | ( | ) | const [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.
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual void decaf::util::StlMap< K, V, COMPARATOR >::lock | ( | ) | [inline, virtual] |
Locks the object.
RuntimeException | if an error occurs while locking the object. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::util::StlMap< 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.
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.
virtual void decaf::util::StlMap< 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.
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.
virtual void decaf::util::StlMap< K, V, COMPARATOR >::put | ( | const K & | key, |
const V & | value | ||
) | [inline, virtual] |
Sets the value for the specified key.
key | The target key. |
value | The value to be set. |
UnsupportedOperationException | if this map is unmodifiable. |
Implements decaf::util::Map< K, V, COMPARATOR >.
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::putAll().
virtual void decaf::util::StlMap< K, V, COMPARATOR >::putAll | ( | const StlMap< K, V, COMPARATOR > & | other | ) | [inline, virtual] |
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::copy().
virtual void decaf::util::StlMap< K, V, COMPARATOR >::putAll | ( | const Map< K, V, COMPARATOR > & | other | ) | [inline, virtual] |
Stores a copy of the Mappings contained in the other Map in this one.
UnsupportedOperationException | If the implementing class does not support the putAll operation. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual V decaf::util::StlMap< 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.
key | The search key. |
NoSuchElementException | if this key is not in the Map. |
UnsupportedOperationException | if this map is unmodifiable. |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual int decaf::util::StlMap< K, V, COMPARATOR >::size | ( | ) | const [inline, virtual] |
Implements decaf::util::Map< K, V, COMPARATOR >.
virtual bool decaf::util::StlMap< 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.
RuntimeException | if an error occurs while locking the object. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::util::StlMap< K, V, COMPARATOR >::unlock | ( | ) | [inline, virtual] |
Unlocks the object.
RuntimeException | if an error occurs while unlocking the object. |
Implements decaf::util::concurrent::Synchronizable.
virtual std::vector<V> decaf::util::StlMap< K, V, COMPARATOR >::values | ( | ) | const [inline, virtual] |
Implements decaf::util::Map< K, V, COMPARATOR >.
Referenced by decaf::util::StlMap< std::string, cms::Topic * >::values().
virtual void decaf::util::StlMap< 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.
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.
virtual void decaf::util::StlMap< 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.
millisecs | the time in milliseconds to wait, or WAIT_INIFINITE |
nanos | additional time in nanoseconds with a range of 0-999999 |
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.
virtual void decaf::util::StlMap< 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.
millisecs | the time in milliseconds to wait, or WAIT_INIFINITE |
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.