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

Last change on this file since 197 was 197, checked in by Marek Kurdej, 11 years ago

Fixed: using auto-generated PacpusLibConfig.h instead of pacpus.h.

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