AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <DirectiveRouter.h>
Additional Inherited Members |
Class to maintain a mapping from NamespaceAndName
to HandlerAndPolicy
, and to invoke DirectiveHandlerInterface
methods on the DirectiveHandler
registered for a given AVSDirective
.
alexaClientSDK::adsl::DirectiveRouter::DirectiveRouter | ( | std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > | metricRecorder = nullptr | ) |
Constructor.
metricRecorder | The metric recorder. |
bool alexaClientSDK::adsl::DirectiveRouter::addDirectiveHandler | ( | std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > | handler | ) |
Add mappings from handler's directives to BlockingPolicy
values, gotten through the handler's getConfiguration() method. If a mapping for any of the specified directives already exists the entire call is refused.
handler | The handler to add. |
bool alexaClientSDK::adsl::DirectiveRouter::cancelDirective | ( | std::shared_ptr< avsCommon::avs::AVSDirective > | directive | ) |
Invoke cancelDirective() on the handler registered for the given AVSDirective
.
directive | The directive to be handled. |
avsCommon::avs::BlockingPolicy alexaClientSDK::adsl::DirectiveRouter::getPolicy | ( | const std::shared_ptr< avsCommon::avs::AVSDirective > & | directive | ) |
Get the policy associated with the given directive.
directive | The directive for which the policy is required. |
BlockingPolicy
value for the directive. bool alexaClientSDK::adsl::DirectiveRouter::handleDirective | ( | const std::shared_ptr< avsCommon::avs::AVSDirective > & | directive | ) |
Invoke handleDirective()
on the handler registered for the given AVSDirective
.
directive | The directive to be handled. |
true
if the the registered handler returned true
. false
if there was no registered handler or the registered handler returned false
(indicating that the directive was not recognized. bool alexaClientSDK::adsl::DirectiveRouter::handleDirectiveImmediately | ( | std::shared_ptr< avsCommon::avs::AVSDirective > | directive | ) |
Invoke handleDirectiveImmediately()
on the handler registered for the given AVSDirective
.
directive | The directive to be handled immediately. |
bool alexaClientSDK::adsl::DirectiveRouter::preHandleDirective | ( | std::shared_ptr< avsCommon::avs::AVSDirective > | directive, |
std::unique_ptr< avsCommon::sdkInterfaces::DirectiveHandlerResultInterface > | result | ||
) |
Invoke preHandleDirective()
on the handler registered for the given AVSDirective
.
directive | The directive to be preHandled. |
result | A result object to receive notification about the completion (or failure) of handling the AVSDirective . |
bool alexaClientSDK::adsl::DirectiveRouter::removeDirectiveHandler | ( | std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > | handler | ) |
Remove the specified mappings from NamespaceAndName
values to BlockingPolicy
values, gotten through the handler's getConfiguration() method. If any of the specified mappings do not match an existing mapping, the entire operation is refused.
handler | The handler to remove. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0