schema_editor/comdel/domain/component.h

79 lines
1.7 KiB
C
Raw Normal View History

2022-03-31 21:20:41 +00:00
#ifndef DOMAIN_COMPONENT_H
#define DOMAIN_COMPONENT_H
#include "pin.h"
#include "rule.h"
#include "display.h"
#include "attribute.h"
#include <string>
#include <vector>
namespace domain {
2022-05-27 06:18:17 +00:00
using namespace std;
class Component {
public:
enum ComponentType {
OTHER,
PROCESSOR,
MEMORY
};
private:
std::string name;
2022-06-14 19:27:40 +00:00
std::optional<std::string> displayName;
2022-05-27 06:18:17 +00:00
std::string tooltip;
std::string source;
ComponentType type;
std::vector<Rule> rules;
std::string instanceName;
std::pair<int, int> count;
Display display;
std::vector<Pin> pins;
std::vector<Attribute> attributes;
public:
2022-06-14 19:27:40 +00:00
Component(string name, optional<string> displayName, string tooltip, string source, ComponentType type,
2022-05-27 06:18:17 +00:00
vector<Rule> rules, string instanceName, pair<int, int> count, Display display,
vector<Pin> pins, vector<Attribute> attributes);
std::string getName();
2022-03-31 21:20:41 +00:00
2022-06-14 19:27:40 +00:00
std::string getDisplayName();
2022-05-27 06:18:17 +00:00
std::string getTooltip();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
std::string getSource();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
ComponentType getType();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
std::vector<Rule> getRules();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
std::string getInstanceName();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
std::pair<int, int> getCount();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
Display getDisplay();
2022-04-05 21:48:07 +00:00
2022-05-27 06:18:17 +00:00
std::vector<Pin> getPins();
2022-03-31 21:20:41 +00:00
2022-05-27 06:18:17 +00:00
Pin getPin(std::string pin);
std::vector<Attribute>& getAttributes();
2022-05-27 06:18:17 +00:00
Attribute getAttribute(std::string attribute);
bool hasAttribute(std::string name, Value::ValueType type);
bool hasPin(std::string name);
};
2022-03-31 21:20:41 +00:00
} // namespace domain
#endif // DOMAIN_COMPONENT_H