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

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

Fixed: unnecessary QThread dependency.

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