ROSE  0.11.96.11
Public Types | Public Member Functions | List of all members
Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator > Class Template Reference

Description

template<class LhsIterator, class RhsIterator>
class Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >

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 <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. More...
 
void updateIdNumbers ()
 Indicate that an update is necessary due to erasures. More...
 
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 ForwardMapforward () const
 Return the forward mapping.
 
const ReverseMapreverse () const
 Return the reverse mapping.
 
void clear ()
 Remove all entries from this container.
 

Constructor & Destructor Documentation

◆ GraphIteratorBiMap()

template<class LhsIterator , class RhsIterator >
template<class U >
Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::GraphIteratorBiMap ( const GraphIteratorBiMap< LhsIterator, U > &  a,
const GraphIteratorBiMap< U, RhsIterator > &  b 
)
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().

Here is the call graph for this function:

Member Function Documentation

◆ updateIdNumbers()

template<class LhsIterator , class RhsIterator >
void Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::updateIdNumbers ( )
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().

Here is the call graph for this function:

The documentation for this class was generated from the following file: