ROSE 0.11.145.147
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 <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.
 
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 ForwardMapforward () const
 Return the forward mapping.
 
const ReverseMapreverse () const
 Return the reverse mapping.
 
void clear ()
 Remove all entries from this container.
 

Member Typedef Documentation

◆ ForwardMap

template<class LhsIterator , class RhsIterator >
typedef GraphIteratorMap<LhsIterator, RhsIterator> Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::ForwardMap

Definition at line 25 of file GraphIteratorBiMap.h.

◆ ReverseMap

template<class LhsIterator , class RhsIterator >
typedef GraphIteratorMap<RhsIterator, LhsIterator> Sawyer::Container::GraphIteratorBiMap< LhsIterator, RhsIterator >::ReverseMap

Definition at line 26 of file GraphIteratorBiMap.h.

Constructor & Destructor Documentation

◆ GraphIteratorBiMap() [1/2]

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

Default constructor.

Definition at line 34 of file GraphIteratorBiMap.h.

◆ GraphIteratorBiMap() [2/2]

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().

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().

◆ insert()

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

◆ eraseSource()

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.

References Sawyer::Container::GraphIteratorMap< K, V >::erase(), and Sawyer::Container::GraphIteratorMap< K, V >::find().

◆ eraseTarget()

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.

References Sawyer::Container::GraphIteratorMap< K, V >::erase(), and Sawyer::Container::GraphIteratorMap< K, V >::find().

◆ forward()

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.

◆ reverse()

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.

◆ clear()

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.

References Sawyer::Container::GraphIteratorMap< K, V >::clear().


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