Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::DataStorageReference Class Reference

Lightweight metadata container for DataStorage instances. More...

#include <mitkDataStorageReference.h>

Public Member Functions

 DataStorageReference ()
 Default constructor. Creates an invalid reference with no storage. More...
 
 DataStorageReference (const std::string &label, DataStorage::Pointer storage, bool isDefault=false)
 Construct a DataStorageReference with the given label, storage, and default flag. More...
 
std::string GetLabel () const
 Get the human-readable label for this DataStorage. More...
 
void SetLabel (const std::string &label)
 Set the human-readable label for this DataStorage. More...
 
DataStorage::Pointer GetStorage () const
 Get the DataStorage instance associated with this reference. More...
 
void SetStorage (DataStorage::Pointer storage)
 Set the DataStorage instance associated with this reference. More...
 
bool IsDefault () const
 Check whether this is the default/primary DataStorage. More...
 
bool IsValid () const
 Check if this reference contains a valid (non-null) DataStorage. More...
 
bool operator== (const DataStorageReference &other) const
 Equality comparison operator. More...
 
bool operator!= (const DataStorageReference &other) const
 Inequality comparison operator. More...
 

Detailed Description

Lightweight metadata container for DataStorage instances.

This class associates a DataStorage with a label and an immutable default flag.

The IsDefault property is set at construction time and cannot be changed, since default status is a property of how the storage was created.

Definition at line 31 of file mitkDataStorageReference.h.

Constructor & Destructor Documentation

◆ DataStorageReference() [1/2]

mitk::DataStorageReference::DataStorageReference ( )

Default constructor. Creates an invalid reference with no storage.

◆ DataStorageReference() [2/2]

mitk::DataStorageReference::DataStorageReference ( const std::string &  label,
DataStorage::Pointer  storage,
bool  isDefault = false 
)

Construct a DataStorageReference with the given label, storage, and default flag.

Parameters
[in]labelHuman-readable label for the DataStorage.
[in]storageThe DataStorage instance to associate.
[in]isDefaultIf true, marks this as the default/primary DataStorage.

Member Function Documentation

◆ GetLabel()

std::string mitk::DataStorageReference::GetLabel ( ) const

Get the human-readable label for this DataStorage.

Returns
The label string.

◆ GetStorage()

DataStorage::Pointer mitk::DataStorageReference::GetStorage ( ) const

Get the DataStorage instance associated with this reference.

Returns
The DataStorage smart pointer.

◆ IsDefault()

bool mitk::DataStorageReference::IsDefault ( ) const

Check whether this is the default/primary DataStorage.

This property is immutable after construction.

Returns
True if this is the default DataStorage.

◆ IsValid()

bool mitk::DataStorageReference::IsValid ( ) const

Check if this reference contains a valid (non-null) DataStorage.

Returns
True if the DataStorage is not null.

◆ operator!=()

bool mitk::DataStorageReference::operator!= ( const DataStorageReference &  other) const

Inequality comparison operator.

Parameters
[in]otherThe other DataStorageReference to compare with.
Returns
True if the references differ.

◆ operator==()

bool mitk::DataStorageReference::operator== ( const DataStorageReference &  other) const

Equality comparison operator.

Parameters
[in]otherThe other DataStorageReference to compare with.
Returns
True if both references have the same label, storage, and default flag.

◆ SetLabel()

void mitk::DataStorageReference::SetLabel ( const std::string &  label)

Set the human-readable label for this DataStorage.

Parameters
[in]labelThe new label string.

◆ SetStorage()

void mitk::DataStorageReference::SetStorage ( DataStorage::Pointer  storage)

Set the DataStorage instance associated with this reference.

Parameters
[in]storageThe DataStorage smart pointer.

The documentation for this class was generated from the following file: