AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
InputControllerCapabilityAgent.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKINPUTCONTROLLER_SRC_INPUTCONTROLLERCAPABILITYAGENT_H_
17 #define ACSDKINPUTCONTROLLER_SRC_INPUTCONTROLLERCAPABILITYAGENT_H_
18 
19 #include <memory>
20 #include <string>
21 #include <unordered_set>
22 
28 
29 namespace alexaClientSDK {
30 namespace acsdkInputController {
31 
44 public:
48 
52  virtual ~InputControllerCapabilityAgent() = default;
53 
61  static std::shared_ptr<InputControllerCapabilityAgent> create(
62  const std::shared_ptr<acsdkInputControllerInterfaces::InputControllerHandlerInterface>& handler,
63  const std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface>& exceptionSender);
64 
68  void handleDirectiveImmediately(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
69  void preHandleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
70  void handleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
71  void cancelDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
73 
76  std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> getCapabilityConfigurations() override;
78 
79 private:
87  const std::shared_ptr<acsdkInputControllerInterfaces::InputControllerHandlerInterface>& handler,
88  const std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface>& exceptionSender);
89 
98  bool executeHandleDirectiveHelper(
99  std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info,
100  std::string* errMessage,
102 
104  std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> m_capabilityConfigurations;
105 
107  const std::shared_ptr<acsdkInputControllerInterfaces::InputControllerHandlerInterface> m_inputControllerHandler;
108 
110  InputFriendlyNameConfigurations m_inputConfigurations;
111 
119 };
120 
121 } // namespace acsdkInputController
122 } // namespace alexaClientSDK
123 
124 #endif // ACSDKINPUTCONTROLLER_SRC_INPUTCONTROLLERCAPABILITYAGENT_H_
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::create
static std::shared_ptr< InputControllerCapabilityAgent > create(const std::shared_ptr< acsdkInputControllerInterfaces::InputControllerHandlerInterface > &handler, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionSender)
Definition: InputControllerCapabilityAgent.cpp:138
InputControllerHandlerInterface.h
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent
Definition: InputControllerCapabilityAgent.h:41
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::~InputControllerCapabilityAgent
virtual ~InputControllerCapabilityAgent()=default
alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface
Definition: CapabilityConfigurationInterface.h:32
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::InputFriendlyNameConfigurations
acsdkInputControllerInterfaces::InputControllerHandlerInterface::InputFriendlyNameType InputFriendlyNameConfigurations
Alias for brevity.
Definition: InputControllerCapabilityAgent.h:47
alexaClientSDK::avsCommon::utils::threading::Executor
Definition: Executor.h:40
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::preHandleDirective
void preHandleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: InputControllerCapabilityAgent.cpp:179
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::getCapabilityConfigurations
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations() override
Definition: InputControllerCapabilityAgent.cpp:291
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::handleDirective
void handleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: InputControllerCapabilityAgent.cpp:254
alexaClientSDK::acsdkInputControllerInterfaces::InputControllerHandlerInterface::InputFriendlyNameType
std::unordered_map< std::string, std::unordered_set< std::string > > InputFriendlyNameType
Definition: InputControllerHandlerInterface.h:42
Executor.h
CapabilityAgent.h
alexaClientSDK::avsCommon::avs::ExceptionErrorType
ExceptionErrorType
Definition: ExceptionErrorType.h:28
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::getConfiguration
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
Definition: InputControllerCapabilityAgent.cpp:168
alexaClientSDK::avsCommon::avs::DirectiveHandlerConfiguration
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::handleDirectiveImmediately
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
Definition: InputControllerCapabilityAgent.cpp:174
alexaClientSDK::avsCommon::avs::CapabilityAgent
Definition: CapabilityAgent.h:47
alexaClientSDK::acsdkInputController::InputControllerCapabilityAgent::cancelDirective
void cancelDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: InputControllerCapabilityAgent.cpp:286
CapabilityConfiguration.h
CapabilityConfigurationInterface.h

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