Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::NodeSetPure Class Reference

Node sets. More...

#include <ogdf/basic/NodeSet.h>

Public Member Functions

 NodeSetPure (const Graph &G)
 Creates an empty node set associated with graph G. More...
 
 NodeSetPure (const NodeSetPure &V)
 Copy constructor. More...
 
 ~NodeSetPure ()
 
void clear ()
 Removes all nodes from S. More...
 
void insert (node v)
 Inserts node v into S. More...
 
bool isMember (node v) const
 Returns true if node v is contained in S, false otherwise. More...
 
const ListPure< node > & nodes () const
 Returns a reference to the list of nodes contained in S. More...
 
NodeSetPure & operator= (const NodeSetPure &V)
 Assignment operator. More...
 
void remove (node v)
 Removes node v from S. More...
 

Private Attributes

NodeArray< ListIterator< node > > m_it
 m_it[v] contains the list iterator pointing to v if v is contained in S, an invalid list iterator otherwise. More...
 
ListPure< node > m_nodes
 The list of nodes contained in S. More...
 

Detailed Description

Node sets.

A node set maintains a subset S of the nodes contained in an associated graph. This kind of node set provides efficient operations for testing membership, insertion and deletion of elements, and clearing the set.

In contrast to NodeSet, a NodeSetPure does not provide efficient access to the number of nodes stored in the set.

See also

Definition at line 136 of file NodeSet.h.

Constructor & Destructor Documentation

◆ NodeSetPure() [1/2]

ogdf::NodeSetPure::NodeSetPure ( const Graph &  G)
inlineexplicit

Creates an empty node set associated with graph G.

Definition at line 139 of file NodeSet.h.

◆ ~NodeSetPure()

ogdf::NodeSetPure::~NodeSetPure ( )
inline

Definition at line 142 of file NodeSet.h.

◆ NodeSetPure() [2/2]

ogdf::NodeSetPure::NodeSetPure ( const NodeSetPure &  V)
inline

Copy constructor.

Definition at line 207 of file NodeSet.h.

Member Function Documentation

◆ clear()

void ogdf::NodeSetPure::clear ( )
inline

Removes all nodes from S.

After this operation, S is empty and still associated with the same graph. The runtime of this operations is O(k), where k is the number of nodes in S before this operation.

Definition at line 179 of file NodeSet.h.

◆ insert()

void ogdf::NodeSetPure::insert ( node  v)
inline

Inserts node v into S.

This operation has constant runtime.

Precondition
v is a node in the associated graph.

Definition at line 150 of file NodeSet.h.

◆ isMember()

bool ogdf::NodeSetPure::isMember ( node  v) const
inline

Returns true if node v is contained in S, false otherwise.

This operation has constant runtime.

Precondition
v is a node in the associated graph.

Definition at line 193 of file NodeSet.h.

◆ nodes()

const ListPure<node>& ogdf::NodeSetPure::nodes ( ) const
inline

Returns a reference to the list of nodes contained in S.

This list can be used for iterating over all nodes in S.

Definition at line 202 of file NodeSet.h.

◆ operator=()

NodeSetPure& ogdf::NodeSetPure::operator= ( const NodeSetPure &  V)
inline

Assignment operator.

Definition at line 214 of file NodeSet.h.

◆ remove()

void ogdf::NodeSetPure::remove ( node  v)
inline

Removes node v from S.

This operation has constant runtime.

Precondition
v is a node in the associated graph.

Definition at line 163 of file NodeSet.h.

Member Data Documentation

◆ m_it

NodeArray<ListIterator<node> > ogdf::NodeSetPure::m_it
private

m_it[v] contains the list iterator pointing to v if v is contained in S, an invalid list iterator otherwise.

Definition at line 226 of file NodeSet.h.

◆ m_nodes

ListPure<node> ogdf::NodeSetPure::m_nodes
private

The list of nodes contained in S.

Definition at line 229 of file NodeSet.h.


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