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

#include <AlexaClientSDKInit.h>

Public Member Functions

 ~AlexaClientSDKInit ()
 

Static Public Member Functions

static std::function< std::shared_ptr< AlexaClientSDKInit >std::shared_ptr< utils::logger::Logger >)> getCreateAlexaClientSDKInit (const std::vector< std::shared_ptr< std::istream >> &jsonStreams)
 
static std::function< std::shared_ptr< AlexaClientSDKInit >std::shared_ptr< utils::logger::Logger >)> getCreateAlexaClientSDKInit (const std::shared_ptr< InitializationParameters > &initParams)
 
static bool isInitialized ()
 
static bool initialize (const std::vector< std::shared_ptr< std::istream >> &jsonStreams)
 
static bool initialize (const std::shared_ptr< InitializationParameters > &initParams)
 
static void uninitialize ()
 

Detailed Description

Class encapsulating the lifetime of initialization of the Alexa Client SDK.

Constructor & Destructor Documentation

◆ ~AlexaClientSDKInit()

alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::~AlexaClientSDKInit ( )

Destructor.

Member Function Documentation

◆ getCreateAlexaClientSDKInit() [1/2]

static std::function<std::shared_ptr<AlexaClientSDKInit>std::shared_ptr<utils::logger::Logger>)> alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::getCreateAlexaClientSDKInit ( const std::vector< std::shared_ptr< std::istream >> &  jsonStreams)
static
Deprecated:
v1.21.0. This method does not support some new features, such as low power mode. Get a function to create an instance of AlexaClientSDKInit.
Parameters
jsonStreamsVector of istreams containing JSON documents from which to parse configuration parameters. Streams are processed in the order they appear in the vector. When a value appears in more than one JSON stream the last processed stream's value overwrites the previous value (and a debug log entry will be created). This allows for specifying default settings (by providing them first) and specifying the configuration from multiple sources (e.g. a separate stream for each component). Documentation of the JSON configuration format and methods to access the resulting global configuration can be found here: avsCommon::utils::configuration::ConfigurationNode.
Returns
A function to create an instance of AlexaClientSDKInit.

◆ getCreateAlexaClientSDKInit() [2/2]

static std::function<std::shared_ptr<AlexaClientSDKInit>std::shared_ptr<utils::logger::Logger>)> alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::getCreateAlexaClientSDKInit ( const std::shared_ptr< InitializationParameters > &  initParams)
static

Get a function to create an instance of AlexaClientSDKInit.

Note
To enable low power mode, the PowerResourceManager must be added to the InitializationParameters.
Parameters
initParamsThe InitializationParameters.
Returns
A function to create an instance of AlexaClientSDKInit.

◆ initialize() [1/2]

static bool alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::initialize ( const std::vector< std::shared_ptr< std::istream >> &  jsonStreams)
static
Deprecated:
v1.21.0 Initialize the Alexa Client SDK. This must be called before any Alexa Client SDK modules are created.

This function must be called before any threads in the process have been created by the program; this function is not thread safe. This requirement is present because initialize() calls functions of other libraries that have the same requirements and thread safety. terminate() must be called for each initialize() called.

Parameters
jsonStreamsVector of istreams containing JSON documents from which to parse configuration parameters. Streams are processed in the order they appear in the vector. When a value appears in more than one JSON stream the last processed stream's value overwrites the previous value (and a debug log entry will be created). This allows for specifying default settings (by providing them first) and specifying the configuration from multiple sources (e.g. a separate stream for each component). Documentation of the JSON configuration format and methods to access the resulting global configuration can be found here: avsCommon::utils::configuration::ConfigurationNode.
Returns
Whether the initialization was successful.

◆ initialize() [2/2]

static bool alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::initialize ( const std::shared_ptr< InitializationParameters > &  initParams)
static

Initialize the Alexa Client SDK. This must be called before any Alexa Client SDK modules are created.

This function must be called before any threads in the process have been created by the program; this function is not thread safe. This requirement is present because initialize() calls functions of other libraries that have the same requirements and thread safety. terminate() must be called for each initialize() called.

Parameters
initParamsThe InitializationParameters.
Returns
Whether the initialization was successful.

◆ isInitialized()

static bool alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::isInitialized ( )
static

Checks whether the Alexa Client SDK has been initialized.

Returns
Whether the Alexa Client SDK has been initialized.

◆ uninitialize()

static void alexaClientSDK::avsCommon::avs::initialization::AlexaClientSDKInit::uninitialize ( )
static

Uninitialize the Alexa Client SDK.

You should call uninitialize() once for each call you make to initialize(), after you are done using the Alexa Client SDK.

This function must be called when no other threads in the process are running. this function is not thread safe. This requirement is present because uninitialize() calls functions of other libraries that have the same requirements and thread safety.


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