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::adsl::DirectiveSequencer Class Reference

#include <DirectiveSequencer.h>

Inheritance diagram for alexaClientSDK::adsl::DirectiveSequencer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::adsl::DirectiveSequencer:
Collaboration graph
[legend]

Public Member Functions

bool addDirectiveHandler (std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > handler) override
 
bool removeDirectiveHandler (std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > handler) override
 
void setDialogRequestId (const std::string &dialogRequestId) override
 
std::string getDialogRequestId () override
 
bool onDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void disable () override
 
void enable () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveSequencerInterface
 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
 
- 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
 

Static Public Member Functions

static std::shared_ptr< DirectiveSequencerInterfacecreateDirectiveSequencerInterface (std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > shutdownNotifier, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder)
 
static std::unique_ptr< DirectiveSequencerInterfacecreate (std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
 

Additional Inherited Members

Detailed Description

Class for sequencing and handling a stream of AVSDirective instances.

Member Function Documentation

◆ addDirectiveHandler()

bool alexaClientSDK::adsl::DirectiveSequencer::addDirectiveHandler ( std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface handler)
override

◆ create()

static std::unique_ptr<DirectiveSequencerInterface> alexaClientSDK::adsl::DirectiveSequencer::create ( std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionSender,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr 
)
static

Create a DirectiveSequencer.

Deprecated:
Use createDirectiveSequencerInterface.
Parameters
exceptionSenderAn instance of the ExceptionEncounteredSenderInterface used to send ExceptionEncountered messages to AVS for directives that are not handled.
metricRecorderThe metric recorder.
Returns
Returns a new DirectiveSequencer, or nullptr if the operation failed.

◆ createDirectiveSequencerInterface()

static std::shared_ptr<DirectiveSequencerInterface> alexaClientSDK::adsl::DirectiveSequencer::createDirectiveSequencerInterface ( std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionSender,
std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface shutdownNotifier,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder 
)
static

Create a DirectiveSequencerInterface.

Parameters
exceptionSenderAn instance of the ExceptionEncounteredSenderInterface used to send ExceptionEncountered messages to AVS for directives that are not handled.
shutdownNotifierThe object with which to register for a notification when it is time to shut down.
metricRecorderThe metric recorder.
Returns
Returns a new DirectiveSequencer, or nullptr if the operation failed.

◆ disable()

void alexaClientSDK::adsl::DirectiveSequencer::disable ( )
overridevirtual

Disable the DirectiveSequencer.

Note
While disabled the DirectiveSequencer should not be able to handle directives.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveSequencerInterface.

◆ enable()

void alexaClientSDK::adsl::DirectiveSequencer::enable ( )
overridevirtual

◆ getDialogRequestId()

std::string alexaClientSDK::adsl::DirectiveSequencer::getDialogRequestId ( )
overridevirtual

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.

Returns
dialogRequestId The current dialog request id.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveSequencerInterface.

◆ onDirective()

bool alexaClientSDK::adsl::DirectiveSequencer::onDirective ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
overridevirtual

Sequence the handling of an AVSDirective. The actual handling is done by whichever DirectiveHandler is associated with the most specific routing rule.

Parameters
directiveThe AVSDirective to handle.
Returns
Whether or not the directive was accepted.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveSequencerInterface.

◆ removeDirectiveHandler()

bool alexaClientSDK::adsl::DirectiveSequencer::removeDirectiveHandler ( std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface handler)
override

◆ setDialogRequestId()

void alexaClientSDK::adsl::DirectiveSequencer::setDialogRequestId ( const std::string &  dialogRequestId)
overridevirtual

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.

Parameters
dialogRequestIdThe new value for the current DialogRequestId.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveSequencerInterface.


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