Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::IPreferencesStorage Class Referenceabstract

The backend for persistent preferences. More...

#include <mitkIPreferencesStorage.h>

Inheritance diagram for mitk::IPreferencesStorage:
Collaboration diagram for mitk::IPreferencesStorage:

Public Member Functions

 IPreferencesStorage (const fs::path &filename)
 Constructor. Load preferences from the specified file. More...
 
virtual ~IPreferencesStorage ()
 Destructor. Write preferences to disk for the last time. More...
 
virtual IPreferencesGetRoot ()
 Get the preferences root node. More...
 
virtual const IPreferencesGetRoot () const
 
virtual fs::path GetFilename () const
 Get the filename of the preferences storage. More...
 
virtual void Flush ()=0
 Write the in-memory preferences to disk. More...
 

Protected Attributes

fs::path m_Filename
 
std::unique_ptr< IPreferencesm_Root
 

Detailed Description

The backend for persistent preferences.

This interface and its implementation is internally used by the IPreferencesService to hold the preferences root node and to store and restore the preferences from disk.

Definition at line 31 of file mitkIPreferencesStorage.h.

Constructor & Destructor Documentation

◆ IPreferencesStorage()

mitk::IPreferencesStorage::IPreferencesStorage ( const fs::path &  filename)
explicit

Constructor. Load preferences from the specified file.

If the file does not yet exist, create an empty preferences storage.

◆ ~IPreferencesStorage()

virtual mitk::IPreferencesStorage::~IPreferencesStorage ( )
virtual

Destructor. Write preferences to disk for the last time.

Member Function Documentation

◆ Flush()

virtual void mitk::IPreferencesStorage::Flush ( )
pure virtual

Write the in-memory preferences to disk.

Usually called by clients indirectly through IPreferences::Flush().

Implemented in mitk::XMLPreferencesStorage.

◆ GetFilename()

virtual fs::path mitk::IPreferencesStorage::GetFilename ( ) const
virtual

Get the filename of the preferences storage.

◆ GetRoot() [1/2]

virtual IPreferences* mitk::IPreferencesStorage::GetRoot ( )
virtual

Get the preferences root node.

The preferences root node is owned by the preferences storage.

◆ GetRoot() [2/2]

virtual const IPreferences* mitk::IPreferencesStorage::GetRoot ( ) const
virtual
See also
GetRoot()

Member Data Documentation

◆ m_Filename

fs::path mitk::IPreferencesStorage::m_Filename
protected

Definition at line 71 of file mitkIPreferencesStorage.h.

◆ m_Root

std::unique_ptr<IPreferences> mitk::IPreferencesStorage::m_Root
protected

Definition at line 72 of file mitkIPreferencesStorage.h.


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