schema_editor/comdel/domain/pin.h

68 lines
1.2 KiB
C
Raw Normal View History

2022-03-31 21:20:41 +00:00
#ifndef DOMAIN_PIN_H
#define DOMAIN_PIN_H
#include "display.h"
2022-04-09 12:10:40 +00:00
#include "value.h"
2022-03-31 21:20:41 +00:00
#include <string>
namespace domain {
2022-05-27 06:18:17 +00:00
class PinConnection {
public:
enum ConnectionType {
REQUIRED,
OPTIONAL
};
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
private:
std::string message;
ConnectionType type;
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
public:
PinConnection(std::string message, ConnectionType type);
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
ConnectionType getType();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
std::string getMessage();
2022-03-31 21:20:41 +00:00
};
2022-05-27 06:18:17 +00:00
class Pin {
public:
enum PinType {
IN_OUT,
IN,
OUT
};
private:
std::string name;
PinType type;
std::string tooltip;
PinConnection connection;
domain::ui::Pin displayPin;
std::optional<std::vector<Value>> wires;
public:
Pin(std::string name, PinType type, std::string tooltip, PinConnection connection, domain::ui::Pin pin,
std::optional<std::vector<Value>> wires);
std::string &getName();
PinType getType();
std::string getTooltip();
ui::Pin &getDisplayPin();
PinConnection &getConnection();
std::optional<std::vector<Value>> &getWires();
};
2022-03-31 21:20:41 +00:00
} // namespace domain
#endif // DOMAIN_PIN_H