Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
usModuleImport.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 USMODULEIMPORT_H
14 #define USMODULEIMPORT_H
15 
16 #include <usGlobalConfig.h>
17 
18 #include <string>
19 
20 namespace us {
21 
22 struct ModuleActivator;
23 
24 }
25 
43 #define US_INITIALIZE_STATIC_MODULE(_module_name) \
44  extern "C" void _us_import_module_initializer_ ## _module_name(); \
45  struct StaticModuleInitializer_ ## _module_name \
46  { \
47  StaticModuleInitializer_ ## _module_name() \
48  { \
49  _us_import_module_initializer_ ## _module_name(); \
50  } \
51  }; \
52  static StaticModuleInitializer_ ## _module_name _InitializeModule_ ## _module_name;
53 
76 #define US_IMPORT_MODULE(_module_name) \
77  US_INITIALIZE_STATIC_MODULE(_module_name) \
78  extern "C" us::ModuleActivator* _us_module_activator_instance_ ## _module_name (); \
79  void _dummy_reference_to_ ## _module_name ## _activator() \
80  { \
81  _us_module_activator_instance_ ## _module_name(); \
82  }
83 
84 #endif // USMODULEREGISTRY_H