COVISE Core
WSPort.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef WSPORT_H
9#define WSPORT_H
10
11#include <QObject>
12#include <QString>
13#include <QStringList>
14
15#include "WSCoviseStub.h"
16#include "WSExport.h"
17
18namespace covise
19{
20
21class WSLink;
22class WSModule;
23
24class WSLIBEXPORT WSPort : public QObject
25{
26
27 Q_OBJECT
28
29 Q_ENUMS(PortType)
30 Q_PROPERTY(QString name READ getName)
31 Q_PROPERTY(QString id READ getID)
32 Q_PROPERTY(QStringList types READ getTypes)
33 Q_PROPERTY(PortType portType READ getPortType)
34
35public:
37 {
40 Dependent
41 };
42
43 WSPort(const covise::WSModule *module, const QString &name, const QStringList &acceptedTypes, PortType portType);
44 WSPort(const covise::WSModule *module, const covise::covise__Port &port);
45 virtual ~WSPort();
46
47public slots:
48
52 const QString &getName() const
53 {
54 return this->portName;
55 }
56
60 const QStringList &getTypes() const
61 {
62 return this->dataTypes;
63 }
64
69 {
70 return this->portType;
71 }
72
77 {
78 return this->module;
79 }
80
81 // void addLink(covise::WSLink * link);
82 // void removeLink(covise::WSLink * link);
83
87 const QString &getID() const
88 {
89 return this->id;
90 }
91
92 // signals:
93 // void linkAdded(covise::WSLink*);
94 // void linkRemoved(covise::WSLink*);
95
96public:
101 void setName(const QString &inName)
102 {
103 portName = inName;
104 }
105
110 void setTypes(const QStringList &types)
111 {
112 this->dataTypes = types;
113 }
114
119 void setPortType(PortType inPortType)
120 {
121 this->portType = inPortType;
122 }
123
124 virtual covise::covise__Port getSerialisable() const;
125
126 void setFromSerialisable(const covise::WSModule *module, const covise::covise__Port &serialisable);
127
128private:
129 // Name of the port
130 QString portName;
131 // Data types accepted or created by the port
132 QStringList dataTypes;
133 // Type of the port (default, optional, dependent)
134 PortType portType;
135
137
138 QString id;
139
140 //QList<covise::WSLink*> links;
141};
142}
143
144#endif // WSPORT_H
#define WSLIBEXPORT
Definition: coExport.h:385
GLsizei GLenum GLenum * types
Definition: khronos-glext.h:8471
GLuint const GLchar * name
Definition: khronos-glext.h:6722
GLenum GLuint id
Definition: khronos-glext.h:6279
list of all chemical elements
Definition: coConfig.h:27
Definition: WSModule.h:24
Definition: WSPort.h:25
void setName(const QString &inName)
Definition: WSPort.h:101
const covise::WSModule * module
Definition: WSPort.h:136
const QString & getID() const
Definition: WSPort.h:87
QStringList dataTypes
Definition: WSPort.h:132
PortType getPortType() const
Definition: WSPort.h:68
const covise::WSModule * getModule() const
Definition: WSPort.h:76
void setPortType(PortType inPortType)
Definition: WSPort.h:119
void setTypes(const QStringList &types)
Definition: WSPort.h:110
const QStringList & getTypes() const
Definition: WSPort.h:60
PortType
Definition: WSPort.h:37
@ Optional
Definition: WSPort.h:39
@ Default
Definition: WSPort.h:38
QString portName
Definition: WSPort.h:130
WSPort(const covise::WSModule *module, const covise::covise__Port &port)
const QString & getName() const
Definition: WSPort.h:52