Node sets. More...
#include <ogdf/basic/NodeSet.h>
Public Types | |
using | ListType = typename std::conditional< SupportFastSizeQuery, List< node >, ListPure< node > >::type |
Public Member Functions | |
NodeSet (const Graph &G) | |
Creates an empty node set associated with graph G . | |
template<bool OtherSupportsFastSizeQuery> | |
NodeSet (const NodeSet< OtherSupportsFastSizeQuery > &other) | |
Copy constructor. | |
void | clear () |
Removes all nodes from this set. | |
const Graph & | graphOf () const |
Returns the associated graph. | |
void | insert (node v) |
Inserts node v into this set. | |
bool | isMember (node v) const |
Returns true iff node v is contained in this set. | |
const ListType & | nodes () const |
Returns a reference to the list of nodes contained in this set. | |
template<bool OtherSupportsFastSizeQuery> | |
NodeSet & | operator= (const NodeSet< OtherSupportsFastSizeQuery > &other) |
Assignment operator. | |
void | remove (node v) |
Removes node v from this set. | |
int | size () const |
Returns the number of nodes in this set. | |
Private Attributes | |
NodeArray< ListIterator< node > > | m_it |
m_it[v] contains the list iterator pointing to v if v is contained in this set, or an invalid list iterator otherwise. | |
ListType | m_nodes |
The list of nodes contained in this set. | |
Node sets.
Maintains a subset of nodes contained in an associated graph.
Provides efficient operations for testing membership, iteration, insertion, and deletion of elements, as well as clearing the set.
SupportFastSizeQuery | Whether this set supports querying it's size in constant instead of linear time (in the size). |
using ogdf::NodeSet< SupportFastSizeQuery >::ListType = typename std::conditional<SupportFastSizeQuery, List<node>, ListPure<node> >::type |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |