AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::settings::types::LocaleWakeWordsSetting Class Reference

#include <LocaleWakeWordsSetting.h>

Inheritance diagram for alexaClientSDK::settings::types::LocaleWakeWordsSetting:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::settings::types::LocaleWakeWordsSetting:
Collaboration graph
[legend]

Public Types

enum  RequestType : uint8_t { RequestType::LOCAL, RequestType::AVS, RequestType::NONE }
 Type of request. More...
 
using RequestId = unsigned int
 Alias for request id. More...
 
- 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...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
enum  Status { Status::DISCONNECTED, Status::PENDING, Status::CONNECTED }
 
enum  ChangedReason {
  ChangedReason::NONE, ChangedReason::SUCCESS, ChangedReason::UNRECOVERABLE_ERROR, ChangedReason::ACL_CLIENT_REQUEST,
  ChangedReason::ACL_DISABLED, ChangedReason::DNS_TIMEDOUT, ChangedReason::CONNECTION_TIMEDOUT, ChangedReason::CONNECTION_THROTTLED,
  ChangedReason::INVALID_AUTH, ChangedReason::PING_TIMEDOUT, ChangedReason::WRITE_TIMEDOUT, ChangedReason::READ_TIMEDOUT,
  ChangedReason::FAILURE_PROTOCOL_ERROR, ChangedReason::INTERNAL_ERROR, ChangedReason::SERVER_INTERNAL_ERROR, ChangedReason::SERVER_SIDE_DISCONNECT,
  ChangedReason::SERVER_ENDPOINT_CHANGED
}
 

Public Member Functions

 ~LocaleWakeWordsSetting ()
 
LocaleSetting methods.
SetSettingResult setLocalChange (const DeviceLocales &locale) override
 
bool setAvsChange (const DeviceLocales &locale) override
 
bool clearData (const DeviceLocales &locale) override
 
WakeWordsSetting methods.
SetSettingResult setLocalChange (const WakeWords &wakeWords) override
 
bool setAvsChange (const WakeWords &WakeWords) override
 
bool clearData (const WakeWords &WakeWords) override
 
ConnectionStatusObserverInterface methods.
void onConnectionStatusChanged (const Status status, const ChangedReason reason) override
 
- Public Member Functions inherited from alexaClientSDK::settings::SettingInterface< ValueT >
virtual ~SettingInterface ()=default
 
virtual SetSettingResult setLocalChange (const ValueType &value)=0
 
virtual bool setAvsChange (const ValueType &value)=0
 
virtual bool clearData (const ValueType &value)=0
 
ValueType get () const
 
ValueType getDefault () const
 
bool addObserver (std::shared_ptr< ObserverType > observer)
 
void removeObserver (std::shared_ptr< ObserverType > &observer)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
virtual ~ConnectionStatusObserverInterface ()=default
 
virtual void onConnectionStatusChanged (const Status status, const std::vector< EngineConnectionStatus > &engineStatuses)
 

Static Public Member Functions

static std::shared_ptr< LocaleWakeWordsSettingcreate (std::shared_ptr< SettingEventSenderInterface > localeEventSender, std::shared_ptr< SettingEventSenderInterface > wakeWordsEventSender, std::shared_ptr< storage::DeviceSettingStorageInterface > settingStorage, std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface > assetsManager)
 

Additional Inherited Members

- 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

Implements the interfaces to set Locale and WakeWords settings.

Member Typedef Documentation

◆ RequestId

Alias for request id.

Member Enumeration Documentation

◆ RequestType

Type of request.

Enumerator
LOCAL 

Local request.

AVS 

AVS request.

NONE 

No change required.

Constructor & Destructor Documentation

◆ ~LocaleWakeWordsSetting()

alexaClientSDK::settings::types::LocaleWakeWordsSetting::~LocaleWakeWordsSetting ( )

Destructor

Member Function Documentation

◆ clearData() [1/2]

bool alexaClientSDK::settings::types::LocaleWakeWordsSetting::clearData ( const DeviceLocales locale)
override

◆ clearData() [2/2]

bool alexaClientSDK::settings::types::LocaleWakeWordsSetting::clearData ( const WakeWords WakeWords)
override

◆ create()

static std::shared_ptr<LocaleWakeWordsSetting> alexaClientSDK::settings::types::LocaleWakeWordsSetting::create ( std::shared_ptr< SettingEventSenderInterface localeEventSender,
std::shared_ptr< SettingEventSenderInterface wakeWordsEventSender,
std::shared_ptr< storage::DeviceSettingStorageInterface settingStorage,
std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface assetsManager 
)
static

Create a LocaleWakeWordsSetting object.

Parameters
localeEventSenderObject used to send events to AVS in order to report locale changes on the device.
wakeWordsEventSenderObject used to send events to AVS in order to report wakeword changes on the device.
settingStorageThe setting storage object.
assetsManagerAn asset manager that is responsible for managing locale and wakeword assets.
Returns
A pointer to the new object if it succeeds; nullptr otherwise.

◆ onConnectionStatusChanged()

void alexaClientSDK::settings::types::LocaleWakeWordsSetting::onConnectionStatusChanged ( const Status  status,
const ChangedReason  reason 
)
overridevirtual

Called when the AVS connection state changes.

Parameters
statusThe current connection status.
reasonThe reason the status change occurred.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.

◆ setAvsChange() [1/2]

bool alexaClientSDK::settings::types::LocaleWakeWordsSetting::setAvsChange ( const DeviceLocales locale)
override

◆ setAvsChange() [2/2]

bool alexaClientSDK::settings::types::LocaleWakeWordsSetting::setAvsChange ( const WakeWords WakeWords)
override

◆ setLocalChange() [1/2]

SetSettingResult alexaClientSDK::settings::types::LocaleWakeWordsSetting::setLocalChange ( const DeviceLocales locale)
override

◆ setLocalChange() [2/2]

SetSettingResult alexaClientSDK::settings::types::LocaleWakeWordsSetting::setLocalChange ( const WakeWords wakeWords)
override

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

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