![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <GenericInventory.h>
Public Member Functions | |
~GenericInventory () override | |
const char * | getName () const |
std::shared_ptr< clientInterfaces::ArtifactWrapperInterface > | prepareForSettingChange (const SettingsMap &newSettings) |
bool | commitChange () |
void | cancelChange () |
std::string | getArtifactPath () |
void | setCurrentActivePriority (commonInterfaces::Priority priority) |
bool | isSettingReady (const SettingsMap &setting) |
![]() | |
virtual | ~ArtifactUpdateValidator ()=default |
Protected Member Functions | |
GenericInventory (std::string name, std::shared_ptr< clientInterfaces::ArtifactWrapperFactoryInterface > artifactWrapperFactory) | |
virtual std::shared_ptr< commonInterfaces::ArtifactRequest > | createRequest (const SettingsMap &settings)=0 |
virtual bool | applyChangesLocked (const std::string &path)=0 |
void | cancelChangeLocked () |
ArtifactUpdateValidator method | |
bool | validateUpdate (const std::shared_ptr< commonInterfaces::ArtifactRequest > &request, const std::string &newPath) override |
A general inventory manager class that is responsible for managing a list of artifacts and maintaining an active artifact. This manager will respond to setting changes by downloading an artifact if one does not exist for the required settings or by preparing one that already exists on the system. This manager will determine the artifact identity based on the request created.
|
override |
|
protected |
Constructor
name | - name for the generic inventory |
artifactWrapperFactory | - factory for creating artifact |
|
protectedpure virtual |
A method that attempts to make use of the new artifact to ensure that it is usable.
path | to the new artifact that just got downloaded or updated. |
void alexaClientSDK::acsdkAssets::client::GenericInventory::cancelChange | ( | ) |
Will cancel the changes for the new settings that were requested. This cancels any pending download if requested.
|
protected |
Internal call for cancelChange.
bool alexaClientSDK::acsdkAssets::client::GenericInventory::commitChange | ( | ) |
Will apply the changes for the new settings after preparations have been completed.
|
protectedpure virtual |
A method that will be responsible for creating an Artifact Request based on the provided settings.
settings | used to create the request. |
std::string alexaClientSDK::acsdkAssets::client::GenericInventory::getArtifactPath | ( | ) |
|
inline |
bool alexaClientSDK::acsdkAssets::client::GenericInventory::isSettingReady | ( | const SettingsMap & | setting | ) |
Checks to see if an artifact for the provided setting is already available.
std::shared_ptr<clientInterfaces::ArtifactWrapperInterface> alexaClientSDK::acsdkAssets::client::GenericInventory::prepareForSettingChange | ( | const SettingsMap & | newSettings | ) |
Informs the manager class before applying the settings of the new settings that are going to be active.
newSettings | that will be used to identify the request for the new artifact. |
void alexaClientSDK::acsdkAssets::client::GenericInventory::setCurrentActivePriority | ( | commonInterfaces::Priority | priority | ) |
Overrides the current active artifact priority if one exists.
|
inlineoverrideprotectedvirtual |
Providing a new path, check to see if the content of the update is valid and usable.
newPath | of the potential updated artifact. |
Implements alexaClientSDK::acsdkAssets::clientInterfaces::ArtifactUpdateValidator.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0