ML 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 are in this
25// name space to avoid collisions with types of 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
Class to manage an input connection of a Module module.
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.
bool isValidConnection() const
Returns true if bidirectional connection is valid, otherwise false.
void connect(OutputConnector &connector)
Creates connection between this and the OutputConnector connector bidirectionally.
InputConnector(Module &module, MLint index, OutputConnector &outputConnector)
Constructor: Creates input connection for module module at input index and connect bidirectionally wi...
MLint getIndex() const
Returns index of input connection which is represented by this connector.
InputConnector(Module &module, MLint index)
Constructor: Creates input connection for module module at input index.
Base class for an image processing module of the ML.
Definition mlModule.h:151
Class to manage an output connection for a Module module.
Module & getModule() const
Returns module to which this connector belongs to.
virtual ~OutputConnector()
Destructor: Destroy this and disconnects connections from all InputConnectors.
PagedImage & getImage()
Returns the paged image of this connector.
OutputConnector(Module &module, MLint index)
Constructor: Create output image connection for module module and output index index.
MLint getIndex() const
Returns output index of of this connector on the Module.
InputConnector * getConnector(MLint i) const
Returns InputConnector with index i.
MLint getNumConnectors() const
Returns number of connected InputConnectors.
Class which represents an image, which manages properties of an image and image data which is located...
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490