ROSE
0.11.96.11
|
Map of graph edge or vertex pointers to some other value.
This container maps edge or vertex pointers (iterators) to values of some other type, T
. Iterators form a total order by comparing their ID numbers, which is why all iterators in this container must belong to the same graph. This container is able to store only valid iterators, not end iterators. Attempting to insert an iterator with the same ID number as one that already exists is a no-op.
Since ID numbers are not stable over erasure, this container must be notified whenever edges or vertices (whichever are stored by this container), are removed from the graph, even if the items removed from the graph are not the same ones as what are stored in this container.
Definition at line 29 of file GraphIteratorMap.h.
#include <GraphIteratorMap.h>
Classes | |
class | ConstKeyIterator |
Bidirectional iterator over keys. More... | |
class | ConstNodeIterator |
Bidirectional iterator over constant key/value nodes. More... | |
class | ConstValueIterator |
Bidirectional iterator over values. More... | |
class | Node |
The data stored at each node of the map. More... | |
class | NodeIterator |
Bidirectional iterator over key/value nodes. More... | |
class | ValueIterator |
Bidirectional iterator over values. More... | |
Public Types | |
typedef K | Key |
Graph edge or vertex iterator used as keys. | |
typedef V | Value |
Type of value associated with each key. | |
typedef StlVector::value_type | value_type |
typedef StlVector::allocator_type | allocator_type |
typedef StlVector::reference | reference |
typedef StlVector::pointer | pointer |
typedef StlVector::const_pointer | const_pointer |
typedef StlVector::iterator | iterator |
typedef StlVector::const_iterator | const_iterator |
typedef StlVector::reverse_iterator | reverse_iterator |
typedef StlVector::const_reverse_iterator | const_reverse_iterator |
typedef StlVector::difference_type | difference_type |
typedef StlVector::size_type | size_type |
Public Member Functions | |
GraphIteratorMap () | |
Default construct an empty map. | |
void | updateIdNumbers () |
Indicate that an update is necessary due to erasures. More... | |
void | insert (const Key &item, const Value &value) |
Insert the specified edge or vertex associated with a value. More... | |
Value & | insertMaybe (const Key &item, const Value &value) |
Insert a value only if its key doesn't already exist. More... | |
Value & | insertMaybeDefault (const Key &item) |
Insert a default value if its key doesn't already exist. More... | |
void | erase (const Key &item) |
Erase the specified key if it exists. | |
void | clear () |
Remove all entries from this container. | |
bool | exists (const Key &item) const |
Does the key exist in the map? | |
Sawyer::Optional< Value > | find (const Key &item) const |
Find the value associated with a particular key. | |
Value | operator[] (const Key &item) const |
Return the value associated with an existing key. | |
NodeIterator | begin () |
ConstNodeIterator | begin () const |
NodeIterator | end () |
ConstNodeIterator | end () const |
boost::iterator_range< NodeIterator > | nodes () |
Iterators for container nodes. More... | |
boost::iterator_range< ConstNodeIterator > | nodes () const |
Iterators for container nodes. More... | |
boost::iterator_range< ConstKeyIterator > | keys () |
Iterators for container keys. More... | |
boost::iterator_range< ConstKeyIterator > | keys () const |
Iterators for container keys. More... | |
boost::iterator_range< ValueIterator > | values () |
Iterators for container values. More... | |
boost::iterator_range< ConstValueIterator > | values () const |
Iterators for container values. More... | |
|
inline |
Indicate that an update is necessary due to erasures.
If the graph whose iterators are stored in this container has any edges or vertices that are erased (whichever type are stored in this container), then this function should be called to tell the container that the ID numbers of its contained iterators have possibly changed.
The actual re-sorting of this container will be delayed as long as possible, but logically the user can assume that it occurs immediately.
Definition at line 333 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::updateIdNumbers().
|
inline |
Insert the specified edge or vertex associated with a value.
If the edge or vertex already exists, then its value is changed, otherwise a new edge or vertex with the associated value is inserted into the map. Note that this is different behavior than std::map where no new value is inserted if the key already exists.
Definition at line 342 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::insert().
|
inline |
Insert a value only if its key doesn't already exist.
Returns a reference to the value, which should be used immediately. The reference is valid until the next modifying operation on this object.
Definition at line 357 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorMap< LhsIterator, RhsIterator >::insertMaybeDefault().
|
inline |
Insert a default value if its key doesn't already exist.
Returns a reference to the value, which should be used immediately. The reference is value until the next modifying operation on this object.
Definition at line 370 of file GraphIteratorMap.h.
|
inline |
Iterators for container nodes.
This returns a range of node-iterators that will traverse all nodes (key/value pairs) of this container.
Definition at line 428 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::GraphIteratorBiMap().
|
inline |
Iterators for container nodes.
This returns a range of node-iterators that will traverse all nodes (key/value pairs) of this container.
Definition at line 432 of file GraphIteratorMap.h.
|
inline |
Iterators for container keys.
Returns a range of key-iterators that will traverse the keys of this container.
Definition at line 443 of file GraphIteratorMap.h.
|
inline |
Iterators for container keys.
Returns a range of key-iterators that will traverse the keys of this container.
Definition at line 447 of file GraphIteratorMap.h.
|
inline |
Iterators for container values.
Returns a range of iterators that will traverse the user-defined values of this container. The values are iterated in key order, although the keys are not directly available via these iterators.
Definition at line 459 of file GraphIteratorMap.h.
|
inline |
Iterators for container values.
Returns a range of iterators that will traverse the user-defined values of this container. The values are iterated in key order, although the keys are not directly available via these iterators.
Definition at line 463 of file GraphIteratorMap.h.