Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
usModuleEvent.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef USMODULEEVENT_H
14 #define USMODULEEVENT_H
15 
16 #include <iostream>
17 
18 #include <usSharedData.h>
19 
20 namespace us {
21 
22 class Module;
23 class ModuleEventData;
24 
38 {
39 
41 
42 public:
43 
44  enum Type {
45 
54 
63 
72 
80  UNLOADING
81 
82  };
83 
88 
91 
99  bool IsNull() const;
100 
107  ModuleEvent(Type type, Module* module);
108 
112  ModuleEvent(const ModuleEvent& other);
113 
119 
127  Module* GetModule() const;
128 
144  Type GetType() const;
145 
146 };
147 
159 MITKCPPMICROSERVICES_EXPORT std::ostream& operator<<(std::ostream& os, ModuleEvent::Type eventType);
160 
167 MITKCPPMICROSERVICES_EXPORT std::ostream& operator<<(std::ostream& os, const ModuleEvent& event);
168 
171 }
172 
173 #endif // USMODULEEVENT_H
#define MITKCPPMICROSERVICES_EXPORT
An event from the Micro Services framework describing a module lifecycle change.
Definition: usModuleEvent.h:38
ModuleEvent(Type type, Module *module)
Creates a module event of the specified type.
ModuleEvent()
Creates an invalid instance.
ModuleEvent & operator=(const ModuleEvent &other)
Copy assignment operator.
ModuleEvent(const ModuleEvent &other)
Copy constructor.
@ UNLOADED
The module has been unloaded.
Definition: usModuleEvent.h:62
@ LOADING
The module is about to be loaded.
Definition: usModuleEvent.h:71
@ LOADED
The module has been loaded.
Definition: usModuleEvent.h:53
Module * GetModule() const
Returns the module which had a lifecycle change. If this is a null event (default-constructed),...
~ModuleEvent()
Destructor.
bool IsNull() const
Can be used to check if this ModuleEvent instance is valid, or if it has been constructed using the d...
Type GetType() const
Returns the type of lifecycle event.
Represents a CppMicroServices module.
Definition: usModule.h:70
MITKCPPMICROSERVICES_EXPORT std::ostream & operator<<(std::ostream &os, ModuleEvent::Type eventType)
Stream output operator for ModuleEvent::Type.