dispenso
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 >
NaddNode (T &&f)
 
size_t numNodes () const
 
const Nnode (size_t index) const
 
Nnode (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 >

Definition at line 521 of file graph.h.

Member Typedef Documentation

◆ NodeType

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

Definition at line 523 of file graph.h.

◆ SubgraphType

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

Definition at line 524 of file graph.h.

Constructor & Destructor Documentation

◆ GraphT() [1/2]

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

Create empty graph.

Definition at line 530 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().

Definition at line 548 of file graph.h.

◆ addSubgraph()

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

Create an empty subgraph. This is not concurrency safe.

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 651 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 658 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 641 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 628 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 616 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 605 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 570 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 562 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 554 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 580 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 596 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 588 of file graph.h.

Friends And Related Symbol Documentation

◆ SubgraphT

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

Definition at line 677 of file graph.h.


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