AlexaClientSDK  1.20.1
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface Class Reference

#include <StateProviderInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::NamespaceAndName &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 

Detailed Description

A StateProvider may be any client component whose state needs to be sent to the AVS. This specifies the interface to a StateProvider.

Constructor & Destructor Documentation

◆ ~StateProviderInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface::~StateProviderInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ canStateBeRetrieved()

bool alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface::canStateBeRetrieved ( )
inlinevirtual

Returns whether the provider should be queried for its state / properties.

Returns
Whether this provider should be queried about its state when a new context request arrives.
Note
In future versions, this method will be made pure virtual.

Reimplemented in alexaClientSDK::capabilityAgents::modeController::ModeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::rangeController::RangeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::toggleController::ToggleControllerCapabilityAgent, and alexaClientSDK::capabilityAgents::powerController::PowerControllerCapabilityAgent.

◆ hasReportableStateProperties()

bool alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface::hasReportableStateProperties ( )
inlinevirtual

◆ provideState() [1/2]

void alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface::provideState ( const avs::NamespaceAndName stateProviderName,
const ContextRequestToken  stateRequestToken 
)
inlinevirtual

A request to a StateProvider to provide the state. The StateProvider should perform minimum processing and return quickly, otherwise it will block the processing of updating the states of other StateProviders. The ContextManager specifies a token which it uses to track the getContext request associated with this provideState request. The stateProviderInterface must use the same token when it updates its state via the setState call.

: The setState method MUST be called from a different thread from where the provideState method is being called from.

Parameters
stateProviderNameThe name of the state provider.
stateRequestTokenThe token to use in the setState call.
Deprecated:
NamespaceAndName is being deprecated. Use the CapabilityMessageIdentifier version instead.

Reimplemented in alexaClientSDK::integration::test::testStateProvider, alexaClientSDK::capabilityAgents::externalMediaPlayer::ExternalMediaPlayer, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::acsdkNotifications::NotificationsCapabilityAgent, alexaClientSDK::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::afml::AudioActivityTracker, and alexaClientSDK::afml::VisualActivityTracker.

◆ provideState() [2/2]

void alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface::provideState ( const avs::CapabilityTag stateProviderName,
const ContextRequestToken  stateRequestToken 
)
inlinevirtual

A request to a StateProvider to provide the state. The StateProvider should perform minimum processing and return quickly, otherwise it will block the processing of updating the states of other StateProviders. The ContextManager specifies a token which it uses to track the getContext request associated with this provideState request. The stateProviderInterface must use the same token when it updates its state via the setState call.

: The setState method MUST be called from a different thread from where the provideState method is being called from.

Parameters
stateProviderIdentifierThe identifier of the state provider.
stateRequestTokenThe token to use in the setState call.
Note
In future versions, this method will be made pure virtual.

Reimplemented in alexaClientSDK::capabilityAgents::modeController::ModeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::rangeController::RangeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::toggleController::ToggleControllerCapabilityAgent, and alexaClientSDK::capabilityAgents::powerController::PowerControllerCapabilityAgent.


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

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