Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkDataStorageReference.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 mitkDataStorageReference_h
14 #define mitkDataStorageReference_h
15 
16 #include <MitkCoreExports.h>
17 #include <mitkDataStorage.h>
18 
19 #include <string>
20 
21 namespace mitk
22 {
32  {
33  public:
36 
44  DataStorageReference(const std::string& label, DataStorage::Pointer storage, bool isDefault = false);
45 
51  std::string GetLabel() const;
52 
58  void SetLabel(const std::string& label);
59 
65  DataStorage::Pointer GetStorage() const;
66 
72  void SetStorage(DataStorage::Pointer storage);
73 
81  bool IsDefault() const;
82 
88  bool IsValid() const;
89 
96  bool operator==(const DataStorageReference& other) const;
97 
104  bool operator!=(const DataStorageReference& other) const;
105 
106  private:
107  std::string m_Label;
108  DataStorage::Pointer m_Storage;
109  bool m_IsDefault{false};
110  };
111 
112 } // namespace mitk
113 
114 #endif
#define MITKCORE_EXPORT
Lightweight metadata container for DataStorage instances.
DataStorageReference(const std::string &label, DataStorage::Pointer storage, bool isDefault=false)
Construct a DataStorageReference with the given label, storage, and default flag.
bool IsDefault() const
Check whether this is the default/primary DataStorage.
void SetStorage(DataStorage::Pointer storage)
Set the DataStorage instance associated with this reference.
void SetLabel(const std::string &label)
Set the human-readable label for this DataStorage.
DataStorage::Pointer GetStorage() const
Get the DataStorage instance associated with this reference.
bool IsValid() const
Check if this reference contains a valid (non-null) DataStorage.
bool operator==(const DataStorageReference &other) const
Equality comparison operator.
std::string GetLabel() const
Get the human-readable label for this DataStorage.
DataStorageReference()
Default constructor. Creates an invalid reference with no storage.
bool operator!=(const DataStorageReference &other) const
Inequality comparison operator.
Find image slices visible on a given plane.