Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::IPropertyOwner Class Referenceabstract

#include <mitkIPropertyOwner.h>

Inheritance diagram for mitk::IPropertyOwner:
Collaboration diagram for mitk::IPropertyOwner:

Public Member Functions

 ~IPropertyOwner () override
 
virtual BasePropertyGetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true)=0
 Get property by its key. More...
 
virtual void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false)=0
 Add new or change existent property. More...
 
virtual void RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false)=0
 Removes a property. If the property does not exist, nothing will be done. More...
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 
virtual BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const =0
 Get property by its key. More...
 
virtual std::vector< std::string > GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const =0
 Query keys of existing properties. More...
 
virtual std::vector< std::string > GetPropertyContextNames () const =0
 Query names of existing contexts. More...
 

Detailed Description

Interface implemented by classes that provide write/read access to property information.

Definition at line 22 of file mitkIPropertyOwner.h.

Constructor & Destructor Documentation

◆ ~IPropertyOwner()

mitk::IPropertyOwner::~IPropertyOwner ( )
override

Member Function Documentation

◆ GetNonConstProperty()

virtual BaseProperty* mitk::IPropertyOwner::GetNonConstProperty ( const std::string &  propertyKey,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = true 
)
pure virtual

Get property by its key.

Parameters
[in]propertyKeyKey of property.
[in]contextNameOptional, default is empty string (default context). Search in specified context.
[in]fallBackOnDefaultContextOptional, default is true. Also search in default context if property was not found in given context.
Returns
Found property, nullptr otherwise.

Implemented in mitk::ROI::Element, mitk::DataNode, mitk::PropertyList, and mitk::BaseData.

◆ RemoveProperty()

virtual void mitk::IPropertyOwner::RemoveProperty ( const std::string &  propertyKey,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = false 
)
pure virtual

Removes a property. If the property does not exist, nothing will be done.

Parameters
[in]propertyKeyKey of property.
[in]contextNameOptional, default is empty string (default context). Context in which the property is removed.
[in]fallBackOnDefaultContextOptional, default is false. Remove property in default context if given context does not exist.
Precondition
If a context is specified by contextName, this context must be known by the owner or fallBackOnDefaultContext must be true. If violated an mitk::Exception is thrown.
propertyKey must be a none empty string. If violated an mitk::Exception is thrown.

Implemented in mitk::ROI::Element, mitk::DataNode, mitk::PropertyList, and mitk::BaseData.

◆ SetProperty()

virtual void mitk::IPropertyOwner::SetProperty ( const std::string &  propertyKey,
BaseProperty property,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = false 
)
pure virtual

Add new or change existent property.

Parameters
[in]propertyKeyKey of property.
[in]propertyThe actual property.
[in]contextNameOptional, default is empty string (default context). Context in which the property is set.
[in]fallBackOnDefaultContextOptional, default is false. Set property in default context if given context does not exist.
Precondition
If a context is specified by contextName, this context must be known by the owner or fallBackOnDefaultContext must be true. If violated an mitk::Exception is thrown.
propertyKey must be a none empty string. If violated an mitk::Exception is thrown.

Implemented in mitk::ROI::Element, mitk::DataNode, mitk::PropertyList, mitk::Label, and mitk::BaseData.


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