ROSE
0.11.96.11
|
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>
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< ConstIterator > | values () 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. | |
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. | |
|
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().
|
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.