MeVisLabToolboxReference
mlConnectors.h
Go to the documentation of this file.
1 // **InsertLicense** code
2 //-------------------------------------------------------------------------
10 //-------------------------------------------------------------------------
11 #ifndef __mlConnectors_H
12 #define __mlConnectors_H
13 
14 // ML-includes
15 #include "mlInitSystemML.h"
16 #include "mlRuntimeSubClass.h"
17 #include "mlPagedImage.h"
18 
19 #ifdef ML_DEPRECATED
20 #include "mlModule.h"
21 #endif // ML_DEPRECATED
22 
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.
26 ML_START_NAMESPACE
27 
29 class Module;
30 class InputConnector;
32 
33 // Disable warnings on own usage of deprecation
34 #ifdef _MSC_VER
35 #pragma warning(push)
36 #pragma warning(disable : 4996 )
37 #endif
38 
39 //-------------------------------------------------------------------------
51 //-------------------------------------------------------------------------
53 {
54 
55 public:
56 
59  OutputConnector(Module& module, MLint index);
60 
62  virtual ~OutputConnector();
63 
65  Module& getModule() const;
66 
68  MLint getIndex() const;
69 
71  MLint getNumConnectors() const;
72 
74  InputConnector* getConnector(MLint i) const;
75 
77  PagedImage& getImage();
78 
79 private:
80 
83 
86  OutputConnector& operator=(const OutputConnector &);
87 
89  void _addLink(InputConnector& link);
90 
92  MLint _removeLink(InputConnector& link);
93 
96  MLint _isLink(const InputConnector& link) const;
97 
98 
99  // --- Members:
100 
102  Module *_module;
103 
105  MLint _thisIndex;
106 
108  PagedImage _pagedImg;
109 
111  std::vector <InputConnector*> _inLinkList;
112 
114  friend class InputConnector;
115 
116 
117 #ifdef ML_DEPRECATED
118 
120 
121 
122 public:
123 
126  inline ML_DEPRECATED BaseOp& getOp() const { return *static_cast<BaseOp*>(&getModule()); }
129  inline ML_DEPRECATED InputConnector* getLink(MLint i) const { return getConnector(i); }
132  inline ML_DEPRECATED MLint getLinkNum() const { return getNumConnectors(); }
135  inline ML_DEPRECATED PagedImg& getPagedImg() { return getImage(); }
136 
138 #endif // ML_DEPRECATED
139 
140 };
141 
142 
143 
144 
145 //-------------------------------------------------------------------------
147 
154 //-------------------------------------------------------------------------
156 {
157 
158 public:
159 
162  InputConnector(Module& module, MLint index);
163 
167  InputConnector(Module& module, MLint index, OutputConnector& outputConnector);
168 
170  virtual ~InputConnector();
171 
173  Module& getModule() const;
174 
176  MLint getIndex() const;
177 
179  OutputConnector* getConnector() const;
180 
183  void connect(OutputConnector& connector);
184 
186  void disconnect();
187 
190  bool isValidConnection() const;
191 
192 private:
193  friend class OutputConnector;
194 
197 
200  InputConnector& operator=(const InputConnector &);
201 
202 
203  // --- Members:
204 
206  Module *_module;
207 
209  MLint _thisIndex;
210 
212  OutputConnector *_outLink;
213 
214 
215 #ifdef ML_DEPRECATED
216 
218 
219 
220 public:
223  inline ML_DEPRECATED BaseOp &getOp() const { return *static_cast<BaseOp*>(&getModule()); }
226  inline ML_DEPRECATED OutputConnector* getLink() const { return getConnector(); }
228 
229 #endif // ML_DEPRECATED
230 
231 };
232 
233 // re-enable deprecation warnings
234 #ifdef _MSC_VER
235 #pragma warning(pop)
236 #endif
237 
238 ML_END_NAMESPACE
239 
240 
241 #endif // __mlConnectors_H
242 
243 
BaseOp & getOp() const
Definition: mlConnectors.h:126
PagedImg & getPagedImg()
Definition: mlConnectors.h:135
#define ML_DEPRECATED
Definition: mlMacros.h:40
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:66
Class to manage an input connection of a Module module.
Definition: mlConnectors.h:155
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:576
Defines system-specific macros for this project/DLL.
Class to manage an output connection for a Module module.
Definition: mlConnectors.h:52
OutputConnector * getLink() const
Definition: mlConnectors.h:226
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol...
MLint getLinkNum() const
Definition: mlConnectors.h:132
InputConnector * getLink(MLint i) const
Definition: mlConnectors.h:129
This file defines macros, which are inserted in classes to declare and implement additional class mem...
This Module class is the most important base class to derive new image processing modules from; see c...
Base class for an image processing module of the ML.
Definition: mlModule.h:152
Contains the class PagedImage which represents an fragmented image which manages properties of an ima...
BaseOp & getOp() const
Definition: mlConnectors.h:223