HTGS  v2.0
The Hybrid Task Graph Scheduler
htgs::ProducerConsumerEdge< T, U, W > Class Template Reference

Implements the producer consumer edge that connects two tasks where one task is producing data and the other is consuming. More...

#include <htgs/core/graph/edge/ProducerConsumerEdge.hpp>

Inheritance diagram for htgs::ProducerConsumerEdge< T, U, W >:
Inheritance graph
Collaboration diagram for htgs::ProducerConsumerEdge< T, U, W >:
Collaboration graph

Public Member Functions

 ProducerConsumerEdge (ITask< T, U > *producer, ITask< U, W > *consumer)
 Constructs a producer consumer edge. More...
 
void applyEdge (AnyTaskGraphConf *graph) override
 Applies an edge to a task graph. More...
 
EdgeDescriptorcopy (AnyTaskGraphConf *graph) override
 Creates a copy of the edge descriptor to be added to other graphs, such as those within execution pipelines. More...
 
- Public Member Functions inherited from htgs::EdgeDescriptor
virtual ~EdgeDescriptor ()
 Destructor.
 

Private Attributes

ITask< T, U > * producer
 The producer ITask.
 
ITask< U, W > * consumer
 The consumer ITask.
 

Detailed Description

template<class T, class U, class W>
class htgs::ProducerConsumerEdge< T, U, W >

Implements the producer consumer edge that connects two tasks where one task is producing data and the other is consuming.

The edge is applied by getting the task managers for two ITasks and setting the output and input connectors for the producer and consumer tasks to be the same, respectively.

When the edge is copied the ITasks that represent the producer and consumer are retrieved from the task graph that will become the copied graph.

Template Parameters
Tthe input type of the producer task
Uthe output type of the producer task and the input type of the consumer task
Wthe output type of the consumer task

Constructor & Destructor Documentation

◆ ProducerConsumerEdge()

template<class T, class U, class W>
htgs::ProducerConsumerEdge< T, U, W >::ProducerConsumerEdge ( ITask< T, U > *  producer,
ITask< U, W > *  consumer 
)
inline

Constructs a producer consumer edge.

Parameters
producerthe task producing data
consumerthe task consuming the data from the producer task

Member Function Documentation

◆ applyEdge()

template<class T, class U, class W>
void htgs::ProducerConsumerEdge< T, U, W >::applyEdge ( AnyTaskGraphConf graph)
inlineoverridevirtual

Applies an edge to a task graph.

An edge is added to the supplied task graph. Each ITask is obtains a task manager that is to be used to manage the ITask. The graph has helper function AnyTaskGraphConf::getTaskManager. This is used to get the correct task manager that is to be used for a given ITask.

Parameters
graphthe task graph configuration that the edge is applied to.

Implements htgs::EdgeDescriptor.

◆ copy()

template<class T, class U, class W>
EdgeDescriptor* htgs::ProducerConsumerEdge< T, U, W >::copy ( AnyTaskGraphConf graph)
inlineoverridevirtual

Creates a copy of the edge descriptor to be added to other graphs, such as those within execution pipelines.

The edge descriptor typically has ITasks that are added to a TaskManager, which is then added to the task graph. The copy function is used to copy the ITasks and any other meta data that is needed for applying the edge. The implementation should use the AnyTaskGraphConf::getCopy function to get copies of the ITask.

Parameters
graphthe graph you are getting ITask copies from.
Returns
a new EdgeDescriptor to be used to apply edges to a future task graph configuration.

Implements htgs::EdgeDescriptor.


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