16 #ifndef ALEXA_CLIENT_SDK_ADSL_INCLUDE_ADSL_DIRECTIVEROUTER_H_ 17 #define ALEXA_CLIENT_SDK_ADSL_INCLUDE_ADSL_DIRECTIVEROUTER_H_ 21 #include <unordered_map> 50 bool addDirectiveHandler(std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler);
79 std::shared_ptr<avsCommon::avs::AVSDirective> directive,
80 std::unique_ptr<avsCommon::sdkInterfaces::DirectiveHandlerResultInterface> result);
89 bool handleDirective(
const std::shared_ptr<avsCommon::avs::AVSDirective>& directive);
97 bool cancelDirective(std::shared_ptr<avsCommon::avs::AVSDirective> directive);
108 void doShutdown()
override;
117 class HandlerCallScope {
129 std::unique_lock<std::mutex>& lock,
131 std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler);
142 std::unique_lock<std::mutex>& m_lock;
148 std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> m_handler;
159 const std::shared_ptr<avsCommon::avs::AVSDirective>& directive);
168 std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> getHandlerLocked(
169 std::shared_ptr<avsCommon::avs::AVSDirective> directive);
176 void incrementHandlerReferenceCountLocked(
177 std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler);
186 void decrementHandlerReferenceCountLocked(
187 std::unique_lock<std::mutex>& lock,
188 std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler);
198 bool removeDirectiveHandlerLocked(std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler);
201 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
207 std::unordered_map<avsCommon::avs::CapabilityTag, avsCommon::avs::HandlerAndPolicy> m_configuration;
218 std::unordered_map<std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface>,
int>
219 m_handlerReferenceCounts;
229 const std::shared_ptr<avsCommon::avs::AVSDirective>& directive);
235 #endif // ALEXA_CLIENT_SDK_ADSL_INCLUDE_ADSL_DIRECTIVEROUTER_H_ bool handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive)
bool handleDirective(const std::shared_ptr< avsCommon::avs::AVSDirective > &directive)
DirectiveRouter(std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
Definition: RequiresShutdown.h:32
avsCommon::avs::BlockingPolicy getPolicy(const std::shared_ptr< avsCommon::avs::AVSDirective > &directive)
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
bool cancelDirective(std::shared_ptr< avsCommon::avs::AVSDirective > directive)
Definition: MetricEventBuilder.h:31
Definition: DirectiveRouter.h:36
bool preHandleDirective(std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< avsCommon::sdkInterfaces::DirectiveHandlerResultInterface > result)
bool removeDirectiveHandler(std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > handler)
bool addDirectiveHandler(std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > handler)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: BlockingPolicy.h:31
Definition: HandlerAndPolicy.h:30