schema_editor/comdel/domain/pin.h

64 lines
1.1 KiB
C
Raw Permalink 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 {
class PinConnection
{
public:
enum ConnectionType {
REQUIRED,
OPTIONAL
2022-03-31 21:20:41 +00:00
};
private:
std::string message;
ConnectionType type;
public:
PinConnection(std::string message, ConnectionType type);
ConnectionType getType();
std::string getMessage();
};
class Pin
{
public:
enum PinType {
IN_OUT,
IN,
OUT
};
private:
std::string name;
PinType type;
std::string tooltip;
PinConnection connection;
Display display;
2022-04-09 12:10:40 +00:00
std::optional<std::vector<Value>> wires;
2022-03-31 21:20:41 +00:00
public:
2022-04-09 12:10:40 +00:00
Pin(std::string name, PinType type, std::string tooltip, PinConnection connection, Display display, std::optional<std::vector<Value>> wires);
2022-03-31 21:20:41 +00:00
std::string &getName();
2022-03-31 21:20:41 +00:00
PinType getType();
std::string getTooltip();
Display &getDisplay();
PinConnection &getConnection();
2022-04-09 12:10:40 +00:00
std::optional<std::vector<Value>> &getWires();
2022-03-31 21:20:41 +00:00
};
} // namespace domain
#endif // DOMAIN_PIN_H