Class to implement a dependency graph, converted to STL instead of Qt.
More...
#include <Libs/Core/ctkDependencyGraph.h>
|
ctkDependencyGraphPrivate * | d_ptr |
|
Class to implement a dependency graph, converted to STL instead of Qt.
Definition at line 38 of file ctkDependencyGraph.h.
◆ ctkDependencyGraph()
ctkDependencyGraph::ctkDependencyGraph |
( |
int |
nvertices | ) |
|
◆ ~ctkDependencyGraph()
virtual ctkDependencyGraph::~ctkDependencyGraph |
( |
| ) |
|
|
virtual |
◆ checkForCycle()
bool ctkDependencyGraph::checkForCycle |
( |
| ) |
|
Traverse graph and check for cycle.
◆ cycleDetected()
bool ctkDependencyGraph::cycleDetected |
( |
| ) |
const |
Return true if there is at least one cycle.
◆ cycleEnd()
int ctkDependencyGraph::cycleEnd |
( |
| ) |
const |
If a cycle has been detected, return the end of the cycle otherwise 0.
◆ cycleOrigin()
int ctkDependencyGraph::cycleOrigin |
( |
| ) |
const |
If a cycle has been detected, return the origin of the cycle otherwise 0.
◆ findPath()
void ctkDependencyGraph::findPath |
( |
int |
from, |
|
|
int |
to, |
|
|
std::list< int > & |
path |
|
) |
| |
Retrieve the path between two vertices.
◆ findPaths()
void ctkDependencyGraph::findPaths |
( |
int |
from, |
|
|
int |
to, |
|
|
std::list< std::list< int > * > & |
paths |
|
) |
| |
Retrieve the paths between two vertices Caller is responsible to clear paths list
◆ insertEdge()
void ctkDependencyGraph::insertEdge |
( |
int |
from, |
|
|
int |
to |
|
) |
| |
Insert edge (from, to) indicate a relation between two vertices Note also that vertex id should be >= 1
◆ numberOfEdges()
int ctkDependencyGraph::numberOfEdges |
( |
| ) |
const |
Get the number of edges associated with current graph.
◆ numberOfVertices()
int ctkDependencyGraph::numberOfVertices |
( |
| ) |
const |
Get the number of vertices associated with current graph.
◆ printAdditionalInfo()
void ctkDependencyGraph::printAdditionalInfo |
( |
| ) |
const |
◆ printGraph()
void ctkDependencyGraph::printGraph |
( |
| ) |
const |
◆ processEdge()
virtual void ctkDependencyGraph::processEdge |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ setEdgeListToExclude()
void ctkDependencyGraph::setEdgeListToExclude |
( |
const std::list< int > & |
list | ) |
|
List of edge to exclude An edge is specified using its extremity
◆ setVerbose()
void ctkDependencyGraph::setVerbose |
( |
bool |
verbose | ) |
|
◆ shouldExcludeEdge()
virtual bool ctkDependencyGraph::shouldExcludeEdge |
( |
int |
edge | ) |
const |
|
virtual |
The default implementation check if 'edge' is in the list of edge to exclude See setEdgeListToExclude
◆ sourceVertices()
void ctkDependencyGraph::sourceVertices |
( |
std::list< int > & |
sources | ) |
|
Retrieve all vertices with indegree 0.
◆ topologicalSort()
bool ctkDependencyGraph::topologicalSort |
( |
std::list< int > & |
sorted, |
|
|
int |
rootId = -1 |
|
) |
| |
Perform a topological sort Return false if the graph contains cycles If a rootId is given, the subgraph starting at the root id is sorted See cycleDetected, cycleOrigin, cycleEnd
◆ d_ptr
ctkDependencyGraphPrivate* ctkDependencyGraph::d_ptr |
|
protected |
The documentation for this class was generated from the following file: