ROSE 0.11.145.147
|
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 <Sawyer/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. | |
void | insert (const Key &item, const Value &value) |
Insert the specified edge or vertex associated with a value. | |
Value & | insertMaybe (const Key &item, const Value &value) |
Insert a value only if its key doesn't already exist. | |
Value & | insertMaybeDefault (const Key &item) |
Insert a default value if its key doesn't already exist. | |
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. | |
boost::iterator_range< ConstNodeIterator > | nodes () const |
Iterators for container nodes. | |
boost::iterator_range< ConstKeyIterator > | keys () |
Iterators for container keys. | |
boost::iterator_range< ConstKeyIterator > | keys () const |
Iterators for container keys. | |
boost::iterator_range< ValueIterator > | values () |
Iterators for container values. | |
boost::iterator_range< ConstValueIterator > | values () const |
Iterators for container values. | |
typedef K Sawyer::Container::GraphIteratorMap< K, V >::Key |
Graph edge or vertex iterator used as keys.
Definition at line 31 of file GraphIteratorMap.h.
typedef V Sawyer::Container::GraphIteratorMap< K, V >::Value |
Type of value associated with each key.
Definition at line 32 of file GraphIteratorMap.h.
typedef StlVector::value_type Sawyer::Container::GraphIteratorMap< K, V >::value_type |
Definition at line 301 of file GraphIteratorMap.h.
typedef StlVector::allocator_type Sawyer::Container::GraphIteratorMap< K, V >::allocator_type |
Definition at line 302 of file GraphIteratorMap.h.
typedef StlVector::reference Sawyer::Container::GraphIteratorMap< K, V >::reference |
Definition at line 303 of file GraphIteratorMap.h.
typedef StlVector::pointer Sawyer::Container::GraphIteratorMap< K, V >::pointer |
Definition at line 304 of file GraphIteratorMap.h.
typedef StlVector::const_pointer Sawyer::Container::GraphIteratorMap< K, V >::const_pointer |
Definition at line 305 of file GraphIteratorMap.h.
typedef StlVector::iterator Sawyer::Container::GraphIteratorMap< K, V >::iterator |
Definition at line 306 of file GraphIteratorMap.h.
typedef StlVector::const_iterator Sawyer::Container::GraphIteratorMap< K, V >::const_iterator |
Definition at line 307 of file GraphIteratorMap.h.
typedef StlVector::reverse_iterator Sawyer::Container::GraphIteratorMap< K, V >::reverse_iterator |
Definition at line 308 of file GraphIteratorMap.h.
typedef StlVector::const_reverse_iterator Sawyer::Container::GraphIteratorMap< K, V >::const_reverse_iterator |
Definition at line 309 of file GraphIteratorMap.h.
typedef StlVector::difference_type Sawyer::Container::GraphIteratorMap< K, V >::difference_type |
Definition at line 310 of file GraphIteratorMap.h.
typedef StlVector::size_type Sawyer::Container::GraphIteratorMap< K, V >::size_type |
Definition at line 311 of file GraphIteratorMap.h.
|
inline |
Default construct an empty map.
Definition at line 318 of file GraphIteratorMap.h.
|
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< K, V >::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.
References Sawyer::Container::GraphIteratorMap< K, V >::insertMaybe().
|
inline |
Erase the specified key if it exists.
Definition at line 375 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseSource(), Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseTarget(), and Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::insert().
|
inline |
Remove all entries from this container.
Definition at line 384 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::clear().
|
inline |
Does the key exist in the map?
Definition at line 394 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::GraphIteratorBiMap().
|
inline |
Find the value associated with a particular key.
Definition at line 402 of file GraphIteratorMap.h.
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseSource(), Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseTarget(), Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::insert(), and Sawyer::Container::GraphIteratorMap< K, V >::operator[]().
|
inline |
Return the value associated with an existing key.
Definition at line 414 of file GraphIteratorMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::find().
|
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.
|
inline |
Definition at line 470 of file GraphIteratorMap.h.
|
inline |
Definition at line 471 of file GraphIteratorMap.h.
|
inline |
Definition at line 472 of file GraphIteratorMap.h.
|
inline |
Definition at line 473 of file GraphIteratorMap.h.