Medical Imaging Interaction Toolkit  2016.11.0
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...
 
virtual ~PropertyPersistenceInfo ()
 
virtual 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 36 of file mitkPropertyPersistenceInfo.h.

Member Typedef Documentation

Definition at line 41 of file mitkPropertyPersistenceInfo.h.

Definition at line 40 of file mitkPropertyPersistenceInfo.h.

Definition at line 43 of file mitkPropertyPersistenceInfo.h.

Constructor & Destructor Documentation

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.

Definition at line 54 of file mitkPropertyPersistenceInfo.cpp.

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.

Definition at line 60 of file mitkPropertyPersistenceInfo.cpp.

mitk::PropertyPersistenceInfo::~PropertyPersistenceInfo ( )
protectedvirtual

Definition at line 68 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

Member Function Documentation

mitk::PropertyPersistenceInfo::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.

Definition at line 229 of file mitkPropertyPersistenceInfo.cpp.

References mitk::IOMimeTypes::DEFAULT_BASE_NAME().

Referenced by mitk::PropertyPersistence::GetInfo(), and mitk::ItkImageIO::Read().

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

Definition at line 43 of file mitkPropertyPersistenceInfo.h.

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

Definition at line 151 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 78 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 130 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 140 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

Referenced by mitk::PropertyPersistence::AddInfo().

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

Definition at line 73 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

Referenced by mitk::PropertyPersistence::AddInfo().

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

Definition at line 135 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 162 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 43 of file mitkPropertyPersistenceInfo.h.

bool mitk::PropertyPersistenceInfo::IsRegEx ( ) const

Definition at line 125 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 44 of file mitkPropertyPersistenceInfo.h.

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

Definition at line 45 of file mitkPropertyPersistenceInfo.h.

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

Definition at line 235 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 156 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 145 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 83 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 92 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 168 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 215 of file mitkPropertyPersistenceInfo.cpp.

References GenerateFromTemplate(), mitk::m_Impl, and New().

mitk::PropertyPersistenceInfo::Pointer mitk::PropertyPersistenceInfo::UnRegExByName ( const std::string &  propertyName) const
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, otherweis a regex_error esception is thrown and the info object is not changed.
keyRegEx must be a valid regular expression, otherweis a regex_error esception is thrown and the info object is not changed.

Definition at line 101 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.

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

Definition at line 111 of file mitkPropertyPersistenceInfo.cpp.

References mitk::m_Impl.


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