libdisplaydevice master
C++ library to modify display devices.
display_device::NoopSettingsPersistence Class Reference

A no-operation implementation for SettingsPersistenceInterface. More...

#include <src/common/include/display_device/noop_settings_persistence.h>

Inheritance diagram for display_device::NoopSettingsPersistence:
[legend]
Collaboration diagram for display_device::NoopSettingsPersistence:
[legend]

Public Member Functions

bool clear () override
 Clear the persistent settings data.
 
std::optional< std::vector< std::uint8_t > > load () const override
 Load saved settings data.
 
bool store (const std::vector< std::uint8_t > &data) override
 Store the provided data.
 
- Public Member Functions inherited from display_device::SettingsPersistenceInterface
virtual ~SettingsPersistenceInterface ()=default
 Default virtual destructor.
 

Detailed Description

A no-operation implementation for SettingsPersistenceInterface.

Member Function Documentation

◆ clear()

bool display_device::NoopSettingsPersistence::clear ( )
nodiscardoverridevirtual

Clear the persistent settings data.

Returns
True if data was cleared, false otherwise.

*Examples**

SettingsPersistenceInterface* iface = getIface(...);
const auto result = iface->clear();
A class for storing and loading settings data from a persistent medium.
Definition settings_persistence_interface.h:16
virtual bool clear()=0
Clear the persistent settings data.

Implements display_device::SettingsPersistenceInterface.

◆ load()

std::optional< std::vector< std::uint8_t > > display_device::NoopSettingsPersistence::load ( ) const
nodiscardoverridevirtual

Load saved settings data.

Returns
Null optional if failed to load data. Empty array, if there is no data. Non-empty array, if some data was loaded.

*Examples**

const SettingsPersistenceInterface* iface = getIface(...);
const auto opt_data = iface->load();
virtual std::optional< std::vector< std::uint8_t > > load() const =0
Load saved settings data.

Implements display_device::SettingsPersistenceInterface.

◆ store()

bool display_device::NoopSettingsPersistence::store ( const std::vector< std::uint8_t > & data)
nodiscardoverridevirtual

Store the provided data.

Parameters
dataData array to store.
Returns
True on success, false otherwise.

*Examples**

std::vector<std::uint8_t> data;
SettingsPersistenceInterface* iface = getIface(...);
const auto result = iface->store(data);
virtual bool store(const std::vector< std::uint8_t > &data)=0
Store the provided data.

Implements display_device::SettingsPersistenceInterface.


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