summaryrefslogtreecommitdiff
path: root/src/components/hmi_message_handler/include
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-08-10 14:07:07 +0300
committerAndrey Oleynik <aoleynik@luxoft.com>2017-08-16 22:32:33 +0300
commit06729e8b744374a4d9694f669101b6c554ce42e0 (patch)
tree7fd73e4e64a831755fa02bbbd8ee8ccfb8f09efd /src/components/hmi_message_handler/include
parent41fe2979a5f1f8a13428ae4fe88f37ee9824c92e (diff)
downloadsdl_core-06729e8b744374a4d9694f669101b6c554ce42e0.tar.gz
Arhitecture changes for support RC plugin
Diffstat (limited to 'src/components/hmi_message_handler/include')
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h9
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h28
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h7
3 files changed, 33 insertions, 11 deletions
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
index bd118032d6..1a28c89bda 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
@@ -51,8 +51,15 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter {
/**
* \brief Destructor
*/
- virtual ~HMIMessageAdapterImpl();
+ ~HMIMessageAdapterImpl();
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Subscribes to notification from HMI
+ * @param hmi_notification string with notification name
+ */
+ void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
protected:
virtual HMIMessageHandler* handler() const {
return handler_;
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
index 8b238b4aa8..daba87e738 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
@@ -89,14 +89,21 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
explicit HMIMessageHandlerImpl(const HMIMessageHandlerSettings& settings);
~HMIMessageHandlerImpl();
- void OnMessageReceived(MessageSharedPointer message);
- void SendMessageToHMI(MessageSharedPointer message);
+ void OnMessageReceived(MessageSharedPointer message) OVERRIDE;
+ void SendMessageToHMI(MessageSharedPointer message) OVERRIDE;
void set_message_observer(HMIMessageObserver* observer);
- void OnErrorSending(MessageSharedPointer message);
- void AddHMIMessageAdapter(HMIMessageAdapter* adapter);
- void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter);
-
- virtual const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
+ void OnErrorSending(MessageSharedPointer message) OVERRIDE;
+ void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
+ void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Subscribes to notification from HMI
+ * @param hmi_notification string with notification name
+ */
+ void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+ const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
#ifdef BUILD_TESTS
std::set<HMIMessageAdapter*> message_adapters() const {
@@ -120,15 +127,16 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
// threads::MessageLoopThread<*>::Handler implementations
// CALLED ON messages_from_hmi_ THREAD!
- virtual void Handle(const impl::MessageFromHmi message) OVERRIDE;
+ void Handle(const impl::MessageFromHmi message) OVERRIDE;
// CALLED ON messages_to_hmi_ THREAD!
- virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
+ void Handle(const impl::MessageToHmi message) OVERRIDE;
private:
const HMIMessageHandlerSettings& settings_;
HMIMessageObserver* observer_;
- mutable sync_primitives::Lock observer_locker_;
std::set<HMIMessageAdapter*> message_adapters_;
+ mutable sync_primitives::Lock observer_locker_;
+ mutable sync_primitives::Lock message_adapters_locker_;
// Construct message threads when everything is already created
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
index f582cb2b81..8acc8fb207 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -76,6 +76,13 @@ class MessageBrokerAdapter : public HMIMessageAdapterImpl,
void* SubscribeAndBeginReceiverThread(void* param);
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Subscribes to notification from HMI
+ * @param hmi_notification string with notification name
+ */
+ void SubscribeToHMINotification(const std::string& hmi_notification) FINAL;
+#endif // SDL_REMOTE_CONTROL
protected:
void ProcessRecievedFromMB(Json::Value& root);