stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::AllPreferencesLoader Class Referenceabstract
Inheritance diagram for stmg::AllPreferencesLoader:
Inheritance graph
[legend]

Public Member Functions

virtual ~AllPreferencesLoader () noexcept=default
 
virtual shared_ptr< AllPreferencesgetPreferences () const noexcept=0
 Load or create a new (or recycled) AllPreferences instance. More...
 
virtual shared_ptr< AllPreferencesgetPreferencesCopy (const shared_ptr< AllPreferences > &refAllPreferences) const noexcept=0
 Create a copy of an AllPreferences instance. More...
 
virtual bool updatePreferences (const shared_ptr< AllPreferences > &refAllPreferences) noexcept=0
 Persist an AllPreferences instance. More...
 

Constructor & Destructor Documentation

◆ ~AllPreferencesLoader()

virtual stmg::AllPreferencesLoader::~AllPreferencesLoader ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getPreferences()

virtual shared_ptr<AllPreferences> stmg::AllPreferencesLoader::getPreferences ( ) const
pure virtualnoexcept

Load or create a new (or recycled) AllPreferences instance.

If there is a persisted instance it is loaded, otherwise it is created with default values.

Returns
The instance. Is not null.

Implemented in stmg::XmlPreferencesLoader.

◆ getPreferencesCopy()

virtual shared_ptr<AllPreferences> stmg::AllPreferencesLoader::getPreferencesCopy ( const shared_ptr< AllPreferences > &  refAllPreferences) const
pure virtualnoexcept

Create a copy of an AllPreferences instance.

This function should be preferred over just using the copy constructor of the instance because it allows the loader to possibly recycle another instance.

Parameters
refAllPreferencesThe instance to copy from. Cannot be null.
Returns
The copy. Is not null.

Implemented in stmg::XmlPreferencesLoader.

◆ updatePreferences()

virtual bool stmg::AllPreferencesLoader::updatePreferences ( const shared_ptr< AllPreferences > &  refAllPreferences)
pure virtualnoexcept

Persist an AllPreferences instance.

Parameters
refAllPreferencesThe instance to persist. Cannot be null.
Returns
Whether the instance could be persisted.

Implemented in stmg::XmlPreferencesLoader.