ROSE 0.11.145.192
|
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>
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. | |
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. | |
typedef T Sawyer::Container::GraphIteratorSet< T >::Value |
Type of values stored in this set.
Definition at line 29 of file GraphIteratorSet.h.
typedef StlVector::const_iterator Sawyer::Container::GraphIteratorSet< T >::ConstIterator |
Iterates over values in this set.
Definition at line 43 of file GraphIteratorSet.h.
|
inline |
Default construct an empty set.
Definition at line 50 of file GraphIteratorSet.h.
|
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.
|
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().
|
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().
|
inline |
Insert multiple edges or vertices.
Definition at line 97 of file GraphIteratorSet.h.
|
inline |
Remove the edge or vertex if it exists.
Definition at line 104 of file GraphIteratorSet.h.
|
inline |
Removes and returns the least iterator.
Definition at line 112 of file GraphIteratorSet.h.
References Sawyer::Container::GraphIteratorSet< T >::isEmpty().
|
inline |
Remove all edges or vertices from this set.
Definition at line 121 of file GraphIteratorSet.h.
|
inline |
Does the edge or vertex exist in this container?
Definition at line 131 of file GraphIteratorSet.h.
|
inline |
True if container has no edges or vertices.
Definition at line 138 of file GraphIteratorSet.h.
Referenced by Sawyer::Container::GraphIteratorSet< T >::popFront().
|
inline |
Definition at line 141 of file GraphIteratorSet.h.
|
inline |
Number of items stored in this set.
Definition at line 144 of file GraphIteratorSet.h.