Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::IPropertyPersistence Class Referenceabstract

Interface of property persistence service. More...

#include <mitkIPropertyPersistence.h>

Inheritance diagram for mitk::IPropertyPersistence:

Public Types

using InfoResultType = std::list< PropertyPersistenceInfo::ConstPointer >
 
using MimeTypeNameType = PropertyPersistenceInfo::MimeTypeNameType
 

Public Member Functions

virtual ~IPropertyPersistence ()
 
virtual bool AddInfo (const PropertyPersistenceInfo *info, bool overwrite=false)=0
 Add persistence info for a specific base data property. If there is already a property info instance for the passed property name and the same info, it won't be added. Info instances are regarded equal, if the mime types are equal. You may enforce to overwrite the old equal info for a property name by the overwrite parameter. More...
 
virtual InfoResultType GetInfo (const std::string &propertyName, bool allowNameRegEx=true) const =0
 Get the persistence info for a specific base data property. More...
 
virtual InfoResultType GetInfo (const std::string &propertyName, const MimeTypeNameType &mime, bool allowMimeWildCard=false, bool allowNameRegEx=true) const =0
 Get the persistence info for a specific base data property and mime type. More...
 
virtual InfoResultType GetInfoByKey (const std::string &persistenceKey, bool allowKeyRegEx=true) const =0
 Get the persistence info that will use the specified key. More...
 
virtual bool HasInfo (const std::string &propertyName, bool allowNameRegEx=true) const =0
 Check if a specific base data property has persistence info. More...
 
virtual void RemoveAllInfo ()=0
 Remove all persistence info. More...
 
virtual void RemoveInfo (const std::string &propertyName)=0
 Remove persistence info instances of a specific property name/regex. More...
 
virtual void RemoveInfo (const std::string &propertyName, const MimeTypeNameType &mime)=0
 Remove persistence info instances of a specific property name/regex and mime type. More...
 

Detailed Description

Interface of property persistence service.

This service allows you to manage persistence info for base data properties. Persistent properties will be saved if the file format supports custom key value pairs like the .nrrd file format.

Remarks
The service supports the use of regular expressions (regex; ECMAscript syntax) for property names and persistance keys to specify persistence rules in a generic way. The getter of the interface (GetInfo and GetInfoByKey) will always ensure that the return contains no regex, thus name and key in the results can directly be used.

Definition at line 33 of file mitkIPropertyPersistence.h.

Member Typedef Documentation

◆ InfoResultType

◆ MimeTypeNameType

Constructor & Destructor Documentation

◆ ~IPropertyPersistence()

virtual mitk::IPropertyPersistence::~IPropertyPersistence ( )
virtual

Member Function Documentation

◆ AddInfo()

virtual bool mitk::IPropertyPersistence::AddInfo ( const PropertyPersistenceInfo info,
bool  overwrite = false 
)
pure virtual

Add persistence info for a specific base data property. If there is already a property info instance for the passed property name and the same info, it won't be added. Info instances are regarded equal, if the mime types are equal. You may enforce to overwrite the old equal info for a property name by the overwrite parameter.

Parameters
[in]infoPersistence info of the property.
[in]overwriteOverwrite already existing persistence info.
Returns
True if persistence info was added successfully.

Implemented in mitk::PropertyPersistence.

◆ GetInfo() [1/2]

virtual InfoResultType mitk::IPropertyPersistence::GetInfo ( const std::string &  propertyName,
bool  allowNameRegEx = true 
) const
pure virtual

Get the persistence info for a specific base data property.

Parameters
[in]propertyNameName of the property.
[in]allowNameRegExIndicates if also added info instances with regexs are being checked.
Returns
Property persistence info or null pointer if no persistence info is available.

Implemented in mitk::PropertyPersistence.

◆ GetInfo() [2/2]

virtual InfoResultType mitk::IPropertyPersistence::GetInfo ( const std::string &  propertyName,
const MimeTypeNameType mime,
bool  allowMimeWildCard = false,
bool  allowNameRegEx = true 
) const
pure virtual

Get the persistence info for a specific base data property and mime type.

Parameters
[in]propertyNameName of the property.
[in]mimeName of the mime type the info is specified for.
[in]allowMimeWildCardIndicates if wildcard is allowed. If it is allowed, the method will first try to find the specified info. If no info was found but an info exists with the mime type name PropertyPersistenceInfo::ANY_MIMETYPE_NAME(), the later info will be returned as fall back option.
[in]allowNameRegExIndicates if also added info instances with regexs are being checked.
Returns
Property persistence info or null pointer if no persistence info is available.

Implemented in mitk::PropertyPersistence.

◆ GetInfoByKey()

virtual InfoResultType mitk::IPropertyPersistence::GetInfoByKey ( const std::string &  persistenceKey,
bool  allowKeyRegEx = true 
) const
pure virtual

Get the persistence info that will use the specified key.

Parameters
[in]persistenceKeyName of the property.
[in]allowKeyRegExIndicates if also added info instances with regexs for the key are being checked.
Returns
Property persistence info or null pointer if no persistence info is available.

Implemented in mitk::PropertyPersistence.

◆ HasInfo()

virtual bool mitk::IPropertyPersistence::HasInfo ( const std::string &  propertyName,
bool  allowNameRegEx = true 
) const
pure virtual

Check if a specific base data property has persistence info.

Parameters
[in]propertyNameName of the property.
[in]allowNameRegExIndicates if also added info instances with regexs are being checked.
Returns
True if the property has persistence info, false otherwise.

Implemented in mitk::PropertyPersistence.

◆ RemoveAllInfo()

virtual void mitk::IPropertyPersistence::RemoveAllInfo ( )
pure virtual

Remove all persistence info.

Implemented in mitk::PropertyPersistence.

◆ RemoveInfo() [1/2]

virtual void mitk::IPropertyPersistence::RemoveInfo ( const std::string &  propertyName)
pure virtual

Remove persistence info instances of a specific property name/regex.

Parameters
[in]propertyNameRegistered name or regex that should be removed.

Implemented in mitk::PropertyPersistence.

◆ RemoveInfo() [2/2]

virtual void mitk::IPropertyPersistence::RemoveInfo ( const std::string &  propertyName,
const MimeTypeNameType mime 
)
pure virtual

Remove persistence info instances of a specific property name/regex and mime type.

Parameters
[in]propertyNameRegistered name or regex that should be removed.
[in]mimeName of the mime type.

Implemented in mitk::PropertyPersistence.


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