1#ifndef BLOCKS_CALCULATOR_H
2#define BLOCKS_CALCULATOR_H
5#include <unordered_set>
76 hasCycle(elements::structures::BlocksConnectionSide side);
Class that provides a logger for the given class; automatically deduces the logger.
std::shared_ptr< spdlog::logger > logger
The blocks calculator logic, computes the flowing values.
void calculateValuesFlow()
Calculates the values flowing through the graph.
business_logic::calculations::delegate::IBlocksRegistryDelegate * blocksRegistryDelegate
The delegate that provides the connections registry.
std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > recursionStack
The stack of recursion to detect cycles.
virtual ~BlocksCalculator() noexcept=default
std::optional< std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > > hasCycle(elements::structures::BlocksConnectionSide side)
Checks if there is a cycle in the graph.
std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > visited
The set of visited blocks to detect cycles.
void calculateBlockValues(business_logic::elements::blocks::BaseBlock *block)
Calculates the values of the dependencies of a block and then the block itself.
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.
The delegate for the blocks registry, allowing to get connections and blocks.
Utilities regarding calculation of values for the calculator itself.
The business logic module.