dispenso 1.5.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
 
void reserve (size_t n)
 
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).

Definition at line 444 of file graph.h.

Constructor & Destructor Documentation

◆ SubgraphT()

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

Move constructor.

Definition at line 451 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.

Definition at line 464 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 519 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 507 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 498 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 490 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 471 of file graph.h.

◆ reserve()

template<class N >
void dispenso::SubgraphT< N >::reserve ( size_t n)
inline

Reserve capacity for the specified number of nodes. This can improve performance when the number of nodes is known in advance by avoiding vector reallocations during addNode calls. This is not concurrency safe.

Parameters
n- number of nodes to reserve capacity for

Definition at line 482 of file graph.h.

Friends And Related Symbol Documentation

◆ GraphT

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

Definition at line 564 of file graph.h.


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