FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
Loading...
Searching...
No Matches
GraphCycleException.h
Go to the documentation of this file.
1#ifndef BUSINESS_LOGIC_LOGIC_ERRORS_GRAPH_CYCLE_EXCEPTION_H
2#define BUSINESS_LOGIC_LOGIC_ERRORS_GRAPH_CYCLE_EXCEPTION_H
3
4#include <stdexcept>
5#include <unordered_set>
6
8
16 class GraphCycleException : public std::runtime_error {
17 public:
19 const std::unordered_set<business_logic::elements::structures::BlocksConnectionSide>&
21 : std::runtime_error("Graph cycle detected"), cyclePath(cyclePath) {}
22
23 ~GraphCycleException() noexcept override = default;
24
25 // disable copy semantics
27 GraphCycleException& operator=(const GraphCycleException&) = delete;
28
29 // disable move semantics
32
37 const std::unordered_set<business_logic::elements::structures::BlocksConnectionSide>&
38 getCyclePath() const {
39 return cyclePath;
40 }
41
42 private:
43 std::unordered_set<business_logic::elements::structures::BlocksConnectionSide> cyclePath;
44 };
45} // namespace business_logic::errors
46
47#endif // BUSINESS_LOGIC_LOGIC_ERRORS_GRAPH_CYCLE_EXCEPTION_H
Exception thrown when a graph cycle is detected.
std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > cyclePath
const std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > & getCyclePath() const
Gets the cycle path.
~GraphCycleException() noexcept override=default
GraphCycleException(const std::unordered_set< business_logic::elements::structures::BlocksConnectionSide > &cyclePath)
Logic exception classes.
The business logic module.
STL namespace.