AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AlexaInterfaceCapabilityAgent.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 ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACECAPABILITYAGENT_H_
17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACECAPABILITYAGENT_H_
18 
19 #include <memory>
20 #include <mutex>
21 #include <set>
22 
35 
36 namespace alexaClientSDK {
37 namespace capabilityAgents {
38 namespace alexa {
39 
44 public:
58  static std::shared_ptr<AlexaInterfaceCapabilityAgent> createDefaultAlexaInterfaceCapabilityAgent(
59  const std::shared_ptr<avsCommon::utils::DeviceInfo>& deviceInfo,
60  const std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface>&
61  exceptionEncounteredSender,
62  const std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface>& alexaMessageSender,
63  const std::shared_ptr<acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface>&
64  alexaEventProcessedNotifier,
68  endpointCapabilitiesRegistrar);
69 
79  static std::shared_ptr<AlexaInterfaceCapabilityAgent> create(
80  const std::shared_ptr<avsCommon::utils::DeviceInfo>& deviceInfo,
82  const std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface>&
83  exceptionEncounteredSender,
84  const std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface>& alexaMessageSender);
85 
96  static std::shared_ptr<AlexaInterfaceCapabilityAgent> create(
97  const avsCommon::utils::DeviceInfo& deviceInfo,
99  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender,
100  std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface> alexaMessageSender);
101 
105  void handleDirectiveImmediately(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
106  void preHandleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
107  void handleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
108  void cancelDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
110 
117 
118 private:
130  const std::shared_ptr<avsCommon::utils::DeviceInfo>& deviceInfo,
132  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender,
133  std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface> alexaMessageSender,
134  const std::shared_ptr<acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface>&
135  alexaEventProcessedNotifier);
136 
143  bool executeHandleEventProcessed(const std::shared_ptr<avsCommon::avs::AVSDirective>& directive);
144 
150  void removeDirective(const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo>& info);
151 
159  void executeSendExceptionEncounteredAndReportFailed(
160  const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo>& info,
162  const std::string& errorMessage);
163 
171  void executeSendErrorResponse(
172  const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo>& info,
174  const std::string& errorMessage);
175 
177  std::shared_ptr<avsCommon::utils::DeviceInfo> m_deviceInfo;
178 
181 
183  std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface> m_alexaMessageSender;
184 
186  std::shared_ptr<acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface>
187  m_alexaEventProcessedNotifier;
188 
191 };
192 
193 } // namespace alexa
194 } // namespace capabilityAgents
195 } // namespace alexaClientSDK
196 
197 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACECAPABILITYAGENT_H_
Definition: CapabilityAgent.h:47
ErrorResponseType
Definition: AlexaInterfaceMessageSenderInterface.h:35
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
ExceptionErrorType
Definition: ExceptionErrorType.h:28
void preHandleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
static std::shared_ptr< AlexaInterfaceCapabilityAgent > createDefaultAlexaInterfaceCapabilityAgent(const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &alexaMessageSender, const std::shared_ptr< acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface > &alexaEventProcessedNotifier, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &endpointCapabilitiesRegistrar)
void handleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
static std::shared_ptr< AlexaInterfaceCapabilityAgent > create(const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier &endpointId, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &alexaMessageSender)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
avsCommon::avs::CapabilityConfiguration getCapabilityConfiguration()
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
Definition: CapabilityConfiguration.h:42
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
void cancelDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override

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