|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Template class for generating properties for simple value types (int, float, bool, etc.). More...
#include <mitkGenericProperty.h>


Public Types | |
| typedef T | ValueType |
| The type of the value stored by this property. More... | |
Public Member Functions | |
| mitkClassMacro (GenericProperty, BaseProperty) | |
| mitkNewMacro1Param (GenericProperty< T >, T) | |
| Pointer | Clone () const |
| virtual void | SetValue (T _arg) |
| Set the property value. More... | |
| virtual T | GetValue () const |
| Get the property value. More... | |
| std::string | GetValueAsString () const override |
| Return the property value as a string. More... | |
| bool | ToJSON (nlohmann::json &) const override |
| Serialize property value to JSON. More... | |
| bool | FromJSON (const nlohmann::json &) override |
| Deserialize property value from JSON. More... | |
| BaseProperty & | operator= (const BaseProperty &property) |
| Assign a property value to this instance. More... | |
Public Member Functions inherited from mitk::BaseProperty | |
| mitkClassMacroItkParent (BaseProperty, itk::Object) | |
| Pointer | Clone () const |
| bool | operator== (const BaseProperty &property) const |
| Compare two properties for equality. More... | |
| BaseProperty & | operator= (const BaseProperty &property) |
| Assign a property value to this instance. More... | |
| bool | AssignProperty (const BaseProperty &property) |
| Assign a property value to this instance and report success. More... | |
Protected Member Functions | |
| GenericProperty () | |
| GenericProperty (T x) | |
| GenericProperty (const GenericProperty &other) | |
| mitkCloneMacro (Self) | |
Protected Member Functions inherited from mitk::BaseProperty | |
| BaseProperty () | |
| BaseProperty (const BaseProperty &other) | |
| ~BaseProperty () override | |
Protected Attributes | |
| T | m_Value |
Additional Inherited Members | |
Static Public Attributes inherited from mitk::BaseProperty | |
| static const std::string | VALUE_CANNOT_BE_CONVERTED_TO_STRING |
| Default return value for properties that cannot be converted to a string. More... | |
Template class for generating properties for simple value types (int, float, bool, etc.).
This class template can be instantiated for all classes/internal types that fulfill these requirements:
operator<< so that the property value can be put into a std::stringstreamoperator== so that two properties can be checked for equality| T | The value type stored by this property. |
Definition at line 46 of file mitkGenericProperty.h.
| typedef T mitk::GenericProperty< T >::ValueType |
The type of the value stored by this property.
Definition at line 54 of file mitkGenericProperty.h.
|
inlineprotected |
Definition at line 109 of file mitkGenericProperty.h.
|
inlineprotected |
Definition at line 110 of file mitkGenericProperty.h.
|
inlineprotected |
Definition at line 111 of file mitkGenericProperty.h.
| Pointer mitk::GenericProperty< T >::Clone | ( | ) | const |
|
inlineoverridevirtual |
Deserialize property value from JSON.
The base GenericProperty template does not support JSON deserialization. Concrete specializations (via mitkDefineGenericProperty) override this to provide actual deserialization.
false in the base template. Implements mitk::BaseProperty.
Definition at line 101 of file mitkGenericProperty.h.
|
virtual |
Get the property value.
Referenced by mitk::NonBlockingAlgorithm::GetParameter(), mitk::PropertyList::GetPropertyValue(), mitk::DataNode::GetPropertyValue(), and mitk::Annotation::GetPropertyValue().
|
inlineoverridevirtual |
Return the property value as a string.
Uses operator<< to stream the value into a stringstream.
Reimplemented from mitk::BaseProperty.
Definition at line 71 of file mitkGenericProperty.h.
| mitk::GenericProperty< T >::mitkClassMacro | ( | GenericProperty< T > | , |
| BaseProperty | |||
| ) |
|
protected |
| mitk::GenericProperty< T >::mitkNewMacro1Param | ( | GenericProperty< T > | , |
| T | |||
| ) |
| BaseProperty& mitk::BaseProperty::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.
| [in] | property | The property whose value should be assigned to this instance. |
|
virtual |
Set the property value.
| [in] | _arg | The new value. |
|
inlineoverridevirtual |
Serialize property value to JSON.
The base GenericProperty template does not support JSON serialization. Concrete specializations (via mitkDefineGenericProperty) override this to provide actual serialization.
false in the base template. Implements mitk::BaseProperty.
Definition at line 87 of file mitkGenericProperty.h.
|
protected |
Definition at line 112 of file mitkGenericProperty.h.