diff options
author | Alexander <akutsan@luxoft.com> | 2018-06-15 14:34:52 +0300 |
---|---|---|
committer | Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> | 2018-06-27 18:20:30 +0300 |
commit | 41aff44d8f250ce3e97de40fd6920dcf606ed263 (patch) | |
tree | 8cf4efbae1201cc12d32951ed927cb3e726a8259 | |
parent | 40c1131d138e5df1eb4fc64f235f3df16301efdd (diff) | |
download | sdl_core-41aff44d8f250ce3e97de40fd6920dcf606ed263.tar.gz |
Change type of vehicle data in app extension
2 files changed, 20 insertions, 13 deletions
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h index 76b44f70f0..95e1fc771b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h @@ -41,6 +41,7 @@ namespace vehicle_info_plugin { namespace app_mngr = application_manager; +typedef mobile_apis::VehicleDataType::eType VehicleDataType; /** * @brief Defines set of vehicle info types */ @@ -51,13 +52,15 @@ class VehicleInfoAppExtension : app_mngr::AppExtension { explicit VehicleInfoAppExtension(app_mngr::AppExtensionUID uid); virtual ~VehicleInfoAppExtension(); - void subscribeToVehicleInfo(const std::string& vehicle_data_type); - void unsubscribeFromVehicleInfo(const std::string& vehicle_data_type); + void subscribeToVehicleInfo(const VehicleDataType vehicle_data); + void unsubscribeFromVehicleInfo(const VehicleDataType vehicle_data); void unsubscribeFromVehicleInfo(); - bool isSubscribedToVehicleInfo(const std::string& vehicle_data_type) const; + bool isSubscribedToVehicleInfo(const VehicleDataType vehicle_data_type) const; + VehicleInfoSubscriptions Subscriptions(); + private: - std::set<std::string> subscribed_data_; + VehicleInfoSubscriptions subscribed_data_; }; } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc index cf7ea808ae..cfd4a403a6 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc @@ -47,15 +47,15 @@ VehicleInfoAppExtension::~VehicleInfoAppExtension() { } void VehicleInfoAppExtension::subscribeToVehicleInfo( - const std::string& vehicle_data_type) { - LOG4CXX_DEBUG(logger_, vehicle_data_type); - subscribed_data_.insert(vehicle_data_type); + const VehicleDataType vehicle_data) { + LOG4CXX_DEBUG(logger_, vehicle_data); + subscribed_data_.insert(vehicle_data); } void VehicleInfoAppExtension::unsubscribeFromVehicleInfo( - const std::string& vehicle_data_type) { - LOG4CXX_DEBUG(logger_, vehicle_data_type); - auto it = subscribed_data_.find(vehicle_data_type); + const VehicleDataType vehicle_data) { + LOG4CXX_DEBUG(logger_, vehicle_data); + auto it = subscribed_data_.find(vehicle_data); if (it != subscribed_data_.end()) { subscribed_data_.erase(it); } @@ -67,8 +67,12 @@ void VehicleInfoAppExtension::unsubscribeFromVehicleInfo() { } bool VehicleInfoAppExtension::isSubscribedToVehicleInfo( - const std::string& vehicle_data_type) const { - LOG4CXX_DEBUG(logger_, vehicle_data_type); - return subscribed_data_.find(vehicle_data_type) != subscribed_data_.end(); + const VehicleDataType vehicle_data) const { + LOG4CXX_DEBUG(logger_, vehicle_data); + return subscribed_data_.find(vehicle_data) != subscribed_data_.end(); +} + +VehicleInfoSubscriptions VehicleInfoAppExtension::Subscriptions() { + return subscribed_data_; } } |