MCPcopy Create free account
hub / github.com/MITK/MITK / GetModuleContext

Function GetModuleContext

Modules/CppMicroServices/include/usGetModuleContext.h:41–52  ·  view source on GitHub ↗

* \ingroup MicroServices * * \brief Returns the module context of the calling module. * * This function allows easy access to the ModuleContext instance from * inside a C++ Micro Services module. * * \return The ModuleContext of the calling module. */

Source from the content-addressed store, hash-verified

39 * \return The ModuleContext of the calling module.
40 */
41static inline ModuleContext* GetModuleContext()
42{
43 Module* module = ModuleRegistry::GetModule(US_STR(US_MODULE_NAME));
44 if (module)
45 {
46 return module->GetModuleContext();
47 }
48 MITK_WARN << "Module '" << US_STR(US_MODULE_NAME) << "' unknown. "
49 "The calling module probably misses a US_MODULE_NAME compile definition "
50 "and/or a call to US_INITIALIZE_MODULE in one of its source files.";
51 return nullptr;
52}
53
54}
55

Callers 15

GetDescriptionsServiceFunction · 0.85
GetPersistenceServiceFunction · 0.85
AddConfigFromResourceMethod · 0.85
GetTagsOfInterestServiceFunction · 0.85
GetInstanceMethod · 0.85
GetProviderServiceMethod · 0.85
GetReaderMethod · 0.85

Calls 1

GetModuleContextMethod · 0.45

Tested by 15

setUpMethod · 0.68
usServiceTemplateTestFunction · 0.68
EventMethod · 0.68
FindMethod · 0.68
AddedMethod · 0.68
TestEventListenerHookFunction · 0.68
TestListenerHookFunction · 0.68
TestFindHookFunction · 0.68
usStaticModuleTestFunction · 0.68