13 #ifndef mitkPropertyPersistenceInfo_h
14 #define mitkPropertyPersistenceInfo_h
22 #include <itkObjectFactory.h>
48 itkFactorylessNewMacro(Self);
89 void UseRegEx(
const std::string &nameRegEx,
const std::string &nameTemplate);
103 const std::string &nameTemplate,
104 const std::string &keyRegEx,
105 const std::string keyTemplate);
144 PropertyPersistenceInfo::Pointer
UnRegExByName(
const std::string &propertyName)
const;
153 PropertyPersistenceInfo::Pointer
UnRegExByKey(
const std::string &key)
const;
178 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
182 Self &operator=(
const Self &other);
192 namespace PropertyPersistenceSerialization
202 namespace PropertyPersistenceDeserialization
Abstract base class for properties.
Property persistence info.
const DeserializationFunctionType GetDeserializationFunction() const
Get the deserialization function used to convert a string back to a property.
const MimeTypeNameType & GetMimeTypeName() const
Get the MIME type name this persistence info is associated with.
void SetName(const std::string &name)
Set the property name (and key to the same value).
std::string GetKey() const
Get the persistence key used for this property.
std::function< mitk::BaseProperty::Pointer(const std::string &)> DeserializationFunctionType
Signature specification for functions that can be provided for deserialization of the property.
void SetMimeTypeName(const MimeTypeNameType &mimeTypeName)
Set the MIME type name this persistence info should be associated with.
PropertyPersistenceInfo::Pointer UnRegExByName(const std::string &propertyName) const
Create a non-regex info by resolving the regex against a property name.
const SerializationFunctionType GetSerializationFunction() const
Get the serialization function used to convert a property to a string.
PropertyPersistenceInfo(const std::string &name="")
Constructor.
std::function< std::string(const mitk::BaseProperty *)> SerializationFunctionType
Signature specification for functions that can be provided for serialization of the property.
bool IsRegEx() const
Check whether this info uses regular expressions for name and key matching.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
std::string GetName() const
Get the property name described by this info.
const std::string & GetKeyTemplate() const
Get the template string used for generating concrete keys from regex groups.
PropertyPersistenceInfo(const std::string &name, const std::string &mimeTypeName)
Constructor.
void UseRegEx(const std::string &nameRegEx, const std::string &nameTemplate)
Set the name and key as a regular expression with a shared template.
mitkNewMacro2Param(Self, const std::string &, const std::string &)
std::string MimeTypeNameType
Type alias for MIME type name strings.
void SetNameAndKey(const std::string &name, const std::string &key)
Set name and key independently.
void SetDeserializationFunction(const DeserializationFunctionType &fnc)
Set the deserialization function.
PropertyPersistenceInfo::Pointer UnRegExByKey(const std::string &key) const
Create a non-regex info by resolving the regex against a persistence key.
const std::string & GetNameTemplate() const
Get the template string used for generating concrete names from regex groups.
~PropertyPersistenceInfo() override
static MimeTypeNameType ANY_MIMETYPE_NAME()
Return the MIME type name that indicates compatibility with any MIME type.
mitkClassMacroItkParent(PropertyPersistenceInfo, itk::LightObject)
void SetSerializationFunction(const SerializationFunctionType &fnc)
Set the serialization function.
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.
#define mitkNewMacro1Param(classname, type)
MITKCORE_EXPORT mitk::BaseProperty::Pointer deserializeToStringProperty(const std::string &value)
Default deserialization that creates a StringProperty from the passed string.
MITKCORE_EXPORT::std::string serializeByGetValueAsString(const mitk::BaseProperty *prop)
Default serialization that uses BaseProperty::GetValueAsString().
Find image slices visible on a given plane.
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
Stream output operator for DataNode smart pointers.