Base class of identifiable objects.
Provides a universally unique identifier (UID) for each instance. Other classes can inherit from Identifiable to gain this capability.
The UID is unique at creation time but is not content-dependent:
- An instance may change its data over its lifetime and still keep the same UID.
- If an instance is persisted and loaded multiple times, several in-memory objects may share the same UID.
- UIDs are analogous to git paths (identifying an entity whose state may change) rather than git hashes. They abstract from memory addresses, enabling serialization.
- It is up to the application to ensure appropriate UID usage within its scope.
- Note
- Identifiable itself is not inherently persistable. Derived classes decide if and how to persist their UID.
-
To change the UID after construction, use mitk::UIDManipulator. This indirection exists to discourage casual UID modification; it is intended for data readers only.
- See also
- UIDGenerator, UIDManipulator
Definition at line 45 of file mitkIdentifiable.h.
| UIDType mitk::Identifiable::GetRuntimeUID |
( |
| ) |
const |
|
noexcept |
Get a runtime-unique ID for this object instance.
Unlike GetUID(), this ID is never persisted and never manipulated by readers. It is guaranteed unique for every distinct in-memory instance, derived from the object's memory address at construction time.
Thread-safe: written once in the constructor, read-only thereafter.
- Note
- Do not rely on this value after a move operation – the moved-to object inherits the original address.
- Returns
- A string representation of the construction-time memory address.