diff options
Diffstat (limited to 'src/components/application_manager/include/application_manager/event_engine/event_observer.h')
-rw-r--r-- | src/components/application_manager/include/application_manager/event_engine/event_observer.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/include/application_manager/event_engine/event_observer.h index 8631203290..3e910edfa9 100644 --- a/src/components/application_manager/include/application_manager/event_engine/event_observer.h +++ b/src/components/application_manager/include/application_manager/event_engine/event_observer.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2016, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without @@ -35,15 +35,13 @@ #include <string> #include "application_manager/event_engine/event.h" -#include "application_manager/event_engine/event_dispatcher.h" namespace application_manager { namespace event_engine { -class EventObserver -{ +class EventDispatcher; +class EventObserver { public: - friend class EventDispatcher; // Typedef for possible Observer ID's from mobile_apis functionID enum @@ -53,7 +51,7 @@ class EventObserver * @brief Constructor * */ - EventObserver(); + EventObserver(EventDispatcher& event_dispatcher); /* * @brief Destructor @@ -75,7 +73,6 @@ class EventObserver virtual void on_event(const Event& event) = 0; protected: - /* * @brief Subscribe to an event * @@ -83,8 +80,8 @@ class EventObserver * @param hmi_correlation_id The event HMI correlation ID. * If param is omitted, it means subscription for HMI notification */ - void subscribe_on_event( - const Event::EventID& event_id, int32_t hmi_correlation_id = 0); + void subscribe_on_event(const Event::EventID& event_id, + int32_t hmi_correlation_id = 0); /* * @brief Unsubscribes the observer from specific event @@ -100,8 +97,8 @@ class EventObserver void unsubscribe_from_all_events(); private: - ObserverID id_; + EventDispatcher& event_dispatcher_; DISALLOW_COPY_AND_ASSIGN(EventObserver); }; @@ -110,7 +107,7 @@ const EventObserver::ObserverID& EventObserver::id() const { return id_; } -} -} +} // namespace event_engine +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_ |