Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
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. Therfore:
    • 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.
    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 ( )

Definition at line 21 of file mitkIdentifiable.cpp.

References mitk::UIDGenerator::GetUID().

◆ Identifiable() [2/4]

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

Definition at line 28 of file mitkIdentifiable.cpp.

◆ Identifiable() [3/4]

mitk::Identifiable::Identifiable ( const Identifiable )

◆ Identifiable() [4/4]

mitk::Identifiable::Identifiable ( Identifiable &&  other)

Definition at line 34 of file mitkIdentifiable.cpp.

◆ ~Identifiable()

mitk::Identifiable::~Identifiable ( )

Definition at line 40 of file mitkIdentifiable.cpp.

Member Function Documentation

◆ GetUID()

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

Get unique ID of an object.

Empty string if an object has no unique ID.

Reimplemented in mitk::MAPRegistrationWrapper.

Definition at line 54 of file mitkIdentifiable.cpp.

Referenced by mitk::BaseDataCompare::AreEqual(), mitk::NodePredicateDataUID::CheckNode(), QmitkImageStatisticsDataGenerator::GenerateStatisticsNodeName(), and mitk::SceneIO::SaveBaseData().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 45 of file mitkIdentifiable.cpp.

◆ SetUID()

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

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