HTGS  v2.0
The Hybrid Task Graph Scheduler
htgs::AnyRuleManager Class Referenceabstract

Connects a Bookkeeper to another ITask using one IRule. More...

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

Inheritance diagram for htgs::AnyRuleManager:
Inheritance graph
Collaboration diagram for htgs::AnyRuleManager:
Collaboration graph

Public Member Functions

virtual ~AnyRuleManager ()
 Destructor.
 
virtual void initialize (size_t pipelineId, size_t numPipelines, std::string address)=0
 Initializes the RuleManager. More...
 
virtual void shutdown ()=0
 Shuts down the RuleManager. More...
 
virtual bool isTerminated ()=0
 Checks whether the RuleManager is terminated or not. More...
 
virtual void setOutputConnector (std::shared_ptr< AnyConnector > connector)=0
 Sets the output connector that the RuleManager is attached to. More...
 
virtual AnyRuleManagercopy ()=0
 Creates a copy of the RuleManager. More...
 
virtual std::shared_ptr< AnyConnectorgetConnector ()=0
 Gets the output connector associated with the RuleManager. More...
 
virtual std::string getName (int flags=0)=0
 Gets the name of the RuleManager and the names of all IRules that it manages. More...
 
virtual void debug ()=0
 Provides debug output. More...
 
virtual void checkRuleTermination ()=0
 Checks the rule if termination can be done.
 

Detailed Description

Connects a Bookkeeper to another ITask using one IRule.

Removes the template parameters for the RuleManager

When data is forwarded to the RuleManager from the Bookkeeper, the data is passed to an IRule that is associated with the RuleManager. Each IRule is responsible for determining if/when data is ready to be sent to the ITask that the RuleManager is bound to.

The input and output types of each IRule added to a RuleManager must match the input and output types of the RuleManager.

Example Usage:

// DataRule implements IRule<Data1, Data2> to be compatible with ruleMan
DataRule *rule = new DataRule();
// The output task for the RuleManager with input type Data2
Data2ProcessingTask *data2Task = new Data2ProcessingTask();
// Creates edge between the Bookkeeper and the Data2ProcessingTask, where rule defines when data is sent
taskGraph->addRuleEdge(bkTask, rule, data2Task);
Template Parameters
Tthe input data type for the RuleManager, T must derive from IData.
Uthe output data type for the RuleManager, U must derive from IData.

Member Function Documentation

◆ copy()

virtual AnyRuleManager* htgs::AnyRuleManager::copy ( )
pure virtual

Creates a copy of the RuleManager.

The original and all copies share the same rule and access them synchronously.

Returns
the RuleManager copy
Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.

◆ debug()

virtual void htgs::AnyRuleManager::debug ( )
pure virtual

Provides debug output.

Note
#define DEBUG_FLAG to enable debugging

Implemented in htgs::RuleManager< T, U >.

◆ getConnector()

virtual std::shared_ptr<AnyConnector> htgs::AnyRuleManager::getConnector ( )
pure virtual

Gets the output connector associated with the RuleManager.

Returns
the output connector
Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.

◆ getName()

virtual std::string htgs::AnyRuleManager::getName ( int  flags = 0)
pure virtual

Gets the name of the RuleManager and the names of all IRules that it manages.

Returns
the name

Implemented in htgs::RuleManager< T, U >.

◆ initialize()

virtual void htgs::AnyRuleManager::initialize ( size_t  pipelineId,
size_t  numPipelines,
std::string  address 
)
pure virtual

Initializes the RuleManager.

Parameters
pipelineIdthe pipelineID
numPipelinesthe number of pipelines
addressthe address for the bookkeeper task
Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.

◆ isTerminated()

virtual bool htgs::AnyRuleManager::isTerminated ( )
pure virtual

Checks whether the RuleManager is terminated or not.

Returns
Whether the RuleManager is terminated or not
Return values
TRUEif the RuleManager is terminated
FALSEif the RuleManager is not terminated
Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.

◆ setOutputConnector()

virtual void htgs::AnyRuleManager::setOutputConnector ( std::shared_ptr< AnyConnector connector)
pure virtual

Sets the output connector that the RuleManager is attached to.

Parameters
connectorthe output connector
Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.

◆ shutdown()

virtual void htgs::AnyRuleManager::shutdown ( )
pure virtual

Shuts down the RuleManager.

Will also shutdown the rule associated with the RuleManager Only called if the bookkeeper associated with the RuleManager is shutting down (all rules managers are closed and input is no longer producing data)

Note
This function should only be called by the HTGS API

Implemented in htgs::RuleManager< T, U >.


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