Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkIPreferencesStorage.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 mitkIPreferencesStorage_h
14 #define mitkIPreferencesStorage_h
15 
16 #include <mitkIPreferences.h>
17 
18 #include <MitkCoreExports.h>
19 
20 #include <mitkFileSystem.h>
21 #include <memory>
22 
23 namespace mitk
24 {
32  {
33  public:
39  explicit IPreferencesStorage(const fs::path& filename);
40 
45 
51  virtual IPreferences* GetRoot();
52 
56  virtual const IPreferences* GetRoot() const;
57 
61  virtual fs::path GetFilename() const;
62 
68  virtual void Flush() = 0;
69 
70  protected:
71  fs::path m_Filename;
72  std::unique_ptr<IPreferences> m_Root;
73  };
74 }
75 
76 #endif
#define MITKCORE_EXPORT
The backend for persistent preferences.
virtual IPreferences * GetRoot()
Get the preferences root node.
IPreferencesStorage(const fs::path &filename)
Constructor. Load preferences from the specified file.
virtual ~IPreferencesStorage()
Destructor. Write preferences to disk for the last time.
virtual void Flush()=0
Write the in-memory preferences to disk.
std::unique_ptr< IPreferences > m_Root
virtual const IPreferences * GetRoot() const
virtual fs::path GetFilename() const
Get the filename of the preferences storage.
Interface to application preferences.
Find image slices visible on a given plane.