MeVisLab Toolbox Reference
mlObjMgrBase.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_OBJ_MGR_BASE_H
14 #define ML_OBJ_MGR_BASE_H
15 
16 
18 
19 #include "MLObjMgrSystem.h"
20 #include "mlObjMgrConnection.h"
21 
22 // Include most ml specific things.
23 #include <mlModuleIncludes.h>
24 
25 // Macros to be used when calling notifySensorsAndConnectedClients()
26 #define DONT_FIRE_SENSORS false
27 #define FIRE_SENSORS true
28 
29 ML_START_NAMESPACE
30 
31  class ObjMgr;
32  class ObjMgrClient;
33 
36  class ObjMgrBase : public Module
37  {
38  friend class ObjMgrClient;
39 
40  typedef Module inherited;
41 
44 
45  public:
46 
48  ~ObjMgrBase() override;
49 
53 
54  protected:
55 
57  ObjMgrBase(int inputNum, int outputNum);
58 
61 
63  std::set<ObjMgrBase *> _connectedModules;
64 
66  void notifySensorsAndConnectedClients(bool fireOutputSensors);
67 
70 
72  virtual std::string getDebugComment() const = 0;
73 
77  void buildGraph(std::multimap<ObjMgrBase *, ObjMgrBase *> &graph);
78 
79  private:
81  ObjMgrBase(const ObjMgrBase &) : Module(0,0){
82  ML_PRINT_FATAL_ERROR("ObjMgrBase::ObjMgrBase(const ObjMgrBase&)",
84  "Invalid usage of copy constructor");
85  }
86 
88  ObjMgrBase &operator=(const ObjMgrBase &){
89  ML_PRINT_FATAL_ERROR("ObjMgrBase::operator=",
91  "Invalid usage of assignment operator");
92  return *this;
93  }
94  };
95 
96 ML_END_NAMESPACE
97 
98 #endif // __mlObjMgrBase_H
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Base class for all communicating modules.
Definition: mlObjMgrBase.h:37
~ObjMgrBase() override
Macro for declaring methods for the runtime system.
virtual std::string getDebugComment() const =0
Return debug comment.
void configureNetwork()
(Re)initialize/configure client connections.
void notifySensorsAndConnectedClients(bool fireOutputSensors)
Notify all directly connected modules.
omObjMgrConnection _connection
Current connection that originates from this module.
Definition: mlObjMgrBase.h:60
void buildGraph(std::multimap< ObjMgrBase *, ObjMgrBase * > &graph)
May be used to build a graph of the network originating from this module.
std::set< ObjMgrBase * > _connectedModules
Container of directly connected ObjMgrBase modules.
Definition: mlObjMgrBase.h:63
ObjMgrBase(int inputNum, int outputNum)
Constructor.
BaseField * objectsOutFld
Access field to object container.
Definition: mlObjMgrBase.h:52
Base class for all modules that wish to use and communicate (send and receive notifications) with the...
Connection information.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
#define ML_PROGRAMMING_ERROR
A case occurred which should not appear and here are a variety of reasons, typically it is a programm...
Definition: mlTypeDefs.h:890
#define ML_PRINT_FATAL_ERROR(FUNC_NAME, REASON, HANDLING)
Like ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be du...