Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkIDataStorageService.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 mitkIDataStorageService_h
14 #define mitkIDataStorageService_h
15 
16 #include <MitkCoreExports.h>
17 #include <mitkDataStorage.h>
19 #include <mitkServiceInterface.h>
21 
22 #include <optional>
23 #include <string>
24 #include <vector>
25 
26 namespace mitk
27 {
57  {
58  public:
60 
69  virtual DataStorage::Pointer GetDefaultDataStorage() const = 0;
70 
82  virtual DataStorage::Pointer GetActiveDataStorage() const = 0;
83 
92 
102  virtual bool SetActiveDataStorage(const std::string& label) = 0;
103 
116  virtual bool AddDataStorage(const std::string& label, DataStorage::Pointer storage) = 0;
117 
127  virtual std::optional<DataStorageReference> CreateDataStorage(const std::string& label) = 0;
128 
135  virtual std::optional<DataStorageReference> GetDataStorageReference(const std::string& label) const = 0;
136 
145  virtual std::optional<std::string> GetLabel(const DataStorage* storage) const = 0;
146 
152  virtual std::vector<std::string> GetAllLabels() const = 0;
153 
161  virtual std::vector<DataStorageReference> GetAllDataStorages() const = 0;
162 
169  virtual bool HasDataStorage(const std::string& label) const = 0;
170 
181  virtual bool RemoveDataStorage(const std::string& label) = 0;
182 
192  };
193 
194 } // namespace mitk
195 
196 MITK_DECLARE_SERVICE_INTERFACE(mitk::IDataStorageService, "org.mitk.IDataStorageService")
197 
198 #endif
#define MITKCORE_EXPORT
Lightweight metadata container for DataStorage instances.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Service interface for managing DataStorage instances.
virtual std::optional< DataStorageReference > CreateDataStorage(const std::string &label)=0
Create a new DataStorage with the given label.
virtual std::optional< std::string > GetLabel(const DataStorage *storage) const =0
Get the label of a registered DataStorage.
virtual DataStorageReference GetActiveDataStorageReference() const =0
Get info about the currently active DataStorage.
virtual std::vector< std::string > GetAllLabels() const =0
Get all labels of registered DataStorages.
virtual DataStorage::Pointer GetDefaultDataStorage() const =0
Get the default (primary) DataStorage.
virtual std::optional< DataStorageReference > GetDataStorageReference(const std::string &label) const =0
Get info about a specific DataStorage by label.
virtual bool RemoveDataStorage(const std::string &label)=0
Remove a DataStorage from the service by label.
virtual bool HasDataStorage(const std::string &label) const =0
Check if a DataStorage with the given label exists.
virtual std::vector< DataStorageReference > GetAllDataStorages() const =0
Get information about all registered DataStorages.
virtual bool AddDataStorage(const std::string &label, DataStorage::Pointer storage)=0
Register an existing DataStorage with this service.
virtual StorageThreadDispatcherBase * GetDispatcher() const =0
Get the configured thread dispatcher (if any).
virtual DataStorage::Pointer GetActiveDataStorage() const =0
Get the currently active DataStorage.
virtual bool SetActiveDataStorage(const std::string &label)=0
Set the active DataStorage by label.
Abstract base class for dispatching tasks to the thread that owns DataStorage.
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Declare a C++ interface for use with CppMicroServices (Qt not available).
Find image slices visible on a given plane.