ROSE 0.11.145.192
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 <Sawyer/GraphIteratorSet.h>

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

Public Types

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

Public Member Functions

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

Member Typedef Documentation

◆ Value

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.

◆ ConstIterator

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

◆ GraphIteratorSet()

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

◆ values()

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< T >::insert().

◆ updateIdNumbers()

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.

◆ insert() [1/3]

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< T >::insert().

◆ insert() [2/3]

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.

References Sawyer::Container::GraphIteratorSet< T >::insert(), and Sawyer::Container::GraphIteratorSet< T >::values().

◆ insert() [3/3]

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.

◆ erase()

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.

◆ popFront()

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

Removes and returns the least iterator.

Definition at line 112 of file GraphIteratorSet.h.

References Sawyer::Container::GraphIteratorSet< T >::isEmpty().

◆ clear()

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.

◆ exists()

template<class T >
bool Sawyer::Container::GraphIteratorSet< T >::exists ( const Value item) const
inline

Does the edge or vertex exist in this container?

Definition at line 131 of file GraphIteratorSet.h.

◆ isEmpty()

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< T >::popFront().

◆ empty()

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

Definition at line 141 of file GraphIteratorSet.h.

◆ size()

template<class T >
size_t Sawyer::Container::GraphIteratorSet< T >::size ( ) 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: