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 47 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 65 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 74 of file FilteringBFS.h.

Member Function Documentation

◆ append()

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

Definition at line 118 of file FilteringBFS.h.

◆ begin()

FilteringBFSIterator ogdf::FilteringBFS::begin ( )
inline

Definition at line 181 of file FilteringBFS.h.

◆ current()

node ogdf::FilteringBFS::current ( )
inline

Definition at line 109 of file FilteringBFS.h.

◆ end()

FilteringBFSIterator ogdf::FilteringBFS::end ( )
inline

Definition at line 183 of file FilteringBFS.h.

◆ hasVisited()

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

Definition at line 123 of file FilteringBFS.h.

◆ next()

void ogdf::FilteringBFS::next ( )
inline

Definition at line 91 of file FilteringBFS.h.

◆ operator bool()

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

Definition at line 114 of file FilteringBFS.h.

◆ operator!=()

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

Definition at line 83 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 79 of file FilteringBFS.h.

◆ pendingCount()

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

Definition at line 133 of file FilteringBFS.h.

◆ return_true()

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

Definition at line 55 of file FilteringBFS.h.

◆ setDescendFilter()

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

Definition at line 131 of file FilteringBFS.h.

◆ setVisitFilter()

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

Definition at line 129 of file FilteringBFS.h.

◆ valid()

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

Definition at line 116 of file FilteringBFS.h.

◆ willDescendFrom()

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

Definition at line 127 of file FilteringBFS.h.

◆ willVisitTarget()

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

Definition at line 125 of file FilteringBFS.h.

Member Data Documentation

◆ m_descend

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

Definition at line 51 of file FilteringBFS.h.

◆ m_pending

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

Definition at line 48 of file FilteringBFS.h.

◆ m_visit

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

Definition at line 50 of file FilteringBFS.h.

◆ m_visited

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

Definition at line 49 of file FilteringBFS.h.


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