AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::settings::test::SettingStub< SettingT > Class Template Reference

Settings stub that just set the value immediately. More...

Inheritance diagram for alexaClientSDK::settings::test::SettingStub< SettingT >:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::settings::test::SettingStub< SettingT >:
Collaboration graph
[legend]

Public Member Functions

SetSettingResult setLocalChange (const typename SettingT::ValueType &value)
 Set the value synchronously for simplicity. More...
 
bool setAvsChange (const typename SettingT::ValueType &value)
 Just a stub that doesn't do anything. More...
 
bool clearData (const typename SettingT::ValueType &value)
 Just a stub that doesn't do anything. More...
 
 SettingStub (const typename SettingT::ValueType &value)
 Build setting object. More...
 
SetSettingResult setLocalChange (const ValueT &value) override
 
bool setAvsChange (const ValueT &value) override
 
bool clearData (const ValueT &value) override
 
 SettingStub (const ValueT &value)
 
- Public Member Functions inherited from alexaClientSDK::settings::SettingInterface< ValueT >
virtual ~SettingInterface ()=default
 
ValueType get () const
 
ValueType getDefault () const
 
bool addObserver (std::shared_ptr< ObserverType > observer)
 
void removeObserver (std::shared_ptr< ObserverType > &observer)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::settings::SettingInterface< ValueT >
using ValueType = ValueT
 Define the setting value type. More...
 
using ObserverType = SettingObserverInterface< SettingInterface< ValueType > >
 Define the observer type for this setting. More...
 
- Protected Types inherited from alexaClientSDK::settings::SettingInterface< ValueT >
using GuardedValue = avsCommon::utils::GuardedValue< ValueType >
 Alias for GuardedValue with the templated value ValueType. More...
 
using LogEntry = avsCommon::utils::logger::LogEntry
 Alias to make log entries less verbose. More...
 
- Protected Member Functions inherited from alexaClientSDK::settings::SettingInterface< ValueT >
 SettingInterface (const ValueType &value)
 
void notifyObservers (SettingNotifications notification)
 
- Protected Attributes inherited from alexaClientSDK::settings::SettingInterface< ValueT >
std::mutex m_observerMutex
 Mutex used to guard observers. More...
 
std::unordered_set< std::shared_ptr< ObserverType > > m_observers
 Set of all observers of this setting. More...
 
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) More...
 
const ValueType m_defaultValue
 The default setting value. More...
 

Detailed Description

template<typename SettingT>
class alexaClientSDK::settings::test::SettingStub< SettingT >

Settings stub that just set the value immediately.

Stub a setting for test purpose.

Template Parameters
SettingTThe setting type to be extended.

Constructor & Destructor Documentation

◆ SettingStub() [1/2]

template<typename SettingT >
alexaClientSDK::settings::test::SettingStub< SettingT >::SettingStub ( const typename SettingT::ValueType &  value)
explicit

Build setting object.

◆ SettingStub() [2/2]

template<typename SettingT >
alexaClientSDK::settings::test::SettingStub< SettingT >::SettingStub ( const ValueT &  value)
inlineexplicit

Member Function Documentation

◆ clearData() [1/2]

template<typename SettingT >
bool alexaClientSDK::settings::test::SettingStub< SettingT >::clearData ( const ValueT &  value)
inlineoverridevirtual

Clear the data this Setting.

Parameters
valueThe default value for this setting.
Returns
true if it data is cleared; otherwise.

Implements alexaClientSDK::settings::SettingInterface< ValueT >.

◆ clearData() [2/2]

template<typename SettingT >
bool alexaClientSDK::settings::test::SettingStub< SettingT >::clearData ( const typename SettingT::ValueType &  value)

Just a stub that doesn't do anything.

◆ setAvsChange() [1/2]

template<typename SettingT >
bool alexaClientSDK::settings::test::SettingStub< SettingT >::setAvsChange ( const ValueT &  value)
inlineoverridevirtual

Request to set the managed setting to the given value. This should be used when the request came from AVS.

Parameters
valueThe target value.
Returns
true if it succeeds to enqueue the request; otherwise.

Implements alexaClientSDK::settings::SettingInterface< ValueT >.

◆ setAvsChange() [2/2]

template<typename SettingT >
bool alexaClientSDK::settings::test::SettingStub< SettingT >::setAvsChange ( const typename SettingT::ValueType &  value)

Just a stub that doesn't do anything.

◆ setLocalChange() [1/2]

template<typename SettingT >
SetSettingResult alexaClientSDK::settings::test::SettingStub< SettingT >::setLocalChange ( const ValueT &  value)
inlineoverridevirtual

Request to set the managed setting to the given value. Note that this is an asynchronous operation.

Parameters
valueThe target value.
Returns
The result of the enqueue operation.

Implements alexaClientSDK::settings::SettingInterface< ValueT >.

◆ setLocalChange() [2/2]

template<typename SettingT >
SetSettingResult alexaClientSDK::settings::test::SettingStub< SettingT >::setLocalChange ( const typename SettingT::ValueType &  value)

Set the value synchronously for simplicity.


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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0