Property containing a smart pointer to an itk::Object.
More...
#include <mitkSmartPointerProperty.h>
|
| typedef itk::Object::Pointer | ValueType |
| | The type of the value stored by this property. More...
|
| |
Property containing a smart pointer to an itk::Object.
Stores a reference-counted smart pointer to an arbitrary itk::Object. Internally tracks reference counts and UIDs for all pointed-to objects to support XML serialization and deserialization workflows.
- Note
- This property does not support JSON serialization. ToJSON() and FromJSON() return
false.
- See also
- BaseProperty
-
WeakPointerProperty
Definition at line 39 of file mitkSmartPointerProperty.h.
◆ ValueType
◆ SmartPointerProperty() [1/2]
| mitk::SmartPointerProperty::SmartPointerProperty |
( |
itk::Object * |
= nullptr | ) |
|
|
protected |
◆ SmartPointerProperty() [2/2]
◆ Clone()
| Pointer mitk::SmartPointerProperty::Clone |
( |
| ) |
const |
◆ FromJSON()
◆ GetReferenceCountFor()
| static unsigned int mitk::SmartPointerProperty::GetReferenceCountFor |
( |
itk::Object * |
| ) |
|
|
static |
Get the number of SmartPointerProperties referencing the given object.
- Returns
- The reference count (0 if not referenced by any SmartPointerProperty).
◆ GetReferenceUIDFor()
| static std::string mitk::SmartPointerProperty::GetReferenceUIDFor |
( |
itk::Object * |
| ) |
|
|
static |
Get the reference UID for the given object.
- Returns
- The UID string, or "invalid" if the object is not tracked.
◆ GetSmartPointer()
| itk::Object::Pointer mitk::SmartPointerProperty::GetSmartPointer |
( |
| ) |
const |
◆ GetValue()
| ValueType mitk::SmartPointerProperty::GetValue |
( |
| ) |
const |
Get the stored smart pointer (alias for GetSmartPointer()).
- Returns
- The itk::Object smart pointer.
◆ GetValueAsString()
| std::string mitk::SmartPointerProperty::GetValueAsString |
( |
| ) |
const |
|
overridevirtual |
Return the UID of the pointed-to object as a string.
Returns "nullptr" if the pointer is null.
- Returns
- The UID string of the referenced object.
Reimplemented from mitk::BaseProperty.
◆ mitkClassMacro()
◆ mitkCloneMacro()
◆ mitkNewMacro1Param()
◆ New()
| static Pointer mitk::SmartPointerProperty::New |
( |
| ) |
|
|
static |
◆ operator=()
Assign a property value to this instance.
Performs a polymorphic assignment from the given property. The assignment succeeds only if the source and target properties are of the same type. The subclass-specific Assign() method is called to perform the actual value copy.
Subclasses must implement Assign(const BaseProperty&) and call the superclass Assign method for proper handling. The copy assignment operator of the subclass should be disabled and the base class operator should be made visible using "using" statements.
- Parameters
-
| [in] | property | The property whose value should be assigned to this instance. |
- Returns
- A reference to this property.
- See also
- AssignProperty
-
Assign
◆ PostProcessXMLReading()
| static void mitk::SmartPointerProperty::PostProcessXMLReading |
( |
| ) |
|
|
static |
Resolve all smart pointer references after XML deserialization.
Iterates over all SmartPointerProperty instances that were read from XML and resolves their pointer targets from the registered target map.
◆ RegisterPointerTarget()
| static void mitk::SmartPointerProperty::RegisterPointerTarget |
( |
itk::Object * |
, |
|
|
const std::string |
uid |
|
) |
| |
|
static |
Register an object as a potential target for XML deserialization.
Takes the target object and the UID string to associate with it.
◆ SetSmartPointer()
| void mitk::SmartPointerProperty::SetSmartPointer |
( |
itk::Object * |
| ) |
|
Set the stored smart pointer.
Updates internal reference counting and UID tracking. Marks the property as modified if the pointer changes.
Takes the new itk::Object to point to, or nullptr.
◆ SetValue()
| void mitk::SmartPointerProperty::SetValue |
( |
const ValueType & |
| ) |
|
Set the stored smart pointer (alias for SetSmartPointer()).
Takes the new itk::Object smart pointer.
◆ ToJSON()
◆ m_SmartPointer
| itk::Object::Pointer mitk::SmartPointerProperty::m_SmartPointer |
|
protected |
The documentation for this class was generated from the following file: