15 #ifndef ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGINTERFACE_H_ 16 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGINTERFACE_H_ 22 #include <type_traits> 23 #include <unordered_set> 44 template <
typename ValueT>
104 inline bool addObserver(std::shared_ptr<ObserverType> observer);
111 inline void removeObserver(std::shared_ptr<ObserverType>& observer);
145 template <
typename ValueT>
150 template <
typename ValueT>
155 template <
typename ValueT>
166 template <
typename ValueT>
171 observer->onSettingNotification(value, notification);
175 template <
typename ValueT>
181 template <
typename ValueT>
188 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGINTERFACE_H_ const ValueType m_defaultValue
The default setting value.
Definition: SettingInterface.h:142
virtual bool setAvsChange(const ValueType &value)=0
std::mutex m_observerMutex
Mutex used to guard observers.
Definition: SettingInterface.h:127
Definition: SettingInterface.h:45
SettingInterface(const ValueType &value)
Definition: SettingInterface.h:182
void removeObserver(std::shared_ptr< ObserverType > &observer)
Definition: SettingInterface.h:176
Definition: GuardedValue.h:28
std::conditional< std::is_scalar< ValueType >::value, std::atomic< ValueType >, GuardedValue >::type m_value
The setting value. (is_trivially_copyable is not supported on gcc4.8)
Definition: SettingInterface.h:139
virtual ~SettingInterface()=default
bool addObserver(std::shared_ptr< ObserverType > observer)
Definition: SettingInterface.h:156
ValueT ValueType
Define the setting value type.
Definition: SettingInterface.h:48
virtual bool clearData(const ValueType &value)=0
ValueType getDefault() const
Definition: SettingInterface.h:151
void notifyObservers(SettingNotifications notification)
Definition: SettingInterface.h:167
avsCommon::utils::logger::LogEntry LogEntry
Alias to make log entries less verbose.
Definition: SettingInterface.h:136
ValueType get() const
Definition: SettingInterface.h:146
SetSettingResult
Definition: SetSettingResult.h:23
virtual SetSettingResult setLocalChange(const ValueType &value)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
SettingNotifications
Definition: SettingObserverInterface.h:28
type
Definition: upload.py:443
void acsdkError(const LogEntry &entry)
Definition: SettingObserverInterface.h:92
std::unordered_set< std::shared_ptr< ObserverType > > m_observers
Set of all observers of this setting.
Definition: SettingInterface.h:130
LogEntry is used to compile the log entry text to log via Logger.
Definition: LogEntry.h:33