ROSE 0.11.145.192
|
Bidirectional map of graph edge or vertex pointers.
A bi-directional 1:1 mapping between edges or vertices of one graph to edges or vertices of another graph. The edges or vertices are represented by iterators (pointers) and indexed internally by their ID numbers. Since ID numbers are not stable over erasure, whenever any of either graph's edges or vertices are erased (depending on whether this container holds edges or vertices) the updateIdNumbers should be called.
Definition at line 23 of file GraphIteratorBiMap.h.
#include <Sawyer/GraphIteratorBiMap.h>
Public Types | |
typedef GraphIteratorMap< LhsIterator, RhsIterator > | ForwardMap |
typedef GraphIteratorMap< RhsIterator, LhsIterator > | ReverseMap |
Public Member Functions | |
GraphIteratorBiMap () | |
Default constructor. | |
template<class U > | |
GraphIteratorBiMap (const GraphIteratorBiMap< LhsIterator, U > &a, const GraphIteratorBiMap< U, RhsIterator > &b) | |
Construct a new map by composition of two maps. | |
void | updateIdNumbers () |
Indicate that an update is necessary due to erasures. | |
void | insert (const LhsIterator &a, const RhsIterator &b) |
Insert a mapping from edge or vertex a to edge or vertex b . | |
void | eraseSource (const LhsIterator &a) |
Erase a pair based on the left hand side. | |
void | eraseTarget (const RhsIterator &b) |
Erase a pair based on the right hand side. | |
const ForwardMap & | forward () const |
Return the forward mapping. | |
const ReverseMap & | reverse () const |
Return the reverse mapping. | |
void | clear () |
Remove all entries from this container. | |
typedef GraphIteratorMap<LhsIterator, RhsIterator> Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::ForwardMap |
Definition at line 25 of file GraphIteratorBiMap.h.
typedef GraphIteratorMap<RhsIterator, LhsIterator> Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::ReverseMap |
Definition at line 26 of file GraphIteratorBiMap.h.
|
inline |
Default constructor.
Definition at line 34 of file GraphIteratorBiMap.h.
|
inline |
Construct a new map by composition of two maps.
Given two BiMap objects where the range type of the first is the domain type of the second, construct a new BiMap from the domain of the first to the range of the second. The new map will contain only those domain/range pairs that map across both input maps.
Definition at line 42 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::exists(), Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::insert(), and Sawyer::Container::GraphIteratorMap< K, V >::nodes().
|
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 59 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::updateIdNumbers().
|
inline |
Insert a mapping from edge or vertex a
to edge or vertex b
.
Definition at line 65 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::erase(), Sawyer::Container::GraphIteratorMap< K, V >::find(), and Sawyer::Container::GraphIteratorMap< K, V >::insert().
Referenced by Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::GraphIteratorBiMap().
|
inline |
Erase a pair based on the left hand side.
Definition at line 76 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::erase(), and Sawyer::Container::GraphIteratorMap< K, V >::find().
|
inline |
Erase a pair based on the right hand side.
Definition at line 84 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::erase(), and Sawyer::Container::GraphIteratorMap< K, V >::find().
|
inline |
Return the forward mapping.
Definition at line 92 of file GraphIteratorBiMap.h.
|
inline |
Return the reverse mapping.
Definition at line 97 of file GraphIteratorBiMap.h.
|
inline |
Remove all entries from this container.
Definition at line 102 of file GraphIteratorBiMap.h.
References Sawyer::Container::GraphIteratorMap< K, V >::clear().