MeVisLab Toolbox Reference
mlConnectors.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_CONNECTORS_H
14#define ML_CONNECTORS_H
15
18
19// ML-includes
20#include "mlInitSystemML.h"
21#include "mlRuntimeSubClass.h"
22#include "mlPagedImage.h"
23
24// Namespace ML. It is recommended that all ML classes and modules reside in this
25// namespace to avoid collisions with types from other libraries.
26ML_START_NAMESPACE
27
29class Module;
30class InputConnector;
32
33//-------------------------------------------------------------------------
45//-------------------------------------------------------------------------
47{
48
49public:
50
53 OutputConnector(Module& module, MLint index);
54
57
59 Module& getModule() const;
60
62 MLint getIndex() const;
63
66
69
72
73private:
74
77
80 OutputConnector& operator=(const OutputConnector &);
81
83 void _addLink(InputConnector& link);
84
86 MLint _removeLink(InputConnector& link);
87
90 MLint _isLink(const InputConnector& link) const;
91
92
93 // --- Members:
94
96 Module *_module;
97
99 MLint _thisIndex;
100
102 PagedImage _pagedImg;
103
105 std::vector <InputConnector*> _inLinkList;
106
108 friend class InputConnector;
109};
110
111
112
113
114//-------------------------------------------------------------------------
116
123//-------------------------------------------------------------------------
125{
126
127public:
128
131 InputConnector(Module& module, MLint index);
132
136 InputConnector(Module& module, MLint index, OutputConnector& outputConnector);
137
140
143
146
149
152 void connect(OutputConnector& connector);
153
156
159 bool isValidConnection() const;
160
161private:
162 friend class OutputConnector;
163
166
169 InputConnector& operator=(const InputConnector &);
170
171
172 // --- Members:
173
175 Module *_module;
176
178 MLint _thisIndex;
179
181 OutputConnector *_outLink;
182};
183
184ML_END_NAMESPACE
185
186
187#endif
188
189
Module & getModule() const
Returns the Module to which this connector belongs to.
void disconnect()
Disconnects this connector from the OutputConnector bidirectionally if it exists.
OutputConnector * getConnector() const
Returns the connected OutputConnector. Could be NULL.
virtual ~InputConnector()
Destructor: Destroys this and its connection to the OutputConnector bidirectionally.
friend class OutputConnector
bool isValidConnection() const
void connect(OutputConnector &connector)
InputConnector(Module &module, MLint index, OutputConnector &outputConnector)
MLint getIndex() const
Returns the index of the input connection that is represented by this connector.
InputConnector(Module &module, MLint index)
Module & getModule() const
Returns the module to which this connector belongs to.
virtual ~OutputConnector()
Destructor: Destroys this and disconnects connections from all InputConnectors.
PagedImage & getImage()
Returns the paged image of this connector.
OutputConnector(Module &module, MLint index)
MLint getIndex() const
Returns the output index of of this connector on the Module.
friend class InputConnector
Permits accesses of inputConnector to this (OutputConnector).
InputConnector * getConnector(MLint i) const
Returns the InputConnector with index i.
MLint getNumConnectors() const
Returns the number of connected InputConnectors.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
MLint64 MLint
Definition mlTypeDefs.h:489