summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <akutsan@luxoft.com>2018-06-15 14:34:52 +0300
committerIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-26 12:01:48 +0300
commit35b741ca4e32ce7f91508fe6f0af721ca3107ecb (patch)
tree392485bb3297b23ba18e9a446d531f5557b7bc95
parent8feb69c064325bc2e06e43324aed20f2ca0cd445 (diff)
downloadsdl_core-35b741ca4e32ce7f91508fe6f0af721ca3107ecb.tar.gz
Change type of vehicle data in app extension
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h11
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc22
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_;
}
}