32 #include <itkMutexLockHolder.h>
33 #include <itkSimpleFastMutexLock.h>
39 static itk::SimpleFastMutexLock mutex;
45 static std::map<us::ModuleContext *, std::map<void *, us::ServiceReferenceU>> serviceMap;
55 S *coreService = NULL;
59 coreService = context->GetService(serviceRef);
62 assert(coreService &&
"Asserting non-NULL MITK core service");
80 return GetCoreService<IPropertyAliases>(context);
85 return GetCoreService<IPropertyDescriptions>(context);
90 return GetCoreService<IPropertyExtensions>(context);
95 return GetCoreService<IPropertyFilters>(context);
100 return GetCoreService<IPropertyPersistence>(context);
105 return GetCoreService<IMimeTypeProvider>(context);
110 bool success =
false;
113 std::map<us::ModuleContext *, std::map<void *, us::ServiceReferenceU>>::iterator iter =
117 std::map<void *, us::ServiceReferenceU>::iterator iter2 = iter->second.find(service);
118 if (iter2 != iter->second.end())
123 success = context->UngetService(serviceRef);
126 iter->second.erase(iter2);
Interface of property aliases service.
static IMimeTypeProvider * GetMimeTypeProvider(us::ModuleContext *context=us::GetModuleContext())
Get an IMimeTypeProvider instance.
static IPropertyExtensions * GetPropertyExtensions(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyExtensions instance.
static IShaderRepository * GetShaderRepository()
Get an IShaderRepository instance.
DataCollection - Class to facilitate loading/accessing structured data.
Interface of property extensions service.
virtual T GetService(const ServiceReferenceType &reference) const
static IPropertyDescriptions * GetPropertyDescriptions(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyDescriptions instance.
Interface of property descriptions service.
Management class for vtkShader XML descriptions.
static IPropertyPersistence * GetPropertyPersistence(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyPersistence instance.
The IMimeTypeProvider service interface allows to query all registered mime types.
std::map< us::ModuleContext *, std::map< void *, us::ServiceReferenceU > > & s_ContextToServicesMap()
static S * GetCoreService(us::ModuleContext *context)
Interface of property persistence service.
Interface of property filters service.
itk::SimpleFastMutexLock & s_ContextToServicesMapMutex()
static IPropertyFilters * GetPropertyFilters(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyFilters instance.
static IPropertyAliases * GetPropertyAliases(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyAliases instance.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
static bool Unget(S *service, us::ModuleContext *context=us::GetModuleContext())
Unget a previously acquired service instance.