dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
dispenso::SubgraphT< N > Class Template Reference

#include <graph.h>

Public Member Functions

 SubgraphT (const SubgraphT< N > &)=delete
 
 SubgraphT (SubgraphT< N > &&other) noexcept
 
template<class T >
N & addNode (T &&f)
 
size_t numNodes () const
 
const N & node (size_t index) const
 
N & node (size_t index)
 
template<class F >
void forEachNode (F &&func) const
 
template<class F >
void forEachNode (F &&func)
 
void clear ()
 

Friends

template<class T >
class GraphT
 

Detailed Description

template<class N>
class dispenso::SubgraphT< N >

A subgraph within a Graph, containing a collection of nodes that can be executed together.

Template Parameters
NThe node type (Node or BiPropNode).
Examples
graph_example.cpp.

Definition at line 426 of file graph.h.

Constructor & Destructor Documentation

◆ SubgraphT()

template<class N >
dispenso::SubgraphT< N >::SubgraphT ( SubgraphT< N > && other)
inlinenoexcept

Move constructor.

Definition at line 433 of file graph.h.

Member Function Documentation

◆ addNode()

template<class N >
template<class T >
N & dispenso::SubgraphT< N >::addNode ( T && f)
inline

Construct a NodeType with a valid functor. This is not concurrency safe.

Parameters
fA functor with signature void().
Returns
reference to the created node.
Examples
graph_example.cpp.

Definition at line 446 of file graph.h.

◆ clear()

template<class N >
void dispenso::SubgraphT< N >::clear ( )

Removes all dependency between nodes of this subgraph and other nodes, destroy this subgraph nodes. This is not concurrency safe.

◆ forEachNode() [1/2]

template<class N >
template<class F >
void dispenso::SubgraphT< N >::forEachNode ( F && func)
inline

apply an func to each node of the subgraph. This is not concurrency safe. This methods should never be called concurrent to when the graph execution is happening

Parameters
funca functor with signature void(Node&)

Definition at line 490 of file graph.h.

◆ forEachNode() [2/2]

template<class N >
template<class F >
void dispenso::SubgraphT< N >::forEachNode ( F && func) const
inline

apply an func to each node of the subgraph. Concurrency safe.

Parameters
funca functor with signature void(const Node&)

Definition at line 478 of file graph.h.

◆ node() [1/2]

template<class N >
N & dispenso::SubgraphT< N >::node ( size_t index)
inline

Return reference to node with index. Concurrency safe.

Parameters
index- index of the node

Definition at line 469 of file graph.h.

◆ node() [2/2]

template<class N >
const N & dispenso::SubgraphT< N >::node ( size_t index) const
inline

Return const reference to node with index. Concurrency safe.

Parameters
index- index of the node

Definition at line 461 of file graph.h.

◆ numNodes()

template<class N >
size_t dispenso::SubgraphT< N >::numNodes ( ) const
inline

Return number of nodes in subgraph. Concurrency safe.

Definition at line 453 of file graph.h.

Friends And Related Symbol Documentation

◆ GraphT

template<class N >
template<class T >
friend class GraphT
friend

Definition at line 535 of file graph.h.


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