|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Service interface for managing DataStorage instances. More...
#include <mitkIDataStorageService.h>

Public Member Functions | |
| virtual | ~IDataStorageService () |
| virtual DataStorage::Pointer | GetDefaultDataStorage () const =0 |
| Get the default (primary) DataStorage. More... | |
| virtual DataStorage::Pointer | GetActiveDataStorage () const =0 |
| Get the currently active DataStorage. More... | |
| virtual DataStorageReference | GetActiveDataStorageReference () const =0 |
| Get info about the currently active DataStorage. More... | |
| virtual bool | SetActiveDataStorage (const std::string &label)=0 |
| Set the active DataStorage by label. More... | |
| virtual bool | AddDataStorage (const std::string &label, DataStorage::Pointer storage)=0 |
| Register an existing DataStorage with this service. More... | |
| virtual std::optional< DataStorageReference > | CreateDataStorage (const std::string &label)=0 |
| Create a new DataStorage with the given label. More... | |
| virtual std::optional< DataStorageReference > | GetDataStorageReference (const std::string &label) const =0 |
| Get info about a specific DataStorage by label. More... | |
| virtual std::optional< std::string > | GetLabel (const DataStorage *storage) const =0 |
| Get the label of a registered DataStorage. More... | |
| virtual std::vector< std::string > | GetAllLabels () const =0 |
| Get all labels of registered DataStorages. More... | |
| virtual std::vector< DataStorageReference > | GetAllDataStorages () const =0 |
| Get information about all registered DataStorages. More... | |
| virtual bool | HasDataStorage (const std::string &label) const =0 |
| Check if a DataStorage with the given label exists. More... | |
| virtual bool | RemoveDataStorage (const std::string &label)=0 |
| Remove a DataStorage from the service by label. More... | |
| virtual StorageThreadDispatcherBase * | GetDispatcher () const =0 |
| Get the configured thread dispatcher (if any). More... | |
Service interface for managing DataStorage instances.
This service provides access to one or more DataStorage instances within the application. For most use cases, GetDefaultDataStorage() or GetActiveDataStorage() is sufficient.
The service supports multiple labeled DataStorage instances for advanced scenarios like multi-document applications, though typical Workbench usage only uses the default storage.
Access this service via CoreServices::GetDataStorageService().
Definition at line 56 of file mitkIDataStorageService.h.
|
virtual |
|
pure virtual |
Register an existing DataStorage with this service.
Use this method to add a DataStorage that was created elsewhere to the service's management. The service takes shared ownership.
| label | Human-readable label for the storage. Must be unique and not an empty string (as empty labels always indicate default storage). |
| storage | The DataStorage to register. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Create a new DataStorage with the given label.
Creates a new StandaloneDataStorage and registers it with this service. For registering an existing DataStorage, use AddDataStorage() instead.
| label | Human-readable label for the storage. Must be unique. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Get the currently active DataStorage.
Returns the active DataStorage if one has been set via SetActiveDataStorage(), otherwise returns the default.
This is the recommended method for most use cases where you need the "current" DataStorage.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get info about the currently active DataStorage.
Similar to GetActiveDataStorage() but returns full info including label.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get information about all registered DataStorages.
The returned vector always contains at least the default DataStorage.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get all labels of registered DataStorages.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get info about a specific DataStorage by label.
| label | The label to search for. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Get the default (primary) DataStorage.
The default DataStorage is created when the service starts and persists for the lifetime of the application.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get the configured thread dispatcher (if any).
Returns the dispatcher that marshals tasks to the thread owning the DataStorage. Consumers use this to dispatch DataStorage operations from background threads.
Implemented in mitk::DataStorageService.
|
pure virtual |
Get the label of a registered DataStorage.
Reverse lookup: given a DataStorage pointer, find its label.
| storage | The DataStorage to look up. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Check if a DataStorage with the given label exists.
| label | The label to check. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Remove a DataStorage from the service by label.
The default DataStorage cannot be removed. If the removed storage was the active storage, the active storage is reset to the default.
| label | The label of the storage to remove. |
Implemented in mitk::DataStorageService.
|
pure virtual |
Set the active DataStorage by label.
Selects a registered DataStorage as the active one.
| label | The label of the storage to make active. Use empty string to revert to the default. |
Implemented in mitk::DataStorageService.