source: pacpusframework/branches/2.0-beta1/include/Pacpus/kernel/inputOutputBase.h@ 95

Last change on this file since 95 was 95, checked in by morasjul, 11 years ago

Pacpus 2.0 beta fix : windows exports and remove miss-placed inc file

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#ifndef IN_OUT_BASE_H
2#define IN_OUT_BASE_H
3
4#include <Pacpus/kernel/pacpus.h>
5#include <Pacpus/kernel/ConnectionBase.h>
6
7#include <typeinfo>
8#include <QEvent>
9#include <QList>
10#include <QStringList>
11
12namespace pacpus {
13
14class ComponentBase;
15
16class PACPUSLIB_API AbstractInterface : public QObject
17{
18 Q_OBJECT
19protected:
20 AbstractInterface(QString name, ComponentBase * component, QObject * parent = 0):_name(name),_component(component),QObject(parent) {}
21 ~AbstractInterface(){}
22public:
23 QString getSignature();
24 QString getName() {return _name;}
25 virtual QString getDataType() = 0;
26 //ComponentBase * getComponent() {return _component;}
27
28protected:
29 QString _name;
30 ComponentBase * _component;
31};
32
33class PACPUSLIB_API InputInterfaceBase : public AbstractInterface
34{
35 Q_OBJECT
36public:
37 InputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0):AbstractInterface(name,component,parent) {}
38 virtual ~InputInterfaceBase(){}
39
40 virtual void customEvent(QEvent* e) = 0;
41
42};
43
44class PACPUSLIB_API OutputInterfaceBase: public AbstractInterface
45{
46 Q_OBJECT
47public:
48 OutputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0):AbstractInterface(name,component,parent) {}
49 virtual ~OutputInterfaceBase(){}
50
51 void addConnection(ConnectionBase connection) { _connection.append(connection);}
52 bool removeConnection(ConnectionBase connection) { return _connection.removeOne(connection);}
53
54 QStringList getInputConnectedList() {
55 QStringList list;
56 for(QList<ConnectionBase>::iterator it = _connection.begin(); it!=_connection.end(); ++it)
57 list.append(it->getInputInterface()->getName());
58 return list;
59 }
60
61protected:
62 QList<ConnectionBase> _connection;
63
64};
65
66} // namespace pacpus
67
68#endif // IN_OUT_BASE_H
Note: See TracBrowser for help on using the repository browser.