FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
Loading...
Searching...
No Matches
MultiplyBlock.h
Go to the documentation of this file.
1#ifndef BUSINESS_LOGIC_ELEMENTS_IMPL_MULTIPLY_BLOCK_H
2#define BUSINESS_LOGIC_ELEMENTS_IMPL_MULTIPLY_BLOCK_H
3
5#include "logging/Loggable.h"
6#include "typenames.h"
7#include "utils/misc.h"
8
13 class MultiplyBlock final : public business_logic::Loggable<MultiplyBlock>,
15 public:
17 int cx,
18 int cy,
22
23 std::string getSelfId() const override { return selfId; }
24
25 void calculateOutputValues() override;
26
27 protected:
29
30 std::string selfId;
31
32 static constexpr int MULTIPLY_BLOCK_WIDTH = 120;
33 static constexpr int MULTIPLY_BLOCK_HEIGHT = 120;
34
35 const std::vector<business_logic::elements::structures::Port>& getInputPorts()
36 const override {
37 return inputPorts;
38 }
39
40 const std::vector<business_logic::elements::structures::Port>& getOutputPorts()
41 const override {
42 return outputPorts;
43 }
44
48
49 static const std::vector<business_logic::elements::structures::Port> inputPorts;
50 static const std::vector<business_logic::elements::structures::Port> outputPorts;
51 };
52} // namespace business_logic::elements::blocks
53
54#endif // BUSINESS_LOGIC_ELEMENTS_IMPL_MULTIPLY_BLOCK_H
Class that provides a logger for the given class; automatically deduces the logger.
Definition Loggable.h:37
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
business_logic::delegate::IBlockLifecycleManagerDelegate * blockLifecycleManagerDelegate
Definition BaseBlock.h:301
std::shared_ptr< spdlog::logger > logger
Definition BaseBlock.h:285
business_logic::delegate::INewBlockChoiceDelegate * newBlockChoiceDelegate
Definition BaseBlock.h:295
business_logic::delegate::IWindowDelegate * windowDelegate
Definition BaseBlock.h:307
A block that multiplies two input values together and outputs their product.
static const std::vector< business_logic::elements::structures::Port > outputPorts
business_logic::elements::blocks::BlockType getBlockType() const override
Gets the type of the block.
const std::vector< business_logic::elements::structures::Port > & getOutputPorts() const override
Gets the output ports of the block.
void calculateOutputValues() override
Calculates the output port values based on input port values.
const std::vector< business_logic::elements::structures::Port > & getInputPorts() const override
Gets the input ports of the block.
static const std::vector< business_logic::elements::structures::Port > inputPorts
The base classes and structs for elements.
BlockType
The available block types.
Definition BlockType.h:10