16 #ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACEMESSAGESENDER_H_ 17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACEMESSAGESENDER_H_ 21 #include <unordered_map> 33 namespace capabilityAgents {
46 ,
public std::enable_shared_from_this<AlexaInterfaceMessageSender> {
62 const std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface>& contextManager,
63 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender,
64 const std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownNotifierInterface>& shutdownNotifier);
73 static std::shared_ptr<AlexaInterfaceMessageSenderInternalInterface>
75 const std::shared_ptr<AlexaInterfaceMessageSender>& messageSender);
85 static std::shared_ptr<AlexaInterfaceMessageSender>
create(
86 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
87 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender);
147 const int estimatedDeferralInSeconds = 0)
override;
152 struct ResponseData {
190 struct ChangeReportData {
220 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
221 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender);
232 void doShutdown()
override;
245 bool sendCommonResponseEvent(
260 void completeResponseEvent(
261 const std::shared_ptr<ResponseData>& event,
272 void completeChangeReportEvent(
273 const std::shared_ptr<ChangeReportData>& event,
284 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> m_contextManager;
287 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> m_messageSender;
290 std::map<avsCommon::sdkInterfaces::ContextRequestToken, std::shared_ptr<ResponseData>> m_pendingResponses;
293 std::map<avsCommon::sdkInterfaces::ContextRequestToken, std::shared_ptr<ChangeReportData>> m_pendingChangeReports;
303 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_ALEXA_INCLUDE_ALEXA_ALEXAINTERFACEMESSAGESENDER_H_ void onContextFailure(const avsCommon::sdkInterfaces::ContextRequestError error, avsCommon::sdkInterfaces::ContextRequestToken token) override
ErrorResponseType
Definition: AlexaInterfaceMessageSenderInterface.h:35
Definition: AlexaInterfaceMessageSenderInternalInterface.h:28
Definition: CapabilityTag.h:32
::std::string string
Definition: gtest-port.h:1097
static std::shared_ptr< AlexaInterfaceMessageSender > create(std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender)
ContextRequestError
Definition: ContextRequesterInterface.h:40
Single-thread executor implementation.
Definition: Executor.h:45
unsigned int ContextRequestToken
Alias for the token used to identify a context request.
Definition: ContextRequestToken.h:23
Definition: RequiresShutdown.h:32
~AlexaInterfaceMessageSender()
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
Definition: MessageRequestObserverInterface.h:28
virtual bool sendDeferredResponseEvent(const std::string &instance, const std::string &correlationToken, const int estimatedDeferralInSeconds=0) override
Definition: Optional.h:32
void onSendCompleted(avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status status) override
Definition: AlexaInterfaceMessageSender.h:40
static std::shared_ptr< AlexaInterfaceMessageSender > createAlexaInterfaceMessageSender(const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &contextManager, const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier)
Definition: ContextRequesterInterface.h:54
Definition: AVSContext.h:36
void onStateChanged(const avsCommon::avs::CapabilityTag &identifier, const avsCommon::avs::CapabilityState &state, const avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
virtual bool sendErrorResponseEvent(const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const ErrorResponseType errorType, const std::string &errorMessage="") override
Definition: CapabilityState.h:31
Definition: AVSMessageEndpoint.h:32
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: ContextManagerObserverInterface.h:33
type
Definition: upload.py:443
void onExceptionReceived(const std::string &exceptionMessage) override
virtual bool sendResponseEvent(const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const std::string &jsonPayload="{}") override
void onContextAvailable(const std::string &endpointId, const avsCommon::avs::AVSContext &endpointContext, avsCommon::sdkInterfaces::ContextRequestToken token) override
Status
Definition: MessageRequestObserverInterface.h:33
static std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > createAlexaInterfaceMessageSenderInternalInterface(const std::shared_ptr< AlexaInterfaceMessageSender > &messageSender)
virtual bool sendStateReportEvent(const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint) override