MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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.
27
29class Module;
30class InputConnector;
32
33//-------------------------------------------------------------------------
45//-------------------------------------------------------------------------
47{
48
49public:
52 OutputConnector(Module& module, MLint index);
53
56
58 Module& getModule() const;
59
61 MLint getIndex() const;
62
65
68
71
72private:
75
78 OutputConnector& operator=(const OutputConnector&);
79
81 void _addLink(InputConnector& link);
82
84 MLint _removeLink(InputConnector& link);
85
88 MLint _isLink(const InputConnector& link) const;
89
90
91 // --- Members:
92
94 Module* _module;
95
97 MLint _thisIndex;
98
100 PagedImage _pagedImg;
101
103 std::vector<InputConnector*> _inLinkList;
104
106 friend class InputConnector;
107};
108
109
110//-------------------------------------------------------------------------
112
119//-------------------------------------------------------------------------
121{
122
123public:
126 InputConnector(Module& module, MLint index);
127
132
135
138
141
144
148
151
154 bool isValidConnection() const;
155
156private:
157 friend class OutputConnector;
158
161
164 InputConnector& operator=(const InputConnector&);
165
166
167 // --- Members:
168
170 Module* _module;
171
173 MLint _thisIndex;
174
176 OutputConnector* _outLink;
177};
178
180
181
182#endif
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, it returns false.
void connect(OutputConnector &connector)
Creates a connection between this and the OutputConnector connector bidirectionally.
InputConnector(Module &module, MLint index, OutputConnector &outputConnector)
Constructor: Creates an input connection for the module module at input index and connect bidirection...
MLint getIndex() const
Returns the index of the input connection that is represented by this connector.
InputConnector(Module &module, MLint index)
Constructor: Creates an input connection for module module at input index.
Base class for an image processing module of the ML.
Definition mlModule.h:150
Class to manage an output connection for a Module module.
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)
Constructor: Create output image connection for module module and output index index.
MLint getIndex() const
Returns the output index of of this connector on the Module.
InputConnector * getConnector(MLint i) const
Returns the InputConnector with index i.
MLint getNumConnectors() const
Returns the number of connected InputConnectors.
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
#define MLEXPORT
To export symbols from a DLL/shared object, we need to mark them with the MLEXPORT symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489