source: pacpusframework/trunk/include/Pacpus/kernel/InputOutputBase.h@ 185

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

Fixed: dependencies.

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#ifndef IN_OUT_BASE_H
2#define IN_OUT_BASE_H
3
4#include <Pacpus/kernel/ConnectionBase.h>
5#include <Pacpus/kernel/Log.h>
6#include <Pacpus/kernel/pacpus.h>
7#include <Pacpus/kernel/PacpusEvent.h>
8
9#include <QApplication>
10#include <QList>
11#include <QString>
12#include <QStringList>
13#include <typeinfo>
14
15namespace pacpus {
16
17class ComponentBase;
18
19class PACPUSLIB_API AbstractInterface
20 : public QObject
21{
22 Q_OBJECT
23
24protected:
25 AbstractInterface(QString name, ComponentBase * component, QObject * parent = 0);
26 virtual ~AbstractInterface();
27
28public:
29 QString getSignature() const;
30 QString getName() const;
31 virtual QString getDataType() = 0;
32
33 void addConnection(ConnectionBase connection);
34 bool removeConnection(ConnectionBase connection);
35 bool hasConnection();
36
37protected:
38 QList<ConnectionBase> & connections();
39 const QList<ConnectionBase> & getConnections() const;
40
41 ComponentBase * component();
42 const ComponentBase * getComponent() const;
43
44private:
45 QString m_name;
46 ComponentBase * m_component;
47 QList<ConnectionBase> m_connections;
48};
49
50class PACPUSLIB_API InputInterfaceBase
51 : public AbstractInterface
52{
53 Q_OBJECT
54
55protected:
56 // TODO: add ctor with function pointer
57 InputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0);
58
59public:
60 enum ReadingMode {
61 NeverSkip,
62 TimeBounded,
63 GetLast
64 };
65
66 virtual ~InputInterfaceBase();
67
68 virtual void customEvent(QEvent * e);
69
70 ReadingMode & readingMode();
71 const ReadingMode & getReadingMode() const;
72 void setReadingMode(ReadingMode mode);
73
74 virtual PacpusEvent * getEventTemplate();
75
76private:
77 ReadingMode m_readingMode;
78
79 // metode(QByteArray)
80 //QQueue jobQueue_;
81};
82
83class PACPUSLIB_API OutputInterfaceBase
84 : public AbstractInterface
85{
86 Q_OBJECT
87
88public:
89 OutputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0)
90 : AbstractInterface(name, component, parent)
91 {}
92
93 virtual ~OutputInterfaceBase()
94 {}
95
96 QStringList getInputConnectedList();
97
98 void send(/*const*/ QByteArray & data);
99};
100
101} // namespace pacpus
102
103#endif // IN_OUT_BASE_H
Note: See TracBrowser for help on using the repository browser.