Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitk::PropertyPersistenceInfo Class Reference

Property persistence info. This class is used to specify the way the persistance 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. As default. More...

#include <mitkPropertyPersistenceInfo.h>

Inheritance diagram for mitk::PropertyPersistenceInfo:
Collaboration diagram for mitk::PropertyPersistenceInfo:

Public Types

using DeserializationFunctionType = std::function< mitk::BaseProperty::Pointer(const std::string &)>
 
using SerializationFunctionType = std::function< std::string(const mitk::BaseProperty *)>
 
using MimeTypeNameType = std::string
 
typedef PropertyPersistenceInfo Self
 
typedef itk::LightObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
std::string GetName () const
 
std::string GetKey () const
 
void SetName (const std::string &name)
 
void SetNameAndKey (const std::string &name, const std::string &key)
 
bool IsRegEx () const
 
void UseRegEx (const std::string &nameRegEx, const std::string &nameTemplate)
 
void UseRegEx (const std::string &nameRegEx, const std::string &nameTemplate, const std::string &keyRegEx, const std::string keyTemplate)
 
const std::string & GetKeyTemplate () const
 
const std::string & GetNameTemplate () const
 
const MimeTypeNameTypeGetMimeTypeName () const
 
void SetMimeTypeName (const MimeTypeNameType &mimeTypeName)
 
const DeserializationFunctionType GetDeserializationFunction () const
 
void SetDeserializationFunction (const DeserializationFunctionType &fnc)
 
const SerializationFunctionType GetSerializationFunction () const
 
void SetSerializationFunction (const SerializationFunctionType &fnc)
 
PropertyPersistenceInfo::Pointer UnRegExByName (const std::string &propertyName) const
 
PropertyPersistenceInfo::Pointer UnRegExByKey (const std::string &key) const
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
static Pointer New (const std::string &_arg)
 
static Pointer New (const std::string &_arga, const std::string &_argb)
 
static MimeTypeNameType ANY_MIMETYPE_NAME ()
 

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
 

Detailed Description

Property persistence info. This class is used to specify the way the persistance 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. As default.

Definition at line 32 of file mitkPropertyPersistenceInfo.h.

Member Typedef Documentation

◆ ConstPointer

◆ DeserializationFunctionType

Signature specification for functions that can be provided for deserialization of the property.

Postcondition
The function returns a valid instance derived from mitk::BaseProperty.

Definition at line 37 of file mitkPropertyPersistenceInfo.h.

◆ MimeTypeNameType

Definition at line 39 of file mitkPropertyPersistenceInfo.h.

◆ Pointer

◆ Self

◆ SerializationFunctionType

Definition at line 38 of file mitkPropertyPersistenceInfo.h.

◆ Superclass

Definition at line 41 of file mitkPropertyPersistenceInfo.h.

Constructor & Destructor Documentation

◆ PropertyPersistenceInfo() [1/2]

mitk::PropertyPersistenceInfo::PropertyPersistenceInfo ( const std::string &  name = "")
protected

Constructor.

Parameters
[in]nameName is the name of the property that described by the info. Key will be the same.

◆ PropertyPersistenceInfo() [2/2]

mitk::PropertyPersistenceInfo::PropertyPersistenceInfo ( const std::string &  name,
const std::string &  mimeTypeName 
)
protected

Constructor.

Parameters
[in]nameName is the name of the property that described by the info. Key will be the same.
[in]mimeTypeNamemime type the info is defined for.

◆ ~PropertyPersistenceInfo()

mitk::PropertyPersistenceInfo::~PropertyPersistenceInfo ( )
overrideprotected

Member Function Documentation

◆ ANY_MIMETYPE_NAME()

static MimeTypeNameType mitk::PropertyPersistenceInfo::ANY_MIMETYPE_NAME ( )
static

This mime type name indicates that a info can be used for any mime type as long as another info with a more specific mime type is not available.

◆ Clone()

Pointer mitk::PropertyPersistenceInfo::Clone ( ) const

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::PropertyPersistenceInfo::GetClassHierarchy ( ) const
inlinevirtual

Definition at line 41 of file mitkPropertyPersistenceInfo.h.

◆ GetClassName()

virtual const char* mitk::PropertyPersistenceInfo::GetClassName ( ) const
virtual

◆ GetDeserializationFunction()

const DeserializationFunctionType mitk::PropertyPersistenceInfo::GetDeserializationFunction ( ) const

◆ GetKey()

std::string mitk::PropertyPersistenceInfo::GetKey ( ) const

◆ GetKeyTemplate()

const std::string& mitk::PropertyPersistenceInfo::GetKeyTemplate ( ) const

◆ GetMimeTypeName()

const MimeTypeNameType& mitk::PropertyPersistenceInfo::GetMimeTypeName ( ) const

◆ GetName()

std::string mitk::PropertyPersistenceInfo::GetName ( ) const

◆ GetNameTemplate()

const std::string& mitk::PropertyPersistenceInfo::GetNameTemplate ( ) const

◆ GetSerializationFunction()

const SerializationFunctionType mitk::PropertyPersistenceInfo::GetSerializationFunction ( ) const

◆ GetStaticNameOfClass()

static const char* mitk::PropertyPersistenceInfo::GetStaticNameOfClass ( )
inlinestatic

Definition at line 41 of file mitkPropertyPersistenceInfo.h.

◆ IsRegEx()

bool mitk::PropertyPersistenceInfo::IsRegEx ( ) const

◆ New() [1/3]

static Pointer mitk::PropertyPersistenceInfo::New ( )
static

◆ New() [2/3]

static Pointer mitk::PropertyPersistenceInfo::New ( const std::string &  _arg)
inlinestatic

Definition at line 43 of file mitkPropertyPersistenceInfo.h.

◆ New() [3/3]

static Pointer mitk::PropertyPersistenceInfo::New ( const std::string &  _arga,
const std::string &  _argb 
)
inlinestatic

Definition at line 44 of file mitkPropertyPersistenceInfo.h.

◆ PrintSelf()

void mitk::PropertyPersistenceInfo::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ SetDeserializationFunction()

void mitk::PropertyPersistenceInfo::SetDeserializationFunction ( const DeserializationFunctionType fnc)

◆ SetMimeTypeName()

void mitk::PropertyPersistenceInfo::SetMimeTypeName ( const MimeTypeNameType mimeTypeName)

◆ SetName()

void mitk::PropertyPersistenceInfo::SetName ( const std::string &  name)

◆ SetNameAndKey()

void mitk::PropertyPersistenceInfo::SetNameAndKey ( const std::string &  name,
const std::string &  key 
)

◆ SetSerializationFunction()

void mitk::PropertyPersistenceInfo::SetSerializationFunction ( const SerializationFunctionType fnc)

◆ UnRegExByKey()

PropertyPersistenceInfo::Pointer mitk::PropertyPersistenceInfo::UnRegExByKey ( const std::string &  key) const

◆ UnRegExByName()

PropertyPersistenceInfo::Pointer mitk::PropertyPersistenceInfo::UnRegExByName ( const std::string &  propertyName) const

◆ UseRegEx() [1/2]

void mitk::PropertyPersistenceInfo::UseRegEx ( const std::string &  nameRegEx,
const std::string &  nameTemplate 
)

Sets the name and the key identifier as a regular expression that describes valid names and keys.

Precondition
nameRegEx must be a valid regular expression, otherwise a regex_error esception is thrown and the info object is not changed.
keyRegEx must be a valid regular expression, otherwise a regex_error esception is thrown and the info object is not changed.

◆ UseRegEx() [2/2]

void mitk::PropertyPersistenceInfo::UseRegEx ( const std::string &  nameRegEx,
const std::string &  nameTemplate,
const std::string &  keyRegEx,
const std::string  keyTemplate 
)

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