Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::PreferencesService Class Reference

Implementation of the IPreferencesService interface. More...

#include <mitkPreferencesService.h>

Inheritance diagram for mitk::PreferencesService:
Collaboration diagram for mitk::PreferencesService:

Public Member Functions

 PreferencesService ()
 
 ~PreferencesService () override
 
void InitializeStorage (const fs::path &filename) override
 Initialize the preferences backend. More...
 
void UninitializeStorage (bool removeFile) override
 For internal use only. More...
 
IPreferencesGetSystemPreferences () override
 Access preferences. More...
 
- Public Member Functions inherited from mitk::IPreferencesService
virtual ~IPreferencesService ()
 If initialized, ask the preferences backend to flush preferences, i.e. write them to disk. More...
 

Detailed Description

Implementation of the IPreferencesService interface.

Only used through the IPreferencesService interface.

See also
IPreferencesService

Definition at line 31 of file mitkPreferencesService.h.

Constructor & Destructor Documentation

◆ PreferencesService()

mitk::PreferencesService::PreferencesService ( )

◆ ~PreferencesService()

mitk::PreferencesService::~PreferencesService ( )
override

Member Function Documentation

◆ GetSystemPreferences()

IPreferences* mitk::PreferencesService::GetSystemPreferences ( )
overridevirtual

Access preferences.

The system preferences should be considered as resource and as such their lifetime is coupled to this service. It is recommended to access the preferences always through this method as needed instead of keeping a pointer permanently.

Note
The term "system preferences" is kept for historical reasons to stay as API-compatible as possible to the previous preferences service. A more precise term would be "application preferences".
Returns
The root node of the preferences tree.

Implements mitk::IPreferencesService.

◆ InitializeStorage()

void mitk::PreferencesService::InitializeStorage ( const fs::path &  filename)
overridevirtual

Initialize the preferences backend.

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

This method must be called once at the start of an application before accessing any preferences via GetSystemPreferences().

Exceptions
ExceptionThe method is called more than once.
See also
IPreferencesStorage

Implements mitk::IPreferencesService.

◆ UninitializeStorage()

void mitk::PreferencesService::UninitializeStorage ( bool  removeFile)
overridevirtual

For internal use only.

This method is only used for testing purposes. Do not use in production code.

Implements mitk::IPreferencesService.


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