Base class for an htgs::IRule.
More...
#include <htgs/core/rules/AnyIRule.hpp>
|
std::mutex | mutex |
| The mutex associated with this IRule to ensure no more than one thread is processing the rule at a time.
|
|
bool | useLocks |
| Will enable using the mutex to lock the rule to ensure this rule is only accessed by a thread at a time.
|
|
Base class for an htgs::IRule.
◆ AnyIRule()
htgs::AnyIRule::AnyIRule |
( |
bool |
useLocks | ) |
|
|
inline |
Creates an AnyIRule with locks specified.
- Parameters
-
useLocks | whether to use locks on the rule or not to ensure one thread accesses the rule at a time |
◆ canTerminateRule()
virtual bool htgs::AnyIRule::canTerminateRule |
( |
size_t |
pipelineId | ) |
|
|
pure virtual |
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
-
pipelineId | the pipelineId associated with this rule |
- Returns
- whether the rule should be terminated or not
- Return values
-
TRUE | if the rule should be terminated |
FALSE | if the rule should not be terminated |
- Note
- The rule will automatically be terminated if the input ITask has terminated.
Implemented in htgs::IRule< T, U >, htgs::IRule< T, T >, and htgs::ExecutionPipelineBroadcastRule< T >.
◆ canUseLocks()
bool htgs::AnyIRule::canUseLocks |
( |
| ) |
const |
|
inline |
Gets whether the rule should use locks or not.
- Returns
- TRUE if locks should be used, otherwise false
- Return values
-
TRUE | the lock will be used to ensure mutual exclusion when accessing this rule across multiple threads |
FALSE | the lock will not be used, and any thread may access the rule asynchronously |
◆ getMutex()
std::mutex& htgs::AnyIRule::getMutex |
( |
| ) |
|
|
inline |
Gets the mutex associated with this IRule.
- Returns
- the mutex
- Note
- This function should only be called by the HTGS API
◆ getName()
virtual std::string htgs::AnyIRule::getName |
( |
| ) |
|
|
pure virtual |
◆ shutdownRule()
virtual void htgs::AnyIRule::shutdownRule |
( |
size_t |
pipelineId | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: