/
pi_coder
/
ByteMachine
Обзор
Документация
Войти
/
pi_coder
/
ByteMachine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/nodes/base_pin.h
58 строк
2 KB
pimenov-and
Перенос функциональности из старого проекта, в основном это описания узлов
19 июл 2026, 20:13
19 июл 2026, 20:13
cb3c51b
Код
Авторство
О чём код?
//////////////////////////////////////////////////////////////// // ByteMachine // Базовый класс пина //////////////////////////////////////////////////////////////// #ifndef BASE_PIN_H #define BASE_PIN_H //============================================================== #include <QObject> #include <QSharedPointer> #include "i_data.h" #include "i_xml.h" #include "i_to_str.h" //============================================================== class BaseNode; //============================================================== // Базовый класс пина //============================================================== class BasePin : public QObject, public IData, public IXml, public IToStr { Q_OBJECT public: // Конструктор с параметрами BasePin(BaseNode *parentNode, qint32 index); // Получение признака подключения [[nodiscard]] virtual bool isConnected() const = 0; // Получение области пина [[nodiscard]] virtual QRect rect() const = 0; // Получение родительского узла [[nodiscard]] BaseNode* parentNode() const { return parentNode_; } // Индекс пина в узле [[nodiscard]] qint32 index() const { return index_; } // Получение ширины [[nodiscard]] static qint32 width() { return 20; } // Получение высоты [[nodiscard]] static qint32 height() { return 10; } private: // Родительский узел BaseNode *parentNode_{nullptr}; // Индекс пина в узле qint32 index_{0}; }; //============================================================== using ShPtrBasePin = QSharedPointer<BasePin>; using ShPtrConstBasePin = QSharedPointer<const BasePin>; //============================================================== #endif // BASE_PIN_H