ROSE  0.10.0.0
Public Types | Public Member Functions | List of all members
Sawyer::Container::GraphIteratorSet< T > Class Template Reference

Description

template<class T>
class Sawyer::Container::GraphIteratorSet< T >

Set of graph edge or vertex pointers (iterators).

This container holds a set of unique edge or vertex iterators for a single graph. Iterators form a total order by comparing their ID numbers, which is why all iterators in this container must belong to the same graph. This container is able to store only valid iterators, not end iterators. Attempting to insert an iterator with the same ID number as one that already exists is a no-op.

Since ID numbers are not stable over erasure, this container must be notified whenever edges or vertices (whichever are stored by this container), are removed from the graph, even if the items removed from the graph are not the same ones as what are stored in this container.

Definition at line 27 of file GraphIteratorSet.h.

#include <GraphIteratorSet.h>

Inheritance diagram for Sawyer::Container::GraphIteratorSet< T >:
Inheritance graph
[legend]

Public Types

typedef T Value
 Type of values stored in this set. More...
 
typedef StlVector::const_iterator ConstIterator
 Iterates over values in this set. More...
 

Public Member Functions

 GraphIteratorSet ()
 Default construct an empty set. More...
 
boost::iterator_range< ConstIteratorvalues () const
 Value iterator range. More...
 
void updateIdNumbers ()
 Indicate that an update is necessary due to erasures. More...
 
void insert (const Value &item)
 Insert the specified edge or vertex if its ID doesn't exist in this set. More...
 
void insert (const GraphIteratorSet &other)
 Insert multiple edges or vertices. More...
 
template<class SrcIterator >
void insert (const SrcIterator &begin, const SrcIterator &end)
 Insert multiple edges or vertices. More...
 
void erase (const Value &item) const
 Remove the edge or vertex if it exists. More...
 
Value popFront ()
 Removes and returns the least iterator. More...
 
void clear ()
 Remove all edges or vertices from this set. More...
 
bool exists (const Value &item) const
 Does the edge or vertex exist in this container?
 
bool isEmpty () const
 True if container has no edges or vertices. More...
 
bool empty () const
 
size_t size () const
 Number of items stored in this set. More...
 

Member Typedef Documentation

template<class T>
typedef T Sawyer::Container::GraphIteratorSet< T >::Value

Type of values stored in this set.

Definition at line 29 of file GraphIteratorSet.h.

template<class T>
typedef StlVector::const_iterator Sawyer::Container::GraphIteratorSet< T >::ConstIterator

Iterates over values in this set.

Definition at line 43 of file GraphIteratorSet.h.

Constructor & Destructor Documentation

template<class T>
Sawyer::Container::GraphIteratorSet< T >::GraphIteratorSet ( )
inline

Default construct an empty set.

Definition at line 50 of file GraphIteratorSet.h.

Member Function Documentation

template<class T>
boost::iterator_range<ConstIterator> Sawyer::Container::GraphIteratorSet< T >::values ( ) const
inline

Value iterator range.

Returns an iterator range that covers all values in the set.

Definition at line 60 of file GraphIteratorSet.h.

Referenced by Sawyer::Container::GraphIteratorSet< ControlFlowGraph::ConstVertexIterator >::insert().

template<class T>
void Sawyer::Container::GraphIteratorSet< T >::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 77 of file GraphIteratorSet.h.

template<class T>
void Sawyer::Container::GraphIteratorSet< T >::insert ( const Value item)
inline

Insert the specified edge or vertex if its ID doesn't exist in this set.

Definition at line 82 of file GraphIteratorSet.h.

Referenced by Sawyer::Container::GraphIteratorSet< ControlFlowGraph::ConstVertexIterator >::insert().

template<class T>
void Sawyer::Container::GraphIteratorSet< T >::insert ( const GraphIteratorSet< T > &  other)
inline

Insert multiple edges or vertices.

Definition at line 88 of file GraphIteratorSet.h.

template<class T>
template<class SrcIterator >
void Sawyer::Container::GraphIteratorSet< T >::insert ( const SrcIterator &  begin,
const SrcIterator &  end 
)
inline

Insert multiple edges or vertices.

Definition at line 97 of file GraphIteratorSet.h.

template<class T>
void Sawyer::Container::GraphIteratorSet< T >::erase ( const Value item) const
inline

Remove the edge or vertex if it exists.

Definition at line 104 of file GraphIteratorSet.h.

template<class T>
Value Sawyer::Container::GraphIteratorSet< T >::popFront ( )
inline

Removes and returns the least iterator.

Definition at line 112 of file GraphIteratorSet.h.

template<class T>
void Sawyer::Container::GraphIteratorSet< T >::clear ( )
inline

Remove all edges or vertices from this set.

Definition at line 121 of file GraphIteratorSet.h.

Referenced by Rose::BinaryAnalysis::FeasiblePath::reset().

template<class T>
bool Sawyer::Container::GraphIteratorSet< T >::isEmpty ( ) const
inline

True if container has no edges or vertices.

Definition at line 138 of file GraphIteratorSet.h.

Referenced by Sawyer::Container::GraphIteratorSet< ControlFlowGraph::ConstVertexIterator >::popFront().

template<class T>
size_t Sawyer::Container::GraphIteratorSet< T >::size ( void  ) const
inline

Number of items stored in this set.

Definition at line 144 of file GraphIteratorSet.h.


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