13 #ifndef mitkCoreServices_h
14 #define mitkCoreServices_h
30 struct IMimeTypeProvider;
31 class IDataStorageService;
32 class INodeSelectionService;
33 class IPropertyAliases;
34 class IPropertyDescriptions;
35 class IPropertyDeserialization;
36 class IPropertyExtensions;
37 class IPropertyFilters;
38 class IPropertyPersistence;
39 class IPropertyRelations;
40 class IPropertyTransience;
41 class IPreferencesService;
161 return Unget(context, us_service_interface_iid<S>(), service);
165 static bool Unget(
us::ModuleContext *context,
const std::string &interfaceId,
void *service);
205 : m_Service(service),
215 if (m_Service !=
nullptr)
221 catch (
const std::exception &e)
227 MITK_ERROR <<
"Ungetting core service failed.";
236 explicit operator bool()
const
238 return m_Service !=
nullptr;
RAII wrapper for core service objects.
~CoreServicePointer()
Destructor. Releases the managed service via CoreServices::Unget().
S * operator->() const
Dereference the managed service pointer.
CoreServicePointer & operator=(const CoreServicePointer &)=delete
CoreServicePointer(const CoreServicePointer &)=delete
S * Get() const
Get the raw service pointer.
CoreServicePointer(S *service, us::ModuleContext *context=us::GetModuleContext())
Construct a RAII wrapper around a service pointer.
Provides convenient static access to common MITK core service objects.
static IPropertyTransience * GetPropertyTransience(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyTransience instance.
static IPropertyPersistence * GetPropertyPersistence(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyPersistence instance.
static IPropertyDescriptions * GetPropertyDescriptions(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyDescriptions instance.
static IMimeTypeProvider * GetMimeTypeProvider(us::ModuleContext *context=us::GetModuleContext())
Get an IMimeTypeProvider instance.
static IPropertyRelations * GetPropertyRelations(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyRelations instance.
static IPropertyExtensions * GetPropertyExtensions(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyExtensions instance.
static IPreferencesService * GetPreferencesService(us::ModuleContext *context=us::GetModuleContext())
Get an IPreferencesService instance.
static INodeSelectionService * GetNodeSelectionService(us::ModuleContext *context=us::GetModuleContext())
Get an INodeSelectionsService instance.
static IPropertyDeserialization * GetPropertyDeserialization(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyDeserialization instance.
static IPropertyAliases * GetPropertyAliases(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyAliases instance.
static IPropertyFilters * GetPropertyFilters(us::ModuleContext *context=us::GetModuleContext())
Get an IPropertyFilters instance.
static IDataStorageService * GetDataStorageService(us::ModuleContext *context=us::GetModuleContext())
Get an IDataStorageService instance.
static bool Unget(S *service, us::ModuleContext *context=us::GetModuleContext())
Release a previously acquired service instance.
Service interface for managing DataStorage instances.
A simple messaging service for sending and receiving data node selections for certain contexts.
A service for persistent application preferences.
Interface of property aliases service.
Interface of property descriptions service.
Interface of property deserialization service.
Interface of property extensions service.
Interface of property filters service.
Interface of property persistence service.
Interface of property relations service.
Interface of the property transience service.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
#define MITK_ERROR
Log an error message.
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
Find image slices visible on a given plane.
Service interface for querying all registered mime-types.