ROSE  0.11.145.0
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 <util/Sawyer/GraphIteratorBiMap.h>

Inheritance diagram for Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >:
Inheritance graph
[legend]

Public Types

typedef GraphIteratorMap< LhsIterator, RhsIterator > ForwardMap
 
typedef GraphIteratorMap< RhsIterator, LhsIterator > ReverseMap
 

Public Member Functions

 GraphIteratorBiMap ()
 Default constructor. More...
 
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. More...
 
void eraseSource (const LhsIterator &a)
 Erase a pair based on the left hand side. More...
 
void eraseTarget (const RhsIterator &b)
 Erase a pair based on the right hand side. More...
 
const ForwardMapforward () const
 Return the forward mapping. More...
 
const ReverseMapreverse () const
 Return the reverse mapping. More...
 
void clear ()
 Remove all entries from this container. More...
 

Constructor & Destructor Documentation

template<class LhsIterator, class RhsIterator>
Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::GraphIteratorBiMap ( )
inline

Default constructor.

Definition at line 34 of file GraphIteratorBiMap.h.

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.

Member Function Documentation

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.

template<class LhsIterator, class RhsIterator>
void Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::insert ( const LhsIterator &  a,
const RhsIterator &  b 
)
inline
template<class LhsIterator, class RhsIterator>
void Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseSource ( const LhsIterator &  a)
inline

Erase a pair based on the left hand side.

Definition at line 76 of file GraphIteratorBiMap.h.

template<class LhsIterator, class RhsIterator>
void Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::eraseTarget ( const RhsIterator &  b)
inline

Erase a pair based on the right hand side.

Definition at line 84 of file GraphIteratorBiMap.h.

template<class LhsIterator, class RhsIterator>
const ForwardMap& Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::forward ( ) const
inline

Return the forward mapping.

Definition at line 92 of file GraphIteratorBiMap.h.

template<class LhsIterator, class RhsIterator>
const ReverseMap& Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::reverse ( ) const
inline

Return the reverse mapping.

Definition at line 97 of file GraphIteratorBiMap.h.

template<class LhsIterator, class RhsIterator>
void Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::clear ( )
inline

Remove all entries from this container.

Definition at line 102 of file GraphIteratorBiMap.h.


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