Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPropertyPersistence.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkPropertyPersistence_h
14 #define mitkPropertyPersistence_h
15 
16 #include <map>
18 
19 namespace mitk
20 {
30  {
31  public:
34 
36 
38  bool AddInfo(const PropertyPersistenceInfo *info, bool overwrite) override;
40  InfoResultType GetInfo(const std::string &propertyName, bool allowNameRegEx) const override;
42  InfoResultType GetInfo(const std::string &propertyName,
43  const MimeTypeNameType &mime,
44  bool allowMimeWildCard,
45  bool allowNameRegEx) const override;
47  InfoResultType GetInfoByKey(const std::string &persistenceKey, bool allowKeyRegEx) const override;
49  bool HasInfo(const std::string &propertyName, bool allowNameRegEx) const override;
51  void RemoveAllInfo() override;
53  void RemoveInfo(const std::string &propertyName) override;
55  void RemoveInfo(const std::string &propertyName, const MimeTypeNameType &mime) override;
56 
57  private:
58  typedef std::multimap<const std::string, PropertyPersistenceInfo::ConstPointer> InfoMap;
59 
61  using SelectFunctionType = std::function<bool(const InfoMap::value_type &)>;
62  static InfoMap SelectInfo(const InfoMap &infoMap, const SelectFunctionType &selectFunction);
63 
65  PropertyPersistence &operator=(const PropertyPersistence &);
66 
67  InfoMap m_InfoMap;
68  };
69 
77 }
78 
79 #endif
#define MITKCORE_EXPORT
Interface of property persistence service.
std::list< PropertyPersistenceInfo::ConstPointer > InfoResultType
PropertyPersistenceInfo::MimeTypeNameType MimeTypeNameType
Implementation of the IPropertyPersistence service interface.
void RemoveInfo(const std::string &propertyName, const MimeTypeNameType &mime) override
Remove persistence info instances of a specific property name/regex and mime type.
void RemoveInfo(const std::string &propertyName) override
Remove persistence info instances of a specific property name/regex.
bool AddInfo(const PropertyPersistenceInfo *info, bool overwrite) override
Add persistence info for a specific base data property. If there is already a property info instance ...
void RemoveAllInfo() override
Remove all persistence info.
bool HasInfo(const std::string &propertyName, bool allowNameRegEx) const override
Check if a specific base data property has persistence info.
InfoResultType GetInfo(const std::string &propertyName, const MimeTypeNameType &mime, bool allowMimeWildCard, bool allowNameRegEx) const override
Get the persistence info for a specific base data property and mime type.
IPropertyPersistence::InfoResultType InfoResultType
InfoResultType GetInfo(const std::string &propertyName, bool allowNameRegEx) const override
Get the persistence info for a specific base data property.
InfoResultType GetInfoByKey(const std::string &persistenceKey, bool allowKeyRegEx) const override
Get the persistence info that will use the specified key.
Find image slices visible on a given plane.
MITKCORE_EXPORT IPropertyPersistence * CreateTestInstancePropertyPersistence()
Creates an unmanaged (!) instance of PropertyPersistence for testing purposes.