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

Public Types

using NodeType = N
 
using SubgraphType = SubgraphT<N>
 

Public Member Functions

 GraphT (const GraphT< N > &)=delete
 
GraphToperator= (const GraphT< N > &)=delete
 
 GraphT ()
 
 GraphT (GraphT< N > &&other)
 
GraphT< N > & operator= (GraphT &&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)
 
SubgraphT< N > & addSubgraph ()
 
size_t numSubgraphs () const
 
const SubgraphT< N > & subgraph (size_t index) const
 
SubgraphT< N > & subgraph (size_t index)
 
template<class F >
void forEachSubgraph (F &&func) const
 
template<class F >
void forEachSubgraph (F &&func)
 
template<class F >
void forEachNode (F &&func) const
 
template<class F >
void forEachNode (F &&func)
 
void clear ()
 
void clearSubgraphs ()
 

Friends

template<class T >
class SubgraphT
 

Detailed Description

template<class N>
class dispenso::GraphT< N >
Examples
graph_example.cpp.

Definition at line 527 of file graph.h.

Member Typedef Documentation

◆ NodeType

template<class N >
using dispenso::GraphT< N >::NodeType = N

Definition at line 529 of file graph.h.

◆ SubgraphType

template<class N >
using dispenso::GraphT< N >::SubgraphType = SubgraphT<N>

Definition at line 530 of file graph.h.

Constructor & Destructor Documentation

◆ GraphT() [1/2]

template<class N >
dispenso::GraphT< N >::GraphT ( )
inline

Create empty graph.

Definition at line 536 of file graph.h.

◆ GraphT() [2/2]

template<class N >
dispenso::GraphT< N >::GraphT ( GraphT< N > && other)

Move constructor

Definition at line 187 of file graph.cpp.

Member Function Documentation

◆ addNode()

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

Construct a NodeType with a valid functor. This node is created into subgraph 0. This is not concurrency safe.

Parameters
fA functor with signature void().
Examples
graph_example.cpp.

Definition at line 554 of file graph.h.

◆ addSubgraph()

template<class N >
SubgraphT< N > & dispenso::GraphT< N >::addSubgraph ( )

Create an empty subgraph. This is not concurrency safe.

Examples
graph_example.cpp.

Definition at line 203 of file graph.cpp.

◆ clear()

template<class N >
void dispenso::GraphT< N >::clear ( )
inline

Destroy all nodes and subgraphs. This is not concurrency safe.

Definition at line 657 of file graph.h.

◆ clearSubgraphs()

template<class N >
void dispenso::GraphT< N >::clearSubgraphs ( )
inline

Destroy all nodes. Keeps subgraphs. This is not concurrency safe.

Definition at line 664 of file graph.h.

◆ forEachNode() [1/2]

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

apply an func to each node in the graph. Concurrency safe.

Parameters
funca functor with signature void(const Node&)

Definition at line 647 of file graph.h.

◆ forEachNode() [2/2]

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

apply an func to each node in the graph including all nodes from all subgraphs. Concurrency safe.

Parameters
funca functor with signature void(const Node&)

Definition at line 634 of file graph.h.

◆ forEachSubgraph() [1/2]

template<class N >
template<class F >
void dispenso::GraphT< N >::forEachSubgraph ( F && func)
inline

apply an func to each subgraph in the graph. Concurrency safe.

Parameters
funca functor with signature void(SubgraphT<N>&)

Definition at line 622 of file graph.h.

◆ forEachSubgraph() [2/2]

template<class N >
template<class F >
void dispenso::GraphT< N >::forEachSubgraph ( F && func) const
inline

apply an func to each subgraph in the graph. Concurrency safe.

Parameters
funca functor with signature void(const SubgraphT<N>&)

Definition at line 611 of file graph.h.

◆ node() [1/2]

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

Return reference to node with index in subgraph 0. Concurrency safe.

Parameters
index- index of the node

Definition at line 576 of file graph.h.

◆ node() [2/2]

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

Return const reference to node with index in subgraph 0. Concurrency safe.

Parameters
index- index of the node

Definition at line 568 of file graph.h.

◆ numNodes()

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

Return number of nodes in subgraph 0. Concurrency safe.

Definition at line 560 of file graph.h.

◆ numSubgraphs()

template<class N >
size_t dispenso::GraphT< N >::numSubgraphs ( ) const
inline

Return number of subgraphs in the graph including subgraph 0. Concurrency safe.

Definition at line 586 of file graph.h.

◆ operator=()

template<class N >
GraphT< N > & dispenso::GraphT< N >::operator= ( GraphT< N > && other)
noexcept

Move assignment operator

Definition at line 194 of file graph.cpp.

◆ subgraph() [1/2]

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

Return reference to subgraph with index. Concurrency safe.

Parameters
index- index of the subgraph.

Definition at line 602 of file graph.h.

◆ subgraph() [2/2]

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

Return const reference to subgraph with index. Concurrency safe.

Parameters
index- index of the subgraph.

Definition at line 594 of file graph.h.

Friends And Related Symbol Documentation

◆ SubgraphT

template<class N >
template<class T >
friend class SubgraphT
friend

Definition at line 683 of file graph.h.


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