Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::FilteringBFS Class Reference

An iterator-based BFS through a Graph. More...

#include <ogdf/basic/pctree/util/FilteringBFS.h>

Public Member Functions

 FilteringBFS ()=default
 
 FilteringBFS (const FilteringBFS &copy)=default
 
template<typename Container >
 FilteringBFS (const Graph &G, Container &nodes, const std::function< bool(adjEntry)> &visit=return_true< adjEntry >, const std::function< bool(node)> &descend_from=return_true< node >)
 
 FilteringBFS (const Graph &G, std::initializer_list< node > nodes, const std::function< bool(adjEntry)> &visit=return_true< adjEntry >, const std::function< bool(node)> &descend_from=return_true< node >)
 
 FilteringBFS (FilteringBFS &&move) noexcept=default
 
void append (node n)
 
FilteringBFSIterator begin ()
 
node current ()
 
FilteringBFSIterator end ()
 
bool hasVisited (node n) const
 
void next ()
 
 operator bool () const
 
bool operator!= (const FilteringBFS &rhs) const
 
FilteringBFSoperator= (const FilteringBFS &copy)=default
 
FilteringBFSoperator= (FilteringBFS &&move) noexcept=default
 
bool operator== (const FilteringBFS &rhs) const
 
int pendingCount () const
 
void setDescendFilter (const std::function< bool(node)> &mDescend)
 
void setVisitFilter (const std::function< bool(adjEntry)> &mVisit)
 
bool valid () const
 
bool willDescendFrom (node n) const
 
bool willVisitTarget (adjEntry adj) const
 

Static Public Member Functions

template<typename T >
static bool return_true (T t)
 

Private Attributes

std::function< bool(node)> m_descend
 
Queue< nodem_pending
 
std::function< bool(adjEntry)> m_visit
 
NodeArray< bool > m_visited
 

Detailed Description

An iterator-based BFS through a Graph.

Allows specifying filters to not visit or descend from certain nodes.

Definition at line 57 of file FilteringBFS.h.

Constructor & Destructor Documentation

◆ FilteringBFS() [1/5]

ogdf::FilteringBFS::FilteringBFS ( )
explicitdefault

◆ FilteringBFS() [2/5]

ogdf::FilteringBFS::FilteringBFS ( const FilteringBFS copy)
default

◆ FilteringBFS() [3/5]

ogdf::FilteringBFS::FilteringBFS ( FilteringBFS &&  move)
defaultnoexcept

◆ FilteringBFS() [4/5]

template<typename Container >
ogdf::FilteringBFS::FilteringBFS ( const Graph G,
Container &  nodes,
const std::function< bool(adjEntry)> &  visit = return_true<adjEntry>,
const std::function< bool(node)> &  descend_from = return_true<node> 
)
inlineexplicit

Definition at line 75 of file FilteringBFS.h.

◆ FilteringBFS() [5/5]

ogdf::FilteringBFS::FilteringBFS ( const Graph G,
std::initializer_list< node nodes,
const std::function< bool(adjEntry)> &  visit = return_true<adjEntry>,
const std::function< bool(node)> &  descend_from = return_true<node> 
)
inlineexplicit

Definition at line 84 of file FilteringBFS.h.

Member Function Documentation

◆ append()

void ogdf::FilteringBFS::append ( node  n)
inline

Definition at line 128 of file FilteringBFS.h.

◆ begin()

FilteringBFSIterator ogdf::FilteringBFS::begin ( )
inline

Definition at line 191 of file FilteringBFS.h.

◆ current()

node ogdf::FilteringBFS::current ( )
inline

Definition at line 119 of file FilteringBFS.h.

◆ end()

FilteringBFSIterator ogdf::FilteringBFS::end ( )
inline

Definition at line 193 of file FilteringBFS.h.

◆ hasVisited()

bool ogdf::FilteringBFS::hasVisited ( node  n) const
inline

Definition at line 133 of file FilteringBFS.h.

◆ next()

void ogdf::FilteringBFS::next ( )
inline

Definition at line 101 of file FilteringBFS.h.

◆ operator bool()

ogdf::FilteringBFS::operator bool ( ) const
inline

Definition at line 124 of file FilteringBFS.h.

◆ operator!=()

bool ogdf::FilteringBFS::operator!= ( const FilteringBFS rhs) const
inline

Definition at line 93 of file FilteringBFS.h.

◆ operator=() [1/2]

FilteringBFS& ogdf::FilteringBFS::operator= ( const FilteringBFS copy)
default

◆ operator=() [2/2]

FilteringBFS& ogdf::FilteringBFS::operator= ( FilteringBFS &&  move)
defaultnoexcept

◆ operator==()

bool ogdf::FilteringBFS::operator== ( const FilteringBFS rhs) const
inline

Definition at line 89 of file FilteringBFS.h.

◆ pendingCount()

int ogdf::FilteringBFS::pendingCount ( ) const
inline

Definition at line 143 of file FilteringBFS.h.

◆ return_true()

template<typename T >
static bool ogdf::FilteringBFS::return_true ( t)
inlinestatic

Definition at line 65 of file FilteringBFS.h.

◆ setDescendFilter()

void ogdf::FilteringBFS::setDescendFilter ( const std::function< bool(node)> &  mDescend)
inline

Definition at line 141 of file FilteringBFS.h.

◆ setVisitFilter()

void ogdf::FilteringBFS::setVisitFilter ( const std::function< bool(adjEntry)> &  mVisit)
inline

Definition at line 139 of file FilteringBFS.h.

◆ valid()

bool ogdf::FilteringBFS::valid ( ) const
inline

Definition at line 126 of file FilteringBFS.h.

◆ willDescendFrom()

bool ogdf::FilteringBFS::willDescendFrom ( node  n) const
inline

Definition at line 137 of file FilteringBFS.h.

◆ willVisitTarget()

bool ogdf::FilteringBFS::willVisitTarget ( adjEntry  adj) const
inline

Definition at line 135 of file FilteringBFS.h.

Member Data Documentation

◆ m_descend

std::function<bool(node)> ogdf::FilteringBFS::m_descend
private

Definition at line 61 of file FilteringBFS.h.

◆ m_pending

Queue<node> ogdf::FilteringBFS::m_pending
private

Definition at line 58 of file FilteringBFS.h.

◆ m_visit

std::function<bool(adjEntry)> ogdf::FilteringBFS::m_visit
private

Definition at line 60 of file FilteringBFS.h.

◆ m_visited

NodeArray<bool> ogdf::FilteringBFS::m_visited
private

Definition at line 59 of file FilteringBFS.h.


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