diff options
author | Conlain Kelly <conlain.k@gmail.com> | 2018-07-18 11:13:50 -0400 |
---|---|---|
committer | Conlain Kelly <conlain.k@gmail.com> | 2018-07-18 11:13:50 -0400 |
commit | 5019af50b9a2236dd75e630aae5b82e440be9620 (patch) | |
tree | add78dac2559a43a8ee7d82159a01fc15a971c19 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile | |
parent | 4dde9552b3d9ab5fa29502810be48bdf0f793cd7 (diff) | |
download | sdl_core-5019af50b9a2236dd75e630aae5b82e440be9620.tar.gz |
Replace utils::SharedPtr with std::shared_ptr, remove non-standard usage
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile')
13 files changed, 17 insertions, 18 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index 1da9fc497f..fc836aae5f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -592,7 +592,7 @@ const std::string AddCommandRequest::GenerateMobileResponseInfo() { void AddCommandRequest::RemoveCommand() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "No application associated with session key"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc index 0dda8b3277..40debbcd4d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc @@ -149,7 +149,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { } smart_objects::SmartObjectSPtr on_btn_event = - new smart_objects::SmartObject(); + std::make_shared<smart_objects::SmartObject>(); if (!on_btn_event) { LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index 06ff29134c..faf6ffe38b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -138,7 +138,7 @@ void OnButtonPressNotification::Run() { } // if "appID" is present, send it to named app only if its FULL or // LIMITED - if (app.valid()) { + if (app.use_count() != 0) { if (app->app_id() == subscribed_app->app_id()) { SendButtonPress(subscribed_app); } @@ -156,7 +156,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { } smart_objects::SmartObjectSPtr on_btn_press = - new smart_objects::SmartObject(); + std::make_shared<smart_objects::SmartObject>(); if (!on_btn_press) { LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc index 9422bec478..6b5838e40a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc @@ -61,7 +61,7 @@ void OnHMIStatusNotification::Run() { (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 45caedfc2e..c4ee22afed 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -60,7 +60,7 @@ void OnHMIStatusNotificationFromMobile::Run() { static_cast<int32_t>(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR( logger_, "OnHMIStatusNotificationFromMobile application doesn't exist"); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc index 2065c0b52d..04b52f29e1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc @@ -82,7 +82,7 @@ void OnKeyBoardInputNotification::Run() { } } - if (app_to_notify.valid()) { + if (app_to_notify.use_count() != 0) { (*message_)[strings::params][strings::connection_key] = app_to_notify->app_id(); SendNotification(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc index 419024f9b0..b78e541f17 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc @@ -68,7 +68,7 @@ void OnSystemRequestNotification::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Application with connection key " << connection_key() << " is not registered."); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc index 18fe00b54a..92d44d4fe8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc @@ -301,7 +301,7 @@ void PutFileRequest::Run() { void PutFileRequest::SendOnPutFileNotification() { LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); smart_objects::SmartObjectSPtr notification = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared<smart_objects::SmartObject>(smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index 4706f9742f..78a92d360a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -38,7 +38,6 @@ #include <map> #include <string.h> -#include <utils/make_shared.h> #include "application_manager/application_manager.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/application_impl.h" @@ -419,7 +418,7 @@ RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification( const uint32_t connection_key, ApplicationSharedPtr app) { DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr()); smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = mobile_apis::FunctionID::OnSystemRequestID; @@ -838,7 +837,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( bool resumption, bool need_restore_vr) { using namespace smart_objects; - SmartObjectSPtr notification = utils::MakeShared<SmartObject>(SmartType_Map); + SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc index 3cb57c90e8..e6332d85c8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc @@ -259,7 +259,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!message_.valid() || !app.valid()) { + if ((message_.use_count() == 0) || (app.use_count() == 0)) { LOG4CXX_ERROR(logger_, "NULL pointer."); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc index 92c72d7f66..b4b4e84f49 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc @@ -284,7 +284,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); GetInfo(message, ui_response_info_); - if (application.valid()) { + if (application.use_count() != 0) { auto& help_prompt_manager = application->help_prompt_manager(); help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); } @@ -297,7 +297,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { tts_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); GetInfo(message, tts_response_info_); - if (application.valid()) { + if (application.use_count() != 0) { auto& help_prompt_manager = application->help_prompt_manager(); help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc index 80a28b288c..0fdf6d83cf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc @@ -276,7 +276,7 @@ void ShowRequest::Run() { SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true); app_mngr::commands::MessageSharedPtr persistentData = - new smart_objects::SmartObject(msg_params); + std::make_shared<smart_objects::SmartObject>(msg_params); app->set_show_command(*persistentData); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index 62eb2d59c5..78de02b527 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -452,7 +452,7 @@ void SystemRequest::Run() { ApplicationSharedPtr application = application_manager_.application(connection_key()); - if (!(application.valid())) { + if (application.use_count() == 0) { LOG4CXX_ERROR(logger_, "NULL pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; @@ -655,7 +655,7 @@ void SystemRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr application = application_manager_.application(connection_key()); - if (!(application.valid())) { + if (application.use_count() == 0) { LOG4CXX_ERROR(logger_, "NULL pointer"); return; } |