HTGS  v2.0
The Hybrid Task Graph Scheduler
htgs::ExecutionPipelineBroadcastRule< T > Class Template Reference

the default execution pipeline rule that is used if no other rule is specified for an execution pipeline. More...

#include <htgs/core/rules/ExecutionPipelineBroadcastRule.hpp>

Inheritance diagram for htgs::ExecutionPipelineBroadcastRule< T >:
Inheritance graph
Collaboration diagram for htgs::ExecutionPipelineBroadcastRule< T >:
Collaboration graph

Public Member Functions

bool canTerminateRule (size_t pipelineId) override
 Virtual function to determine if a rule is ready to be terminated. More...
 
void shutdownRule (size_t pipelineId) override
 Virtual function that handles when a rule is being shutdown for a particular pipelineId. More...
 
std::string getName () override
 Virtual function to get the name of the IRule. More...
 
void applyRule (std::shared_ptr< T > data, size_t pipelineId) override
 Pure virtual function to process input data. More...
 
- Public Member Functions inherited from htgs::IRule< T, T >
 IRule ()
 Creates an IRule.
 
 IRule (bool useLocks)
 Creates an IRule with locks specified. More...
 
virtual ~IRule () override
 Destructor.
 
std::list< std::shared_ptr< T > > * applyRuleFunction (std::shared_ptr< T > data, size_t pipelineId)
 Applies the virtual rule function and processes output. More...
 
void addResult (std::shared_ptr< T > result)
 Adds a result value to the output. More...
 
void addResult (T *result)
 Adds a result value to the output. More...
 
StateContainer< std::shared_ptr< T > > * allocStateContainer (size_t height, size_t width)
 Allocates a two dimensional state container using the input type of the IRule. More...
 
StateContainer< V > * allocStateContainer (size_t height, size_t width, V defaultValue)
 Allocates a two dimensional state container using the template argument. More...
 
StateContainer< std::shared_ptr< T > > * allocStateContainer (size_t size)
 Allocates a one dimensional state container using the input type of the IRule. More...
 
StateContainer< V > * allocStateContainer (size_t size, V defaultValue)
 Allocates a one dimensional state container using the input type of the IRule. More...
 
- Public Member Functions inherited from htgs::AnyIRule
 AnyIRule ()
 Creates an AnyIRule with locks enabled.
 
 AnyIRule (bool useLocks)
 Creates an AnyIRule with locks specified. More...
 
virtual ~AnyIRule ()
 Destructor.
 
std::mutex & getMutex ()
 Gets the mutex associated with this IRule. More...
 
bool canUseLocks () const
 Gets whether the rule should use locks or not. More...
 

Detailed Description

template<class T>
class htgs::ExecutionPipelineBroadcastRule< T >

the default execution pipeline rule that is used if no other rule is specified for an execution pipeline.

When constructing an ExecutionPipeline task, rules must be added to the task to indicate how data is distributed within pipelines. If no rule is specified, then this rule is added automatically during initialization of the task.

Template Parameters
Tthe input/output type for the rule, must be of type IData.

Member Function Documentation

◆ applyRule()

template<class T >
void htgs::ExecutionPipelineBroadcastRule< T >::applyRule ( std::shared_ptr< T >  data,
size_t  pipelineId 
)
inlineoverridevirtual

Pure virtual function to process input data.

Use the addResult function to add values to the output edge.

Parameters
datathe input data
pipelineIdthe pipelineId
Note
To send data to the next edge use addResult

Implements htgs::IRule< T, T >.

◆ canTerminateRule()

template<class T >
bool htgs::ExecutionPipelineBroadcastRule< T >::canTerminateRule ( size_t  pipelineId)
inlineoverridevirtual

Virtual function to determine if a rule is ready to be terminated.

If there is no more data entering the RuleManager that is managing this IRule, then the rule will be automatically terminated.

Parameters
pipelineIdthe pipelineId associated with this rule
Returns
whether the rule should be terminated or not
Return values
TRUEif the rule should be terminated
FALSEif the rule should not be terminated
Note
The rule will automatically be terminated if the input ITask has terminated.
By default, this function returns false

Reimplemented from htgs::IRule< T, T >.

◆ getName()

template<class T >
std::string htgs::ExecutionPipelineBroadcastRule< T >::getName ( )
inlineoverridevirtual

Virtual function to get the name of the IRule.

Returns
the name of the IRule

Reimplemented from htgs::IRule< T, T >.

◆ shutdownRule()

template<class T >
void htgs::ExecutionPipelineBroadcastRule< T >::shutdownRule ( size_t  pipelineId)
inlineoverridevirtual

Virtual function that handles when a rule is being shutdown for a particular pipelineId.

Parameters
pipelineIdthe pipelineId to shutdown
Note
This function can be used to release memory, but if there are multiple pipelines managed by an ExecutionPipeline, then the memory release should occur in a destructor.

Reimplemented from htgs::IRule< T, T >.


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