Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Providing a std::vector as property. More...
#include <mitkVectorProperty.h>
Public Types | |
typedef std::vector< DATATYPE > | VectorType |
typedef VectorProperty< DATATYPE > | Self |
typedef BaseProperty | SuperClass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Types inherited from mitk::BaseProperty | |
typedef BaseProperty | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
std::vector< std::string > | GetClassHierarchy () const override |
const char * | GetNameOfClass () const override |
Pointer | Clone () const |
std::string | GetValueAsString () const override |
virtual const VectorType & | GetValue () const |
returns a const reference to the contained vector More... | |
virtual void | SetValue (const VectorType ¶meter_vector) |
sets the content vector More... | |
bool | ToJSON (nlohmann::json &j) const override |
Serialize property value(s) to JSON. More... | |
bool | FromJSON (const nlohmann::json &j) override |
Deserialize property value(s) from JSON. More... | |
Public Member Functions inherited from mitk::BaseProperty | |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
bool | operator== (const BaseProperty &property) const |
Subclasses must implement IsEqual(const BaseProperty&) to support comparison. More... | |
BaseProperty & | operator= (const BaseProperty &property) |
Assigns property to this BaseProperty instance. More... | |
bool | AssignProperty (const BaseProperty &property) |
Assigns property to this BaseProperty instance. More... | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Static Public Member Functions inherited from mitk::BaseProperty | |
static const char * | GetStaticNameOfClass () |
Additional Inherited Members | |
Static Public Attributes inherited from mitk::BaseProperty | |
static const std::string | VALUE_CANNOT_BE_CONVERTED_TO_STRING |
Default return value if a property which can not be returned as string. More... | |
Protected Member Functions inherited from mitk::BaseProperty | |
BaseProperty () | |
BaseProperty (const BaseProperty &other) | |
~BaseProperty () override | |
Providing a std::vector as property.
Templated over the data type of the std::vector that is held by this class. Nothing special about data handling, setting and getting of std::vectors is implemented by-value.
When checking the declaration of this class, you'll notice that it does not use the mitkClassMacro but instead writes all of its definition manually. This is in order to specifically override the GetNameOfClass() method without having to inherit again from the template (see comments in code).
Definition at line 52 of file mitkVectorProperty.h.
typedef itk::SmartPointer<const Self> mitk::VectorProperty< DATATYPE >::ConstPointer |
Definition at line 64 of file mitkVectorProperty.h.
typedef itk::SmartPointer<Self> mitk::VectorProperty< DATATYPE >::Pointer |
Definition at line 63 of file mitkVectorProperty.h.
typedef VectorProperty<DATATYPE> mitk::VectorProperty< DATATYPE >::Self |
Definition at line 61 of file mitkVectorProperty.h.
typedef BaseProperty mitk::VectorProperty< DATATYPE >::SuperClass |
Definition at line 62 of file mitkVectorProperty.h.
typedef std::vector<DATATYPE> mitk::VectorProperty< DATATYPE >::VectorType |
Definition at line 55 of file mitkVectorProperty.h.
Pointer mitk::VectorProperty< DATATYPE >::Clone | ( | ) | const |
|
overridevirtual |
Deserialize property value(s) from JSON.
Rely on exceptions for error handling when implementing deserialization.
Implements mitk::BaseProperty.
|
inlineoverridevirtual |
Reimplemented from mitk::BaseProperty.
Definition at line 65 of file mitkVectorProperty.h.
|
inlineoverride |
Definition at line 76 of file mitkVectorProperty.h.
|
inlinestatic |
This function must return different strings in function of the template parameter! Serialization depends on this feature.
Definition at line 69 of file mitkVectorProperty.h.
|
virtual |
returns a const reference to the contained vector
|
overridevirtual |
Returns the property value as a std::string.
Since VectorProperty potentially holds many elements, it implements this function in a way that only the first and the last couple of elements really appear in the string. Missing central elements are indicated by an ellipsis ("...")
Reimplemented from mitk::BaseProperty.
|
static |
|
virtual |
sets the content vector
|
overridevirtual |
Serialize property value(s) to JSON.
Rely on exceptions for error handling when implementing serialization.
Implements mitk::BaseProperty.