|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Property persistence info. More...
#include <mitkPropertyPersistenceInfo.h>


Public Types | |
| using | DeserializationFunctionType = std::function< mitk::BaseProperty::Pointer(const std::string &)> |
| Signature specification for functions that can be provided for deserialization of the property. More... | |
| using | SerializationFunctionType = std::function< std::string(const mitk::BaseProperty *)> |
| Signature specification for functions that can be provided for serialization of the property. More... | |
| using | MimeTypeNameType = std::string |
| Type alias for MIME type name strings. More... | |
Public Member Functions | |
| mitkClassMacroItkParent (PropertyPersistenceInfo, itk::LightObject) | |
| Pointer | Clone () const |
| mitkNewMacro1Param (Self, const std::string &) | |
| mitkNewMacro2Param (Self, const std::string &, const std::string &) | |
| std::string | GetName () const |
| Get the property name described by this info. More... | |
| std::string | GetKey () const |
| Get the persistence key used for this property. More... | |
| void | SetName (const std::string &name) |
| Set the property name (and key to the same value). More... | |
| void | SetNameAndKey (const std::string &name, const std::string &key) |
| Set name and key independently. More... | |
| bool | IsRegEx () const |
| Check whether this info uses regular expressions for name and key matching. More... | |
| void | UseRegEx (const std::string &nameRegEx, const std::string &nameTemplate) |
| Set the name and key as a regular expression with a shared template. More... | |
| void | UseRegEx (const std::string &nameRegEx, const std::string &nameTemplate, const std::string &keyRegEx, const std::string keyTemplate) |
| Set the name and key as separate regular expressions with individual templates. More... | |
| const std::string & | GetKeyTemplate () const |
| Get the template string used for generating concrete keys from regex groups. More... | |
| const std::string & | GetNameTemplate () const |
| Get the template string used for generating concrete names from regex groups. More... | |
| const MimeTypeNameType & | GetMimeTypeName () const |
| Get the MIME type name this persistence info is associated with. More... | |
| void | SetMimeTypeName (const MimeTypeNameType &mimeTypeName) |
| Set the MIME type name this persistence info should be associated with. More... | |
| const DeserializationFunctionType | GetDeserializationFunction () const |
| Get the deserialization function used to convert a string back to a property. More... | |
| void | SetDeserializationFunction (const DeserializationFunctionType &fnc) |
| Set the deserialization function. More... | |
| const SerializationFunctionType | GetSerializationFunction () const |
| Get the serialization function used to convert a property to a string. More... | |
| void | SetSerializationFunction (const SerializationFunctionType &fnc) |
| Set the serialization function. More... | |
| PropertyPersistenceInfo::Pointer | UnRegExByName (const std::string &propertyName) const |
| Create a non-regex info by resolving the regex against a property name. More... | |
| PropertyPersistenceInfo::Pointer | UnRegExByKey (const std::string &key) const |
| Create a non-regex info by resolving the regex against a persistence key. More... | |
Static Public Member Functions | |
| static Pointer | New () |
| static MimeTypeNameType | ANY_MIMETYPE_NAME () |
| Return the MIME type name that indicates compatibility with any MIME type. More... | |
Protected Member Functions | |
| PropertyPersistenceInfo (const std::string &name="") | |
| Constructor. More... | |
| PropertyPersistenceInfo (const std::string &name, const std::string &mimeTypeName) | |
| Constructor. More... | |
| ~PropertyPersistenceInfo () override | |
| void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Property persistence info.
This class is used to specify the way the persistence of a property of BaseData derived instances is handled. The info specifies the key for property, as well as the mime type the info is defined for and should be used. Additionally the functions for deserialization and serialization of the property can be defined. By default, serialization uses BaseProperty::GetValueAsString() and deserialization creates a StringProperty.
Definition at line 33 of file mitkPropertyPersistenceInfo.h.
| using mitk::PropertyPersistenceInfo::DeserializationFunctionType = std::function<mitk::BaseProperty::Pointer(const std::string &)> |
Signature specification for functions that can be provided for deserialization of the property.
Definition at line 39 of file mitkPropertyPersistenceInfo.h.
| using mitk::PropertyPersistenceInfo::MimeTypeNameType = std::string |
Type alias for MIME type name strings.
Definition at line 45 of file mitkPropertyPersistenceInfo.h.
| using mitk::PropertyPersistenceInfo::SerializationFunctionType = std::function<std::string(const mitk::BaseProperty *)> |
Signature specification for functions that can be provided for serialization of the property.
Definition at line 42 of file mitkPropertyPersistenceInfo.h.
|
protected |
Constructor.
| [in] | name | Name is the name of the property that described by the info. Key will be the same. |
|
protected |
Constructor.
| [in] | name | Name is the name of the property that described by the info. Key will be the same. |
| [in] | mimeTypeName | mime type the info is defined for. |
|
overrideprotected |
|
static |
Return the MIME type name that indicates compatibility with any MIME type.
An info using this MIME type name will be used as a fallback when no info with a more specific MIME type is available.
| Pointer mitk::PropertyPersistenceInfo::Clone | ( | ) | const |
| const DeserializationFunctionType mitk::PropertyPersistenceInfo::GetDeserializationFunction | ( | ) | const |
Get the deserialization function used to convert a string back to a property.
| std::string mitk::PropertyPersistenceInfo::GetKey | ( | ) | const |
Get the persistence key used for this property.
The key is used as identifier when the property is persisted (e.g. as DICOM tag or file key). By default, the key equals the name.
| const std::string& mitk::PropertyPersistenceInfo::GetKeyTemplate | ( | ) | const |
Get the template string used for generating concrete keys from regex groups.
| const MimeTypeNameType& mitk::PropertyPersistenceInfo::GetMimeTypeName | ( | ) | const |
Get the MIME type name this persistence info is associated with.
| std::string mitk::PropertyPersistenceInfo::GetName | ( | ) | const |
Get the property name described by this info.
| const std::string& mitk::PropertyPersistenceInfo::GetNameTemplate | ( | ) | const |
Get the template string used for generating concrete names from regex groups.
| const SerializationFunctionType mitk::PropertyPersistenceInfo::GetSerializationFunction | ( | ) | const |
Get the serialization function used to convert a property to a string.
| bool mitk::PropertyPersistenceInfo::IsRegEx | ( | ) | const |
Check whether this info uses regular expressions for name and key matching.
| mitk::PropertyPersistenceInfo::mitkClassMacroItkParent | ( | PropertyPersistenceInfo | , |
| itk::LightObject | |||
| ) |
| mitk::PropertyPersistenceInfo::mitkNewMacro1Param | ( | Self | , |
| const std::string & | |||
| ) |
| mitk::PropertyPersistenceInfo::mitkNewMacro2Param | ( | Self | , |
| const std::string & | , | ||
| const std::string & | |||
| ) |
|
static |
|
overrideprotected |
| void mitk::PropertyPersistenceInfo::SetDeserializationFunction | ( | const DeserializationFunctionType & | fnc | ) |
Set the deserialization function.
| [in] | fnc | Function that converts a serialized string to a BaseProperty. |
| void mitk::PropertyPersistenceInfo::SetMimeTypeName | ( | const MimeTypeNameType & | mimeTypeName | ) |
Set the MIME type name this persistence info should be associated with.
| [in] | mimeTypeName | The MIME type name. |
| void mitk::PropertyPersistenceInfo::SetName | ( | const std::string & | name | ) |
Set the property name (and key to the same value).
Resets any regular expression settings.
| [in] | name | The property name. |
| void mitk::PropertyPersistenceInfo::SetNameAndKey | ( | const std::string & | name, |
| const std::string & | key | ||
| ) |
Set name and key independently.
Resets any regular expression settings.
| [in] | name | The property name. |
| [in] | key | The persistence key. |
| void mitk::PropertyPersistenceInfo::SetSerializationFunction | ( | const SerializationFunctionType & | fnc | ) |
Set the serialization function.
| [in] | fnc | Function that converts a BaseProperty to a serialized string. |
| PropertyPersistenceInfo::Pointer mitk::PropertyPersistenceInfo::UnRegExByKey | ( | const std::string & | key | ) | const |
Create a non-regex info by resolving the regex against a persistence key.
If this info is a regex, generates a concrete PropertyPersistenceInfo by applying the key to the name template. If not a regex, returns a copy.
| [in] | key | The concrete persistence key to resolve against. |
| PropertyPersistenceInfo::Pointer mitk::PropertyPersistenceInfo::UnRegExByName | ( | const std::string & | propertyName | ) | const |
Create a non-regex info by resolving the regex against a property name.
If this info is a regex, generates a concrete PropertyPersistenceInfo by applying the name to the key template. If not a regex, returns a copy.
| [in] | propertyName | The concrete property name to resolve against. |
| void mitk::PropertyPersistenceInfo::UseRegEx | ( | const std::string & | nameRegEx, |
| const std::string & | nameTemplate | ||
| ) |
Set the name and key as a regular expression with a shared template.
Both name and key will use the same regex and template.
| [in] | nameRegEx | Regular expression for matching property names. |
| [in] | nameTemplate | Template string for generating concrete names from regex groups. |
| void mitk::PropertyPersistenceInfo::UseRegEx | ( | const std::string & | nameRegEx, |
| const std::string & | nameTemplate, | ||
| const std::string & | keyRegEx, | ||
| const std::string | keyTemplate | ||
| ) |
Set the name and key as separate regular expressions with individual templates.
| [in] | nameRegEx | Regular expression for matching property names. |
| [in] | nameTemplate | Template string for generating concrete names from regex groups. |
| [in] | keyRegEx | Regular expression for matching persistence keys. |
| [in] | keyTemplate | Template string for generating concrete keys from regex groups. |