AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager Class Reference

#include <LocaleAssetsManager.h>

Inheritance diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager:
Collaboration graph
[legend]

Public Member Functions

LocaleAssetsManagerInterface methods
bool changeAssets (const Locales &locales, const WakeWords &wakeWords) override
 
void cancelOngoingChange () override
 
WakeWordsSets getDefaultSupportedWakeWords () const override
 
std::map< LanguageTag, WakeWordsSetsgetLanguageSpecificWakeWords () const override
 
std::map< Locale, WakeWordsSetsgetLocaleSpecificWakeWords () const override
 
WakeWordsSets getSupportedWakeWords (const Locale &locale) const override
 
std::set< LocalegetSupportedLocales () const override
 
LocaleCombinations getSupportedLocaleCombinations () const override
 
Locale getDefaultLocale () const override
 
Locales getDefaultLocales () const override
 
void addLocaleAssetsObserver (const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsObserverInterface > &observer) override
 
void removeLocaleAssetsObserver (const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsObserverInterface > &observer) override
 
void onConfigurationChanged (const avsCommon::avs::CapabilityConfiguration &configuration) override
 
void setEndpointRegistrationManager (const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointRegistrationManagerInterface > &manager) override
 
RequiresShutdown methods
void doShutdown () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface
virtual void addLocaleAssetsObserver (const std::shared_ptr< LocaleAssetsObserverInterface > &observer)=0
 
virtual void removeLocaleAssetsObserver (const std::shared_ptr< LocaleAssetsObserverInterface > &observer)=0
 
virtual void setEndpointRegistrationManager (const std::shared_ptr< endpoints::EndpointRegistrationManagerInterface > &manager)=0
 
virtual ~LocaleAssetsManagerInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationChangeObserverInterface
virtual ~CapabilityConfigurationChangeObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterfacecreateLocaleAssetsManagerInterface (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationNode, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier)
 
static std::shared_ptr< LocaleAssetsManagercreateLocaleAssetsManager (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationNode)
 
static std::shared_ptr< LocaleAssetsManagercreate (bool enableWakeWord)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface
using Locale = std::string
 
using LanguageTag = std::string
 
using WakeWords = std::set< std::string >
 
using WakeWordsSets = std::set< WakeWords >
 
using Locales = std::vector< Locale >
 
using LocaleCombinations = std::set< Locales >
 

Detailed Description

Sample implementation of an asset manager.

This manager will use the AlexaClientSDKConfig.json to retrieve the supported locales. For devices with wake word enabled this class will support "ALEXA" only.

Member Function Documentation

◆ addLocaleAssetsObserver()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::addLocaleAssetsObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsObserverInterface > &  observer)
override

◆ cancelOngoingChange()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::cancelOngoingChange ( )
overridevirtual

Method used to cancel an ongoing prepareAssets call.

This will get called when there is a change to the required assets. It's up to the implementation to decide how and when to cancel the ongoing operation.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ changeAssets()

bool alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::changeAssets ( const Locales locales,
const WakeWords wakeWords 
)
overridevirtual

Method to change the current assets.

Parameters
localesThe locales.
wakeWordsThe wake words that should be available and enabled.
Returns
true if it succeeds; false otherwise.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ create()

static std::shared_ptr<LocaleAssetsManager> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::create ( bool  enableWakeWord)
static

Create a LocaleAssetsManager object.

Deprecated:
Returns
A pointer to a new LocaleAssetsManager object if it succeeds; otherwise, nullptr.

◆ createLocaleAssetsManager()

static std::shared_ptr<LocaleAssetsManager> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::createLocaleAssetsManager ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configurationNode)
static

Create an instance of LocaleAssetsManager.

Parameters
configurationNodeA pointer to the ConfigurationNode instance.
Returns
A pointer to a new LocaleAssetsManager object if it succeeds; otherwise, nullptr.

◆ createLocaleAssetsManagerInterface()

static std::shared_ptr<avsCommon::sdkInterfaces::LocaleAssetsManagerInterface> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::createLocaleAssetsManagerInterface ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configurationNode,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier 
)
static

Create an instance of LocaleAssetsManagerInterface.

Parameters
configurationNodeA pointer to the ConfigurationNode instance.
shutdownNotifierA pointer to the ShutdownNotifier instance.
Returns
A pointer to the LocaleAssetsManagerInterface.

◆ doShutdown()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ getDefaultLocale()

Locale alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getDefaultLocale ( ) const
overridevirtual

Get the default locale.

Deprecated:
Use getDefaultLocales
Returns
The default locale.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getDefaultLocales()

Locales alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getDefaultLocales ( ) const
overridevirtual

Get the default multilingual locales.

Returns
The default multilingual locales.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getDefaultSupportedWakeWords()

WakeWordsSets alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getDefaultSupportedWakeWords ( ) const
overridevirtual

Get the default valid concurrent wake words sets.

Returns
The valid concurrent wake words sets supported in most locales.
Note
See getLocaleSpecificWakeWords() for locales that have a different set of supported wake words.
Warning
The supported set of wake words MUST include ALEXA.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getLanguageSpecificWakeWords()

std::map<LanguageTag, WakeWordsSets> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getLanguageSpecificWakeWords ( ) const
overridevirtual

Function that return valid concurrent wake words sets per language (if and only if locale support a set of wake words that's different than the default set).

Returns
A map of valid concurrent wake words sets per language.
Warning
The supported wake words MUST include ALEXA for all languages.ExecutorTest.cpp

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getLocaleSpecificWakeWords()

std::map<Locale, WakeWordsSets> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getLocaleSpecificWakeWords ( ) const
overridevirtual

Function that return the valid concurrent wake words sets per locale (if and only if locale support a set of wake words that's different than the default set or the language set).

Returns
A map of valid concurrent wake words sets per locale.
Warning
The supported wake words MUST include ALEXA for all locales.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getSupportedLocaleCombinations()

LocaleCombinations alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getSupportedLocaleCombinations ( ) const
overridevirtual

Get the supported locales combinations.

Returns
A vector with all the supported locales combinations.
Note
Order matters for the locale combination, as the first locale presented is the primary locale. Each combination will have more than one locale, and each locale in the combination must be a supported locale.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getSupportedLocales()

std::set<Locale> alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getSupportedLocales ( ) const
overridevirtual

Get the supported locales.

Returns
A set with all the supported locales.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ getSupportedWakeWords()

WakeWordsSets alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::getSupportedWakeWords ( const Locale locale) const
overridevirtual

Get the valid concurrent wake words sets for the given locale.

Parameters
localeThe target locale.
Returns
The valid concurrent wake words sets of the given locale.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocaleAssetsManagerInterface.

◆ onConfigurationChanged()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::onConfigurationChanged ( const avsCommon::avs::CapabilityConfiguration configuration)
overridevirtual

Notification that a CapabilityAgent configuration is changed.

Parameters
configurationThe CapabilityAgent configuration.

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationChangeObserverInterface.

◆ removeLocaleAssetsObserver()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::removeLocaleAssetsObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsObserverInterface > &  observer)
override

◆ setEndpointRegistrationManager()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::LocaleAssetsManager::setEndpointRegistrationManager ( const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointRegistrationManagerInterface > &  manager)
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