HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::preferences Class Reference

#include <ttauri/preferences.hpp>

Public Member Functions

 preferences (URL location) noexcept
 
 preferences (preferences const &)=delete
 
 preferences (preferences &&)=delete
 
preferencesoperator= (preferences const &)=delete
 
preferencesoperator= (preferences &&)=delete
 
virtual void reset () noexcept
 Reset data members to their default value.
 
void save () const noexcept
 Save the preferences.
 
void load () noexcept
 Load the preferences.
 
virtual datum serialize () const noexcept
 Serialize the preferences data.
 
virtual void deserialize (datum const &data) noexcept
 Deserialize the preferences.
 

Data Fields

std::recursive_mutex mutex
 

Detailed Description

user preferences.

User preferences are kept in an instance of the preferences subclass.

This class will automatically load preferences from the location given in its constructor and save the preferences when they are modified.

The saving if preferences is delayed to combine multiple modification into a single save. By locking the mutex external to the preferences multiple modifications can be stored atomically.

Member Function Documentation

◆ deserialize()

virtual void tt::preferences::deserialize ( datum const & data)
inlinevirtualnoexcept

Deserialize the preferences.

The deserialize method is called when the preferences are loaded. A subclass should implement the deserialize() to read the data and rebuild its members. It should ignore any data it does not know about.

It is recommended to call super::deserialize() from subclass implementations.

◆ load()

void tt::preferences::load ( )
noexcept

Load the preferences.

◆ reset()

virtual void tt::preferences::reset ( )
inlinevirtualnoexcept

Reset data members to their default value.

◆ save()

void tt::preferences::save ( ) const
noexcept

Save the preferences.

◆ serialize()

virtual datum tt::preferences::serialize ( ) const
inlinevirtualnoexcept

Serialize the preferences data.

The serialize method is called when the preferences need to be saved. A subclass should implement serialize() to serialize all the members of its class.

It is recommended to call super::serialize() from subclass implementations.


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