Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkPropertyPersistence_h
18 #define mitkPropertyPersistence_h
19 
20 #include <map>
22 
23 namespace mitk
24 {
26  {
27  public:
30 
32 
33  bool AddInfo(const PropertyPersistenceInfo *info, bool overwrite) override;
34  InfoResultType GetInfo(const std::string &propertyName, bool allowNameRegEx) const override;
35  InfoResultType GetInfo(const std::string &propertyName,
36  const MimeTypeNameType &mime,
37  bool allowMimeWildCard,
38  bool allowNameRegEx) const override;
39  InfoResultType GetInfoByKey(const std::string &persistenceKey, bool allowKeyRegEx) const override;
40  bool HasInfo(const std::string &propertyName, bool allowNameRegEx) const override;
41  void RemoveAllInfo() override;
42  void RemoveInfo(const std::string &propertyName) override;
43  void RemoveInfo(const std::string &propertyName, const MimeTypeNameType &mime) override;
44 
45  private:
46  typedef std::multimap<const std::string, PropertyPersistenceInfo::ConstPointer> InfoMap;
47 
49  using SelectFunctionType = std::function<bool(const InfoMap::value_type &)>;
50  static InfoMap SelectInfo(const InfoMap &infoMap, const SelectFunctionType &selectFunction);
51 
53  PropertyPersistence &operator=(const PropertyPersistence &);
54 
55  InfoMap m_InfoMap;
56  };
57 
60 }
61 
62 #endif
void RemoveAllInfo() override
Remove all persistence info.
#define MITKCORE_EXPORT
InfoResultType GetInfo(const std::string &propertyName, bool allowNameRegEx) const override
Get the persistence info for a specific base data property.
void RemoveInfo(const std::string &propertyName) override
Remove persistence info instances of a specific property name/regex.
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT IPropertyPersistence * CreateTestInstancePropertyPersistence()
IPropertyPersistence::InfoResultType InfoResultType
static void info(const char *fmt,...)
Definition: svm.cpp:100
Property persistence info. This class is used to specify the way the persistance of a property of Bas...
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 ...
bool HasInfo(const std::string &propertyName, bool allowNameRegEx) const override
Check if a specific base data property has persistence info.
Interface of property persistence service.
std::list< PropertyPersistenceInfo::ConstPointer > InfoResultType
InfoResultType GetInfoByKey(const std::string &persistenceKey, bool allowKeyRegEx) const override
Get the persistence info that will use the specified key.
PropertyPersistenceInfo::MimeTypeNameType MimeTypeNameType