16 #ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_MODECONTROLLER_INCLUDE_MODECONTROLLER_MODECONTROLLERCAPABILITYAGENT_H_ 17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_MODECONTROLLER_INCLUDE_MODECONTROLLER_MODECONTROLLERCAPABILITYAGENT_H_ 33 namespace capabilityAgents {
34 namespace modeController {
46 ,
public std::enable_shared_from_this<ModeControllerCapabilityAgent> {
70 static std::shared_ptr<ModeControllerCapabilityAgent>
create(
74 std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerInterface> modeController,
75 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
76 std::shared_ptr<avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface> responseSender,
77 std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionSender,
78 bool isProactivelyReported,
80 bool isNonControllable =
false);
134 std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerInterface> modeController,
135 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
136 std::shared_ptr<avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface> responseSender,
137 std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionSender,
138 bool isProactivelyReported,
140 bool isNonControllable);
144 void doShutdown()
override;
159 void removeDirective(std::shared_ptr<DirectiveInfo> info);
166 void executeSetHandlingCompleted(std::shared_ptr<DirectiveInfo> info);
181 void executeSetModeDirective(std::shared_ptr<DirectiveInfo> info, rapidjson::Document& payload);
189 void executeAdjustModeDirective(std::shared_ptr<DirectiveInfo> info, rapidjson::Document& payload);
215 const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info,
216 rapidjson::Document& payload);
224 void executeAdjustMode(
225 const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info,
226 rapidjson::Document& payload);
234 void executeProvideState(
245 void executeSendResponseEvent(
246 const std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info,
247 std::pair<avsCommon::avs::AlexaResponseType, std::string> result);
263 bool m_isProactivelyReported;
266 bool m_isRetrievable;
269 bool m_isNonControllable;
276 m_modeControllerConfiguration;
279 std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerInterface> m_modeController;
282 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> m_contextManager;
285 std::shared_ptr<avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface> m_responseSender;
288 using ModeAndCauseTypePair = std::pair<ModeState, avsCommon::sdkInterfaces::AlexaStateChangeCauseType>;
291 std::map<avsCommon::sdkInterfaces::ContextRequestToken, ModeAndCauseTypePair> m_pendingChangeReports;
301 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_MODECONTROLLER_INCLUDE_MODECONTROLLER_MODECONTROLLERCAPABILITYAGENT_H_ Definition: CapabilityAgent.h:47
Definition: ModeControllerAttributes.h:39
void cancelDirective(std::shared_ptr< DirectiveInfo > info) override
Definition: CapabilityTag.h:32
::std::string string
Definition: gtest-port.h:1097
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
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
Definition: RequiresShutdown.h:32
ExceptionErrorType
Definition: ExceptionErrorType.h:28
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
std::vector< std::string > ModeControllerConfiguration
Definition: ModeControllerInterface.h:51
void provideState(const avsCommon::avs::CapabilityTag &stateProviderName, const avsCommon::sdkInterfaces::ContextRequestToken contextRequestToken) override
void handleDirective(std::shared_ptr< DirectiveInfo > info) override
void preHandleDirective(std::shared_ptr< DirectiveInfo > info) override
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface::ModeState ModeState
Alias to improve readability.
Definition: ModeControllerInterface.h:40
Definition: CapabilityState.h:31
bool hasReportableStateProperties() override
void onModeChanged(const ModeState &mode, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
bool canStateBeRetrieved() override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
avsCommon::avs::CapabilityConfiguration getCapabilityConfiguration()
type
Definition: upload.py:443
Definition: ModeControllerObserverInterface.h:36
static std::shared_ptr< ModeControllerCapabilityAgent > create(const EndpointIdentifier &endpointId, const std::string &instance, const avsCommon::sdkInterfaces::modeController::ModeControllerAttributes &modeControllerAttributes, std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerInterface > modeController, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface > responseSender, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, bool isProactivelyReported, bool isRetrievable, bool isNonControllable=false)
avsCommon::sdkInterfaces::endpoints::EndpointIdentifier EndpointIdentifier
Alias to improve readability.
Definition: ModeControllerCapabilityAgent.h:49
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
Definition: CapabilityConfiguration.h:42
Definition: ModeControllerObserverInterface.h:31
Definition: ModeControllerCapabilityAgent.h:42
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override