-
Notifications
You must be signed in to change notification settings - Fork 2
/
Component.h
51 lines (38 loc) · 1.2 KB
/
Component.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef COMPONENT_H
#define COMPONENT_H
#include "ModelElement.h"
#include <QList>
namespace q2d {
namespace metamodel {
class ComponentDescriptor;
}
namespace model {
class Model;
class ComponentPort;
// TODO documentation
// TODO a component should observe its internal model to be informed of changes
class Component
: public InterfacingME {
private:
metamodel::ComponentDescriptor* m_descriptor;
Model* m_internalModel;
public:
Component(metamodel::ComponentDescriptor* descriptor,
DocumentEntry* relatedEntry,
Model* internalModel = nullptr);
/**
* @brief addPort is a public facade to the accessor providing type specialization
* @param port
*/
void addPort(ComponentPort* port);
QList<ComponentPort*>* inputPorts();
QList<ComponentPort*>* outputPorts();
QStringList configVariables() const override;
QStringList functions() const override;
metamodel::ComponentDescriptor* descriptor() const;
// TODO this is not really clever, query the descriptor from the schematics item instead
virtual QPoint portPosition(QString portLocalId) override;
};
} // namespace model
} // namespace q2d
#endif // COMPONENT_H