AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <DirectiveSequencerInterface.h>
Public Member Functions | |
DirectiveSequencerInterface (const std::string &name) | |
virtual | ~DirectiveSequencerInterface ()=default |
virtual bool | addDirectiveHandler (std::shared_ptr< DirectiveHandlerInterface > handler)=0 |
virtual bool | removeDirectiveHandler (std::shared_ptr< DirectiveHandlerInterface > handler)=0 |
virtual void | setDialogRequestId (const std::string &dialogRequestId)=0 |
virtual std::string | getDialogRequestId ()=0 |
virtual bool | onDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive)=0 |
virtual void | disable ()=0 |
virtual void | enable ()=0 |
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 |
Additional Inherited Members | |
Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown | |
virtual void | doShutdown ()=0 |
Interface for sequencing and handling a stream of AVSDirective
instances.
Customers of this interface specify a mapping of AVSDirectives
specified by (namespace, name) pairs to instances of the AVSDirectiveHandlerInterface
via calls to setDirectiveHandlers()
. Changes to this mapping can be made at any time by specifying a new mapping. Customers pass AVSDirectives
in to this interface for processing via calls to onDirective()
. AVSDirectives
are processed in the order that they are received. AVSDirectives
with a non-empty dialogRequestId
value are filtered by the DirectiveSequencer's
current dialogRequestId
value (specified by calls to setDialogRequestId()
). Only AVSDirectives
with a dialogRequestId
that is empty or which matches the last setting of the dialogRequestId
are handled. All others are ignored. Specifying a new DialogRequestId
value while AVSDirectives
are already being handled will cancel the handling of AVSDirectives
that have the previous DialogRequestId
and whose handling has not completed.
|
inline |
Constructor.
name | The name of the class or object which requires shutdown calls. Used in log messages when problems are detected in shutdown or destruction sequences. |
|
virtualdefault |
Destructor.
|
pure virtual |
Add the specified handler as a handler for its specified routing rule and policy. If any of the mappings fail, the entire call is refused.
DirectiveSequencer
will look first for a handler whose configuration is an exact match. If no exact match is found, then the directive
will be sent to the wildcard handler with the most specific rule. See DirectiveRoutingRule.h for more information on the rules available.handler | The handler to add. |
|
pure virtual |
Disable the DirectiveSequencer.
Implemented in alexaClientSDK::adsl::DirectiveSequencer.
|
pure virtual |
Enable the DirectiveSequencer.
Implemented in alexaClientSDK::adsl::DirectiveSequencer.
|
pure virtual |
Returns the dialogRequestId
currently in use for Directive handling. This may be the empty string if Directives have either experienced errors, or have been cancelled.
Implemented in alexaClientSDK::adsl::DirectiveSequencer, alexaClientSDK::adsl::test::MockDirectiveSequencer, and alexaClientSDK::avsCommon::sdkInterfaces::test::MockDirectiveSequencer.
|
pure virtual |
Sequence the handling of an AVSDirective
. The actual handling is done by whichever DirectiveHandler
is associated with the most specific routing rule.
directive | The AVSDirective to handle. |
Implemented in alexaClientSDK::adsl::DirectiveSequencer.
|
pure virtual |
Remove the specified handler's mapping of DirectiveRoutingRule
to BlockingPolicy
values. If the handler's configurations are unable to be removed, the entire operation is refused.
handler | The handler to remove. |
|
pure virtual |
Set the current DialogRequestId
. This value can be set at any time. Setting this value causes a DirectiveSequencer
to drop unhandled AVSDirectives
with different (and non-empty) DialogRequestId values. AVSDirectives
with a differing dialogRequestId
value and whose pre-handling or handling is already in progress will be cancelled.
dialogRequestId | The new value for the current DialogRequestId . |
Implemented in alexaClientSDK::adsl::DirectiveSequencer, alexaClientSDK::adsl::test::MockDirectiveSequencer, and alexaClientSDK::avsCommon::sdkInterfaces::test::MockDirectiveSequencer.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0