8 #ifndef Sawyer_GraphIteratorBiMap_H
9 #define Sawyer_GraphIteratorBiMap_H
11 #include <Sawyer/GraphIteratorMap.h>
22 template<
class LhsIterator,
class RhsIterator>
43 BOOST_FOREACH (
const typename ForwardMap::Node &anode, a.forward_.
nodes()) {
44 if (b.forward_.
exists(anode.value())) {
45 const RhsIterator &target = b.forward_[anode.value()];
46 insert(anode.key(), target);
65 void insert(
const LhsIterator &a,
const RhsIterator &b) {
78 reverse_.
erase(*found);
86 forward_.
erase(*found);
void eraseTarget(const RhsIterator &b)
Erase a pair based on the right hand side.
Holds a value or nothing.
void erase(const Key &item)
Erase the specified key if it exists.
void clear()
Remove all entries from this container.
void clear()
Remove all entries from this container.
GraphIteratorBiMap()
Default constructor.
void updateIdNumbers()
Indicate that an update is necessary due to erasures.
void eraseSource(const LhsIterator &a)
Erase a pair based on the left hand side.
const ForwardMap & forward() const
Return the forward mapping.
Bidirectional map of graph edge or vertex pointers.
void updateIdNumbers()
Indicate that an update is necessary due to erasures.
const ReverseMap & reverse() const
Return the reverse mapping.
void insert(const Key &item, const Value &value)
Insert the specified edge or vertex associated with a value.
GraphIteratorBiMap(const GraphIteratorBiMap< LhsIterator, U > &a, const GraphIteratorBiMap< U, RhsIterator > &b)
Construct a new map by composition of two maps.
Sawyer::Optional< Value > find(const Key &item) const
Find the value associated with a particular key.
Name space for the entire library.
boost::iterator_range< NodeIterator > nodes()
Iterators for container nodes.
void insert(const LhsIterator &a, const RhsIterator &b)
Insert a mapping from edge or vertex a to edge or vertex b.
bool exists(const Key &item) const
Does the key exist in the map?