Chemical Data Processing Library C++ API - Version 1.1.1
|
A unique sorted associative container that maps keys to values. More...
#include <Map.hpp>
Public Types | |
typedef std::shared_ptr< Map > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Map instances. More... | |
typedef Key | KeyType |
The type of the map's keys. More... | |
typedef Value | ValueType |
The type of the mapped values. More... | |
typedef StorageType::value_type | Entry |
The type of the key/value pairs stored in the map. More... | |
typedef StorageType::const_iterator | ConstEntryIterator |
A constant iterator used to iterate over the entries of the map. More... | |
typedef StorageType::const_reverse_iterator | ConstReverseEntryIterator |
A constant iterator used to iterate backwards over the entries of the map. More... | |
typedef StorageType::iterator | EntryIterator |
A mutable iterator used to iterate over the entries of the map. More... | |
typedef StorageType::reverse_iterator | ReverseEntryIterator |
A mutable iterator used to iterate backwards over the entries of the map. More... | |
Public Member Functions | |
Map () | |
Creates an empty map. More... | |
Map (const KeyCompFunc &func) | |
Creates an empty map and uses func as key compare function. More... | |
template<typename InputIter > | |
Map (const InputIter &first, const InputIter &last) | |
Creates and initializes the map with copies of the key value pairs in the range [first, last). More... | |
template<typename InputIter > | |
Map (const InputIter &first, const InputIter &last, const KeyCompFunc &func) | |
Creates and initializes the map with copies of the key value pairs in the range [first, last) and uses func as key compare function. More... | |
virtual | ~Map () |
Virtual destructor. More... | |
StorageType & | getData () |
const StorageType & | getData () const |
std::size_t | getSize () const |
Returns the size (number of entries) of the map. More... | |
bool | isEmpty () const |
Tells whether the map is empty (getSize() == 0 ). More... | |
void | clear () |
Erases all entries. More... | |
void | swap (Map &map) |
Swaps the contents with map. More... | |
KeyCompFunc | getKeyCompareFunction () const |
Returns the key compare function used by the map. More... | |
EntryIterator | getEntry (const Key &key) |
Returns a mutable iterator pointing to the entry specified by key. More... | |
ConstEntryIterator | getEntry (const Key &key) const |
Returns a constant iterator pointing to the entry specified by key. More... | |
bool | containsEntry (const Key &key) const |
Tells whether the map contains an entry with the specified key. More... | |
Value & | getValue (const Key &key) |
Returns a non-const reference to the value associated with the specified key. More... | |
Value & | getValue (const Key &key, Value &def_value) |
Returns a non-const reference to the value associated with the specified key, or the value given by the second argument if the specified entry does not exist. More... | |
const Value & | getValue (const Key &key) const |
Returns a const reference to the value associated with the specified key. More... | |
const Value & | getValue (const Key &key, const Value &def_value) const |
Returns a const reference to the value associated with the specified key, or the value given by the second argument if the specified entry does not exist. More... | |
Value & | operator[] (const Key &key) |
Returns a non-const reference to the value associated with the specified key. More... | |
const Value & | operator[] (const Key &key) const |
Returns a const reference to the value associated with the specified key. More... | |
void | removeEntry (const EntryIterator &it) |
Removes the entry pointed to by the iterator it from the map. More... | |
bool | removeEntry (const Key &key) |
Removes the entry specified by key from the map. More... | |
void | removeEntries (const EntryIterator &first, const EntryIterator &last) |
Removes all entries pointed to by the iterators in the range [first, last) from the map. More... | |
std::pair< EntryIterator, bool > | insertEntry (const Entry &item) |
Tries to insert the key/value pair item into the map. More... | |
std::pair< EntryIterator, bool > | insertEntry (const Key &key, const Value &value) |
Tries to insert a new entry with specified key and value into the map. More... | |
EntryIterator | insertEntry (const EntryIterator &it, const Entry &item) |
Tries to insert the key/value pair item into the map and uses the iterator it as a hint for the insertion location. More... | |
EntryIterator | insertEntry (const EntryIterator &it, const Key &key, const Value &value) |
Tries to insert a new entry with the specified key and value into the map and uses the iterator it as a hint for the insertion location. More... | |
EntryIterator | setEntry (const Entry &item) |
Inserts a new entry or updates the value of an existing entry with the key and value given by item. More... | |
EntryIterator | setEntry (const Key &key, const Value &value) |
Inserts a new entry or updates the value of an existing entry with the specified key and value. More... | |
template<typename InputIter > | |
void | insertEntries (const InputIter &first, const InputIter &last) |
Tries to insert the key/value pairs in the range [first, last). More... | |
template<typename InputIter > | |
void | setEntries (const InputIter &first, const InputIter &last) |
Inserts new entries or updates the value of existing entries using the key/value pairs in the range [first, last). More... | |
EntryIterator | getLowerBound (const Key &key) |
Returns a mutable iterator pointing to the first entry whose key is not less than the specified key. More... | |
ConstEntryIterator | getLowerBound (const Key &key) const |
Returns a constant iterator pointing to the first entry whose key is not less than the specified key. More... | |
EntryIterator | getUpperBound (const Key &key) |
Returns a mutable iterator pointing to the first entry whose key is greater than the specified key. More... | |
ConstEntryIterator | getUpperBound (const Key &key) const |
Returns a constant iterator pointing to the first entry whose key is greater than the specified key. More... | |
ConstEntryIterator | getEntriesBegin () const |
Returns a constant iterator pointing to the beginning of the map. More... | |
EntryIterator | getEntriesBegin () |
Returns a mutable iterator pointing to the beginning of the map. More... | |
ConstEntryIterator | getEntriesEnd () const |
Returns a constant iterator pointing to the end of the map. More... | |
EntryIterator | getEntriesEnd () |
Returns a mutable iterator pointing to the end of the map. More... | |
ConstEntryIterator | begin () const |
Returns a constant iterator pointing to the beginning of the map. More... | |
EntryIterator | begin () |
Returns a mutable iterator pointing to the beginning of the map. More... | |
ConstEntryIterator | end () const |
Returns a constant iterator pointing to the end of the map. More... | |
EntryIterator | end () |
Returns a mutable iterator pointing to the end of the map. More... | |
ConstReverseEntryIterator | getEntriesReverseBegin () const |
Returns a constant iterator pointing to the beginning of the reversed map. More... | |
ReverseEntryIterator | getEntriesReverseBegin () |
Returns a mutable iterator pointing to the beginning of the reversed map. More... | |
ConstReverseEntryIterator | getEntriesReverseEnd () const |
Returns a constant iterator pointing to the end of the reversed map. More... | |
ReverseEntryIterator | getEntriesReverseEnd () |
Returns a mutable iterator pointing to the end of the reversed map. More... | |
Protected Member Functions | |
virtual const char * | getClassName () const |
Returns the name of the (derived) Map class. More... | |
A unique sorted associative container that maps keys to values.
Since Map
is a sorted associative container, it uses an ordering relation on its keys. Two keys are considered to be equivalent if neither one is less than the other. Map
guarantees that the complexity for most operations is never worse than logarithmic, and the entries are always sorted in ascending order by key. It is also an unique associative container, meaning that no two entries have the same key. Map
has the important property that inserting a new entry does not invalidate iterators that point to existing entries. Erasing an entry also does not invalidate any iterators, except, of course, for iterators that actually point to the entry that is being erased.
Key | The type of the map's keys. |
Value | The type of the mapped values. |
AllowDefValues | Whether to return a default value or to throw an exception if a key/value entry is not present in the map. |
KeyCompFunc | The type of a functor class used to establish the strictly weak ordering on the map's keys. The functor has to return true if the first argument is less than the second one, and false otherwise. |
typedef std::shared_ptr<Map> CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Map
instances.
typedef Key CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::KeyType |
The type of the map's keys.
typedef Value CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ValueType |
The type of the mapped values.
typedef StorageType::value_type CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::Entry |
The type of the key/value pairs stored in the map.
The member Entry::first
is the const
key object of type Key and the member Entry::second
is the associated value object of type Value.
typedef StorageType::const_iterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator |
A constant iterator used to iterate over the entries of the map.
typedef StorageType::const_reverse_iterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstReverseEntryIterator |
A constant iterator used to iterate backwards over the entries of the map.
typedef StorageType::iterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator |
A mutable iterator used to iterate over the entries of the map.
typedef StorageType::reverse_iterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ReverseEntryIterator |
A mutable iterator used to iterate backwards over the entries of the map.
|
inline |
Creates an empty map.
|
inline |
Creates an empty map and uses func as key compare function.
func | The key compare function to use. |
|
inline |
Creates and initializes the map with copies of the key value pairs in the range [first, last).
first | The start of the range. |
last | The end of the range. |
|
inline |
Creates and initializes the map with copies of the key value pairs in the range [first, last) and uses func as key compare function.
first | The start of the range. |
last | The end of the range. |
func | The key compare function to use. |
|
inlinevirtual |
Virtual destructor.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::StorageType & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getData |
const CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::StorageType & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getData |
std::size_t CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getSize |
Returns the size (number of entries) of the map.
bool CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::isEmpty |
Tells whether the map is empty (getSize() == 0
).
true
if the map is empty, and false
otherwise. void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::clear |
Erases all entries.
void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::swap | ( | Map< Key, Value, AllowDefValues, KeyCompFunc > & | map | ) |
Swaps the contents with map.
map | The other map with which the contents will be exchanged. |
KeyCompFunc CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getKeyCompareFunction |
Returns the key compare function used by the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntry | ( | const Key & | key | ) |
Returns a mutable iterator pointing to the entry specified by key.
If the map does not contain an entry with the specified key, an iterator pointing one past the last entry of the map (== getEntriesEnd()
) is returned.
key | The key specifying the entry. |
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntry | ( | const Key & | key | ) | const |
Returns a constant iterator pointing to the entry specified by key.
If the map does not contain an entry with the specified key, an iterator pointing one past the last entry of the map (== getEntriesEnd()
) is returned.
key | The key specifying the entry. |
bool CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::containsEntry | ( | const Key & | key | ) | const |
Tells whether the map contains an entry with the specified key.
key | The key specifying the entry. |
true
if the map contains the specified entry, and false
otherwise. Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getValue | ( | const Key & | key | ) |
Returns a non-const
reference to the value associated with the specified key.
If the map contains an entry with the specified key, a reference to the associated value is returned. If the map does not contain the entry and default values are enabled (that is, the template parameter AllowDefValues is true
), a new map entry is created which associates key with the default constructed value object. Otherwise, Base::ItemNotFound is thrown to indicate the error.
key | The key associated with the requested value. |
const
reference to the requested value. Base::ItemNotFound | if AllowDefValues is false and the map does not contain an entry with the specified key. |
Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getValue | ( | const Key & | key, |
Value & | def_value | ||
) |
Returns a non-const
reference to the value associated with the specified key, or the value given by the second argument if the specified entry does not exist.
If the map contains an entry with the specified key, a reference to the associated value is returned. If the map does not contain the entry, the second argument def_value is returned.
key | The key associated with the requested value. |
def_value | The value which is returned if the specified entry does not exist. |
const
reference to the requested or default value. const Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getValue | ( | const Key & | key | ) | const |
Returns a const
reference to the value associated with the specified key.
If the map contains the specified entry, a reference to the associated value is returned. If the map does not contain the entry and default values are enabled (that is, the template parameter AllowDefValues is true
), a const
reference to a default constructed value object is returned. Otherwise, Base::ItemNotFound is thrown to indicate the error.
key | The key associated with the requested value. |
const
reference to the requested value. Base::ItemNotFound | if AllowDefValues is false and the map does not contain an entry with the specified key. |
const Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getValue | ( | const Key & | key, |
const Value & | def_value | ||
) | const |
Returns a const
reference to the value associated with the specified key, or the value given by the second argument if the specified entry does not exist.
If the map contains an entry with the specified key, a reference to the associated value is returned. If the map does not contain the entry, the second argument def_value is returned.
key | The key associated with the requested value. |
def_value | The value which is returned if the specified entry does not exist. |
const
reference to the requested or default value. Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::operator[] | ( | const Key & | key | ) |
Returns a non-const
reference to the value associated with the specified key.
The method is equivalent to getValue(const Key&).
key | The key associated with the requested value. |
const
reference to the requested value. Base::ItemNotFound | if AllowDefValues is false and the map does not contain an entry with the specified key. |
const Value & CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::operator[] | ( | const Key & | key | ) | const |
Returns a const
reference to the value associated with the specified key.
The method is equivalent to getValue(const Key&) const.
key | The key associated with the requested value. |
const
reference to the requested value. Base::ItemNotFound | if AllowDefValues is false and the map does not contain an entry with the specified key. |
void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::removeEntry | ( | const EntryIterator & | it | ) |
Removes the entry pointed to by the iterator it from the map.
it | The iterator pointing to the entry to remove. |
bool CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::removeEntry | ( | const Key & | key | ) |
Removes the entry specified by key from the map.
key | The key specifying the entry to remove. |
void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::removeEntries | ( | const EntryIterator & | first, |
const EntryIterator & | last | ||
) |
Removes all entries pointed to by the iterators in the range [first, last) from the map.
first | The start of the range. |
last | The end of the range. |
std::pair< typename CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator, bool > CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::insertEntry | ( | const Entry & | item | ) |
Tries to insert the key/value pair item into the map.
Inserts item if and only if the map does not already contain an entry whose key is the same as the key of item. The return value is a pair P
. P.first
is an iterator pointing to the entry whose key is the same as the key of item. P.second
is a boolean value which is true
if item was actually inserted, and false
if the map already contained an entry with the same key as item.
item | The key/value pair to insert. |
true
if the insertion of item was successful (an entry with the specified key did not already exist), and false
otherwise. std::pair< typename CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator, bool > CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::insertEntry | ( | const Key & | key, |
const Value & | value | ||
) |
Tries to insert a new entry with specified key and value into the map.
Inserts a new entry if and only if the map does not already contain an entry whose key is the same as the specified key. The return value is a pair P
. P.first
is an iterator pointing to the entry whose key is the same as the specified key. P.second
is a boolean value which is true
if item was actually inserted, and false
if the map already contained an entry with the specified key.
key | The key of the entry to insert. |
value | The value associated with key. |
true
if the insertion of item was successful (an entry with the specified key did not already exist), and false
otherwise. CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::insertEntry | ( | const EntryIterator & | it, |
const Entry & | item | ||
) |
Tries to insert the key/value pair item into the map and uses the iterator it as a hint for the insertion location.
Inserts item if and only if the map does not already contain an entry whose key is the same as the key of item. The argument it is a hint and points to the location where the insertion position search will begin. The return value is a dereferenceable iterator that points to the entry with a key that is equivalent to that of item.
it | An iterator pointing to a location where the insertion position search will begin. |
item | The key/value pair to insert. |
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::insertEntry | ( | const EntryIterator & | it, |
const Key & | key, | ||
const Value & | value | ||
) |
Tries to insert a new entry with the specified key and value into the map and uses the iterator it as a hint for the insertion location.
Inserts a new entry if and only if the map does not already contain an entry whose key is the same as the specified key. The argument it is a hint and points to the location where the insertion position search will begin. The return value is a dereferenceable iterator that points to the entry with a key that is equivalent to the specified key.
it | An iterator pointing to a location where the insertion position search will begin. |
key | The key of the entry to insert. |
value | The value associated with key |
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::setEntry | ( | const Entry & | item | ) |
Inserts a new entry or updates the value of an existing entry with the key and value given by item.
If the map does not already contain an entry whose key is the same as the key of item then a new entry will be created. Otherwise, the value of the existing entry is updated with the value of item. The return value is a dereferenceable iterator that points to the newly inserted or updated entry whose key is equivalent to that of item.
item | The key/value pair. |
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::setEntry | ( | const Key & | key, |
const Value & | value | ||
) |
Inserts a new entry or updates the value of an existing entry with the specified key and value.
If the map does not already contain an entry whose key is the same as key then a new entry will be created. Otherwise, the value of the existing entry is updated with value. The return value is a dereferenceable iterator that points to the newly inserted or updated entry whose key is equivalent to the specified key.
key | The key of the entry to insert or update. |
value | The value to be associated with key. |
void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::insertEntries | ( | const InputIter & | first, |
const InputIter & | last | ||
) |
Tries to insert the key/value pairs in the range [first, last).
This is equivalent to calling insertEntry(const Entry&) for each key/value pair i that is pointed to by an iterator in the range [first, last). A key/value pair is inserted if and only if the map does not already contain an entry with an equivalent key.
first | The start of the range. |
last | The end of the range. |
void CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::setEntries | ( | const InputIter & | first, |
const InputIter & | last | ||
) |
Inserts new entries or updates the value of existing entries using the key/value pairs in the range [first, last).
This is equivalent to calling setEntry(const Entry&) for each key/value pair i that is pointed to by an iterator in the range [first, last).
first | The start of the range. |
last | The end of the range. |
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getLowerBound | ( | const Key & | key | ) |
Returns a mutable iterator pointing to the first entry whose key is not less than the specified key.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getLowerBound | ( | const Key & | key | ) | const |
Returns a constant iterator pointing to the first entry whose key is not less than the specified key.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getUpperBound | ( | const Key & | key | ) |
Returns a mutable iterator pointing to the first entry whose key is greater than the specified key.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getUpperBound | ( | const Key & | key | ) | const |
Returns a constant iterator pointing to the first entry whose key is greater than the specified key.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesBegin |
Returns a constant iterator pointing to the beginning of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesBegin |
Returns a mutable iterator pointing to the beginning of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesEnd |
Returns a constant iterator pointing to the end of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesEnd |
Returns a mutable iterator pointing to the end of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::begin |
Returns a constant iterator pointing to the beginning of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::begin |
Returns a mutable iterator pointing to the beginning of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::end |
Returns a constant iterator pointing to the end of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::EntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::end |
Returns a mutable iterator pointing to the end of the map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstReverseEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesReverseBegin |
Returns a constant iterator pointing to the beginning of the reversed map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ReverseEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesReverseBegin |
Returns a mutable iterator pointing to the beginning of the reversed map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ConstReverseEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesReverseEnd |
Returns a constant iterator pointing to the end of the reversed map.
CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::ReverseEntryIterator CDPL::Util::Map< Key, Value, AllowDefValues, KeyCompFunc >::getEntriesReverseEnd |
Returns a mutable iterator pointing to the end of the reversed map.
|
protectedvirtual |
Returns the name of the (derived) Map class.
Overriding this method provides an easy way to customize exception messages with the name of a derived class.
Consider the class MyMap
which inherits publicly from Map<int, int>
and overrides getClassName():
If, for example, the requested value for a particular key is not found, the error message of the thrown Base::ItemNotFound exception will now start with "MyMap: ...." instead of the default "Map: ....".