schema_editor/comdel/domain/component.h

76 lines
1.5 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;
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:
Component(string name, string tooltip, string source, ComponentType type,
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-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