|
FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
|
The blocks calculator logic, computes the flowing values. More...
#include <BlocksCalculator.h>
Inheritance diagram for business_logic::calculations::BlocksCalculator:
Collaboration diagram for business_logic::calculations::BlocksCalculator:Public Member Functions | |
| BlocksCalculator (business_logic::calculations::delegate::IBlocksRegistryDelegate *blocksRegistryDelegate) | |
| virtual | ~BlocksCalculator () noexcept=default |
| BlocksCalculator (const BlocksCalculator &)=delete | |
| BlocksCalculator & | operator= (const BlocksCalculator &)=delete |
| BlocksCalculator (BlocksCalculator &&)=delete | |
| BlocksCalculator & | operator= (BlocksCalculator &&)=delete |
| void | calculateValuesFlow () |
| Calculates the values flowing through the graph. | |
Public Member Functions inherited from business_logic::Loggable< BlocksCalculator > | |
| Loggable () | |
Protected Member Functions | |
| void | calculateBlockValues (business_logic::elements::blocks::BaseBlock *block) |
| Calculates the values of the dependencies of a block and then the block itself. | |
| std::optional< std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > > | hasCycle (elements::structures::BlocksConnectionSide side) |
| Checks if there is a cycle in the graph. | |
Protected Attributes | |
| std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > | visited |
| The set of visited blocks to detect cycles. | |
| std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > | recursionStack |
| The stack of recursion to detect cycles. | |
| std::unordered_set< business_logic::elements::blocks::BaseBlock * > | calcVisited |
| The set of visited blocks to note which blocks have been visited when calculating their values. | |
| business_logic::calculations::delegate::IBlocksRegistryDelegate * | blocksRegistryDelegate |
| The delegate that provides the connections registry. | |
Protected Attributes inherited from business_logic::Loggable< BlocksCalculator > | |
| std::shared_ptr< spdlog::logger > | logger |
The blocks calculator logic, computes the flowing values.
Definition at line 20 of file BlocksCalculator.h.
|
explicit |
Definition at line 4 of file BlocksCalculator.cpp.
|
virtualdefaultnoexcept |
|
delete |
|
delete |
|
protected |
Calculates the values of the dependencies of a block and then the block itself.
Definition at line 30 of file BlocksCalculator.cpp.
References blocksRegistryDelegate, calculateBlockValues(), business_logic::elements::blocks::BaseBlock::calculateOutputValues(), calcVisited, business_logic::calculations::delegate::IBlocksRegistryDelegate::getConnectionsRegistry(), and business_logic::elements::blocks::BaseBlock::setPortValue().
Referenced by calculateBlockValues(), and calculateValuesFlow().
Here is the call graph for this function:
Here is the caller graph for this function:| void business_logic::calculations::BlocksCalculator::calculateValuesFlow | ( | ) |
Calculates the values flowing through the graph.
| `business_logic::errors::GraphCycleException` | if a cycle is detected |
Definition at line 8 of file BlocksCalculator.cpp.
References blocksRegistryDelegate, calculateBlockValues(), calcVisited, business_logic::calculations::delegate::IBlocksRegistryDelegate::getBlocks(), hasCycle(), recursionStack, and visited.
Referenced by gui::elements::SkiaBlocksManagerRenderer::render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Checks if there is a cycle in the graph.
| side | The side to check for cycles |
Definition at line 59 of file BlocksCalculator.cpp.
References business_logic::elements::structures::BlocksConnectionSide::block, blocksRegistryDelegate, business_logic::calculations::delegate::IBlocksRegistryDelegate::getConnectionsRegistry(), hasCycle(), recursionStack, and visited.
Referenced by calculateValuesFlow(), and hasCycle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
delete |
|
delete |
|
protected |
The delegate that provides the connections registry.
Definition at line 81 of file BlocksCalculator.h.
Referenced by calculateBlockValues(), calculateValuesFlow(), and hasCycle().
|
protected |
The set of visited blocks to note which blocks have been visited when calculating their values.
Definition at line 67 of file BlocksCalculator.h.
Referenced by calculateBlockValues(), and calculateValuesFlow().
|
protected |
The stack of recursion to detect cycles.
Definition at line 61 of file BlocksCalculator.h.
Referenced by calculateValuesFlow(), and hasCycle().
|
protected |
The set of visited blocks to detect cycles.
Definition at line 55 of file BlocksCalculator.h.
Referenced by calculateValuesFlow(), and hasCycle().