Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::Identifiable Class Reference

Base class of identifiable objects. More...

#include <mitkIdentifiable.h>

Inheritance diagram for mitk::Identifiable:

Public Types

using UIDType = std::string
 

Public Member Functions

 Identifiable ()
 
 Identifiable (const UIDType &uid)
 
 Identifiable (const Identifiable &)=delete
 
 Identifiable (Identifiable &&) noexcept
 
virtual ~Identifiable ()
 
Identifiableoperator= (const Identifiable &)=delete
 
Identifiableoperator= (Identifiable &&other) noexcept
 
virtual UIDType GetUID () const
 Get unique ID of an object. More...
 

Protected Member Functions

virtual void SetUID (const UIDType &uid)
 

Detailed Description

Base class of identifiable objects.

Offers an interface to query a UID for the instance. Can be inherited by other classes to provide this capability.

What does the UID stand for/what is its scope?

  • It is unique in its creation, but it is not a content specific unique ID. Therefore:
    • A class instance, associated with a UID, may change its values over its lifetime, but still have the same UID.
    • If a class instance gets persisted and loaded multiple times, then their could be several instances with the same UID.
    • UIDs are therefore more simelar to git paths than to git hashes. They identify something, but the state of something can change (stream of commits). The difference of the UID compared to using e.g. plain instance pointers to identify an object is that UIDs allow the feature of serialization as they abstract from the memory location of the current runtime environment.
  • It is up to the application that builds upon that feature to ensure appropriate usage within the application scope.
    Remarks
    It is not a feature of mitk::Identifiable per se to be persistable. It depends on classes that derive from mitk::Identifiable, if and how they implement a persistence mechanism for their MITK UID.
    If you want to change the unique ID after creation time, you can use the mitk::UIDManipulator class. The reationale behind this pattern is to ensure that you think twice before doing this. It is intended to be used by data readers if necessary at all.

Definition at line 45 of file mitkIdentifiable.h.

Member Typedef Documentation

◆ UIDType

using mitk::Identifiable::UIDType = std::string

Definition at line 48 of file mitkIdentifiable.h.

Constructor & Destructor Documentation

◆ Identifiable() [1/4]

mitk::Identifiable::Identifiable ( )

◆ Identifiable() [2/4]

mitk::Identifiable::Identifiable ( const UIDType uid)
explicit

◆ Identifiable() [3/4]

mitk::Identifiable::Identifiable ( const Identifiable )
delete

◆ Identifiable() [4/4]

mitk::Identifiable::Identifiable ( Identifiable &&  )
noexcept

◆ ~Identifiable()

virtual mitk::Identifiable::~Identifiable ( )
virtual

Member Function Documentation

◆ GetUID()

virtual UIDType mitk::Identifiable::GetUID ( ) const
virtual

Get unique ID of an object.

Returns
Empty string if an object has no unique ID.

Reimplemented in mitk::MAPRegistrationWrapper.

◆ operator=() [1/2]

Identifiable& mitk::Identifiable::operator= ( const Identifiable )
delete

◆ operator=() [2/2]

Identifiable& mitk::Identifiable::operator= ( Identifiable &&  other)
noexcept

◆ SetUID()

virtual void mitk::Identifiable::SetUID ( const UIDType uid)
protectedvirtual

Reimplemented in mitk::MAPRegistrationWrapper.


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