AlexaClientSDK  3.0.0
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 ()
 
virtual bool shouldQueryState ()
 

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 can be queried for its state / properties. If not, the provider is omitted from the context altogether. ContextManager will not query or report its state.

Returns
Whether this provider can 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::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::acsdkExternalMediaPlayer::ExternalMediaPlayer, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::acsdkNotifications::NotificationsCapabilityAgent, alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent, 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.

◆ shouldQueryState()

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

Returns whether the provider should be queried for its state / properties. If this returns false the last cached state will be reported to the context requester.

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

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