FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
Loading...
Searching...
No Matches
DivideBlock.cpp
Go to the documentation of this file.
1#include "DivideBlock.h"
2
4
6 int cx,
7 int cy,
11 : BaseBlock(cx,
12 cy,
13 DIVIDE_BLOCK_WIDTH,
14 DIVIDE_BLOCK_HEIGHT,
15 newBlockChoiceDelegate,
16 blockLifecycleManagerDelegate,
17 windowDelegate,
18 logger),
19 selfId(business_logic::stringifyAddressOf(this)) {}
20
25
26 const std::vector<business_logic::elements::structures::Port> DivideBlock::inputPorts = {
28 {.name = "denominator", .type = business_logic::elements::structures::Port::Type::INPUT},
29 };
30
31 const std::vector<business_logic::elements::structures::Port> DivideBlock::outputPorts = {
33 };
34
35} // namespace business_logic::elements::blocks
Delegate that is notified when a new block is chosen to be added to the canvas.
The base class for all blocks, containing common functionality and members.
Definition BaseBlock.h:36
const FloatingPoint & getPortValue(const structures::Port *port) const
Gets the value of the port.
std::unordered_map< const structures::Port *, FloatingPoint > portValues
The registry of port values.
Definition BaseBlock.h:290
static const std::vector< business_logic::elements::structures::Port > inputPorts
Definition DivideBlock.h:49
DivideBlock(int cx, int cy, business_logic::delegate::INewBlockChoiceDelegate *newBlockChoiceDelegate, business_logic::delegate::IBlockLifecycleManagerDelegate *blockLifecycleManagerDelegate, business_logic::delegate::IWindowDelegate *windowDelegate)
static const std::vector< business_logic::elements::structures::Port > outputPorts
Definition DivideBlock.h:50
void calculateOutputValues() override
Calculates the output port values based on input port values.
The base classes and structs for elements.
The business logic module.
std::string stringifyAddressOf(const T *value)
Convert a pointer to a string in format "0x..." containing its hexadecimal address.
Definition misc.h:16