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/src | |
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/src')
25 files changed, 182 insertions, 182 deletions
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc index 481635d8e6..25cb5a7e1e 100644 --- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc +++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc @@ -38,7 +38,7 @@ #include "connection_handler/connection_handler.h" #include "application_manager/application.h" #include "utils/timer_task_impl.h" -#include "utils/make_shared.h" + namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -60,7 +60,7 @@ void AppLaunchCtrlImpl::OnAppRegistered( const application_manager::Application& app) { LOG4CXX_AUTO_TRACE(logger_); // TODO (AKutsan) : get device mac - ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( app.policy_app_id(), app.bundle_id(), app.mac_address()); apps_launcher_.OnLaunched(app_data); app_launch_data_.AddApplicationData(*app_data); diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc index 64f9102d90..9a7ae0dee8 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc @@ -37,7 +37,7 @@ #include "application_manager/app_launch/app_launch_sql_queries.h" #include "application_manager/smart_object_keys.h" #include "application_manager/message_helper.h" -#include "utils/make_shared.h" + namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -276,7 +276,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataDB::GetAppDataByDevMac( const std::string device_mac = query.GetString(device_mac_index); const std::string mobile_app_id = query.GetString(application_id_index); const std::string bundle_id = query.GetString(bundle_id_index); - dev_apps.push_back(utils::MakeShared<ApplicationData>( + dev_apps.push_back(std::make_shared<ApplicationData>( mobile_app_id, bundle_id, device_mac)); } while (query.Next()); LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded"); diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc index 7599dcccb3..f59053d97b 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc @@ -33,7 +33,7 @@ #include "application_manager/app_launch/app_launch_data_json.h" #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" -#include "utils/make_shared.h" + #include "utils/date_time.h" #include "json/json.h" @@ -185,7 +185,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac( if (deviceMac == dev_mac) { dev_apps.push_back( - utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac)); + std::make_shared<ApplicationData>(appID, bundleID, deviceMac)); } } } diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc index bf3ce1e0a9..f3851482c1 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -1,6 +1,6 @@ #include <algorithm> #include "application_manager/app_launch/apps_launcher.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include <iostream> @@ -15,7 +15,7 @@ struct LauncherGenerator { , app_launch_max_retry_attempt_(app_launch_max_retry_attempt) , app_launch_retry_wait_time_(app_launch_retry_wait_time) {} AppsLauncher::LauncherPtr operator()() { - return utils::MakeShared<AppsLauncher::Launcher>( + return std::make_shared<AppsLauncher::Launcher>( apps_laucnher_, connection_handler_, app_launch_max_retry_attempt_, diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc index 9c67c70e2c..3532cb819a 100644 --- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc @@ -6,8 +6,8 @@ #include "application_manager/app_launch/app_launch_data.h" #include "application_manager/app_launch/apps_launcher.h" #include "application_manager/resumption/resume_ctrl.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/timer.h" #include "utils/timer_task_impl.h" #include <iostream> @@ -16,7 +16,7 @@ namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice; -typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr; +typedef std::shared_ptr<AppsOnDevice> AppsOnDevicePtr; class Launcher { public: @@ -95,7 +95,7 @@ class Launcher { AppsOnDevicePtr apps_on_device_; }; -typedef utils::SharedPtr<Launcher> LauncherPtr; +typedef std::shared_ptr<Launcher> LauncherPtr; typedef std::vector<LauncherPtr> Launchers; struct LauncherGenerator { @@ -107,7 +107,7 @@ struct LauncherGenerator { , apps_launcher_(apps_launcher) {} LauncherPtr operator()() const { - return utils::MakeShared<Launcher>( + return std::make_shared<Launcher>( resume_ctrl_, interface_, apps_launcher_); } @@ -130,7 +130,7 @@ DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface, } bool DeviceAppsLauncherImpl::LauncherFinder::operator()( - const utils::SharedPtr<Launcher>& launcher) const { + const std::shared_ptr<Launcher>& launcher) const { return device_mac_ == launcher->apps_on_device_->first; } @@ -142,7 +142,7 @@ bool DeviceAppsLauncherImpl::LaunchAppsOnDevice( "On Device " << device_mac << " will be launched " << applications_to_launch.size() << " apps"); AppsOnDevicePtr apps_on_device = - utils::MakeShared<AppsOnDevice>(device_mac, applications_to_launch); + std::make_shared<AppsOnDevice>(device_mac, applications_to_launch); sync_primitives::AutoLock lock(launchers_lock_); DCHECK_OR_RETURN(!free_launchers_.empty(), false) const Launchers::iterator it = free_launchers_.begin(); diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 717fbeba1b..aca4b9ba05 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -41,8 +41,8 @@ #include "utils/file_system.h" #include "utils/logger.h" #include "utils/gen_hash.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/timer_task_impl.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/resumption/resume_ctrl.h" @@ -83,8 +83,8 @@ void SwitchApplicationParameters(ApplicationSharedPtr app, const size_t device_id, const std::string& mac_address) { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr<ApplicationImpl> application = - ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app); + std::shared_ptr<ApplicationImpl> application = + std::dynamic_pointer_cast<ApplicationImpl>(app); DCHECK_OR_RETURN_VOID(application); application->app_id_ = app_id; application->device_id_ = device_id; @@ -97,7 +97,7 @@ ApplicationImpl::ApplicationImpl( const std::string& mac_address, const connection_handler::DeviceHandle device_id, const custom_str::CustomString& app_name, - utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager, ApplicationManager& application_manager) : grammar_id_(0) , hmi_app_id_(0) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 571359007c..41dcdf3885 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -65,7 +65,7 @@ #include "utils/threads/thread.h" #include "utils/file_system.h" #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include "smart_objects/enum_schema_item.h" #include "interfaces/HMI_API_schema.h" @@ -186,7 +186,7 @@ ApplicationManagerImpl::ApplicationManagerImpl( {TYPE_ICONS, "Icons"}}; sync_primitives::AutoLock lock(timer_pool_lock_); - TimerSPtr clearing_timer(utils::MakeShared<timer::Timer>( + TimerSPtr clearing_timer(std::make_shared<timer::Timer>( "ClearTimerPoolTimer", new TimerTaskImpl<ApplicationManagerImpl>( this, &ApplicationManagerImpl::ClearTimerPool))); @@ -411,7 +411,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( bool mobile_projection_state = app->mobile_projection_enabled(); ApplicationSharedPtr active_app = active_application(); // Check app in FULL level - if (active_app.valid()) { + if (active_app.use_count() != 0) { // If checking app hmi level FULL, we return false // because we couldn't have two applications with same HMIType in FULL and // LIMITED HMI level @@ -438,28 +438,28 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( // Check LIMITED apps if (voice_state) { - if (get_limited_voice_application().valid() && + if ((get_limited_voice_application().use_count() != 0) && (get_limited_voice_application()->app_id() != app->app_id())) { return true; } } if (media_state) { - if (get_limited_media_application().valid() && + if ((get_limited_media_application().use_count() != 0) && (get_limited_media_application()->app_id() != app->app_id())) { return true; } } if (navi_state) { - if (get_limited_navi_application().valid() && + if ((get_limited_navi_application().use_count() != 0) && (get_limited_navi_application()->app_id() != app->app_id())) { return true; } } if (mobile_projection_state) { - if (get_limited_mobile_projection_application().valid() && + if ((get_limited_mobile_projection_application().use_count() != 0) && (get_limited_mobile_projection_application()->app_id() != app->app_id())) { return true; @@ -470,7 +470,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( } ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( - const utils::SharedPtr<smart_objects::SmartObject>& + const std::shared_ptr<smart_objects::SmartObject>& request_for_registration) { LOG4CXX_AUTO_TRACE(logger_); @@ -488,7 +488,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( if (connection_handler().get_session_observer().GetDataOnSessionKey( connection_key, &app_id, &sessions_list, &device_id) == -1) { LOG4CXX_ERROR(logger_, "Failed to create application: no connection info."); - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -520,7 +520,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( if (!is_all_apps_allowed_) { LOG4CXX_WARN(logger_, "RegisterApplication: access to app's disabled by user"); - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -539,7 +539,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( GetPolicyHandler().GetStatisticManager(), *this)); if (!application) { - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -550,7 +550,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( } HmiStatePtr initial_state = - CreateRegularState(utils::SharedPtr<Application>(application), + CreateRegularState(std::shared_ptr<Application>(application), mobile_apis::HMILevel::INVALID_ENUM, mobile_apis::AudioStreamingState::INVALID_ENUM, mobile_apis::VideoStreamingState::INVALID_ENUM, @@ -705,7 +705,7 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed( const bool is_audio_app = app->IsAudioApplication(); const bool does_audio_app_with_same_type_exist = IsAppTypeExistsInFullOrLimited(app); - const bool is_active_app_exist = active_application().valid(); + const bool is_active_app_exist = (active_application().use_count() != 0); mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL; if (is_audio_app && does_audio_app_with_same_type_exist) { @@ -747,42 +747,42 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { hmi_cooperating_ = true; MessageHelper::SendGetSystemInfoRequest(*this); - utils::SharedPtr<smart_objects::SmartObject> is_vr_ready( + std::shared_ptr<smart_objects::SmartObject> is_vr_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady, *this)); rpc_service_->ManageHMICommand(is_vr_ready); - utils::SharedPtr<smart_objects::SmartObject> is_tts_ready( + std::shared_ptr<smart_objects::SmartObject> is_tts_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady, *this)); rpc_service_->ManageHMICommand(is_tts_ready); - utils::SharedPtr<smart_objects::SmartObject> is_ui_ready( + std::shared_ptr<smart_objects::SmartObject> is_ui_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady, *this)); rpc_service_->ManageHMICommand(is_ui_ready); - utils::SharedPtr<smart_objects::SmartObject> is_navi_ready( + std::shared_ptr<smart_objects::SmartObject> is_navi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Navigation_IsReady, *this)); rpc_service_->ManageHMICommand(is_navi_ready); - utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready( + std::shared_ptr<smart_objects::SmartObject> is_ivi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VehicleInfo_IsReady, *this)); rpc_service_->ManageHMICommand(is_ivi_ready); - utils::SharedPtr<smart_objects::SmartObject> is_rc_ready( + std::shared_ptr<smart_objects::SmartObject> is_rc_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady, *this)); rpc_service_->ManageHMICommand(is_rc_ready); - utils::SharedPtr<smart_objects::SmartObject> button_capabilities( + std::shared_ptr<smart_objects::SmartObject> button_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Buttons_GetCapabilities, *this)); rpc_service_->ManageHMICommand(button_capabilities); - utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request( + std::shared_ptr<smart_objects::SmartObject> mixing_audio_supported_request( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported, *this)); @@ -862,7 +862,7 @@ void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) { } HmiStatePtr ApplicationManagerImpl::CreateRegularState( - utils::SharedPtr<Application> app, + std::shared_ptr<Application> app, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::VideoStreamingState::eType video_state, @@ -1021,7 +1021,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated( return; } - smart_objects::SmartObjectSPtr update_list = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr update_list = std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& so_to_send = *update_list; so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList; @@ -1108,7 +1108,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart( return; } - auto update_list = utils::MakeShared<smart_objects::SmartObject>(); + auto update_list = std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& so_to_send = *update_list; so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList; @@ -1295,7 +1295,7 @@ void ApplicationManagerImpl::ReplaceMobileByHMIAppId( if (message.keyExists(strings::app_id)) { ApplicationSharedPtr application_ptr = application(message[strings::app_id].asUInt()); - if (application_ptr.valid()) { + if (application_ptr.use_count() != 0) { LOG4CXX_DEBUG(logger_, "ReplaceMobileByHMIAppId from " << message[strings::app_id].asInt() << " to " @@ -1332,7 +1332,7 @@ void ApplicationManagerImpl::ReplaceHMIByMobileAppId( ApplicationSharedPtr application = application_by_hmi_app(message[strings::app_id].asUInt()); - if (application.valid()) { + if (application.use_count() != 0) { LOG4CXX_DEBUG(logger_, "ReplaceHMIByMobileAppId from " << message[strings::app_id].asInt() << " to " @@ -2421,7 +2421,7 @@ void ApplicationManagerImpl::SendOnSDLClose() { // must be sent to PASA HMI on shutdown synchronously smart_objects::SmartObjectSPtr msg = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared<smart_objects::SmartObject>(smart_objects::SmartType_Map); (*msg)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLClose; @@ -2438,7 +2438,7 @@ void ApplicationManagerImpl::SendOnSDLClose() { } // SmartObject |message| has no way to declare priority for now - utils::SharedPtr<Message> message_to_send( + std::shared_ptr<Message> message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); hmi_so_factory().attachSchema(*msg, false); @@ -2880,7 +2880,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { navi_app_to_stop_.push_back(app_id); - TimerSPtr close_timer(utils::MakeShared<timer::Timer>( + TimerSPtr close_timer(std::make_shared<timer::Timer>( "CloseNaviAppTimer", new TimerTaskImpl<ApplicationManagerImpl>( this, &ApplicationManagerImpl::CloseNaviApp))); @@ -2955,7 +2955,7 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id, if (from == HMI_FULL || from == HMI_LIMITED) { LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED"); navi_app_to_end_stream_.push_back(app_id); - TimerSPtr end_stream_timer(utils::MakeShared<timer::Timer>( + TimerSPtr end_stream_timer(std::make_shared<timer::Timer>( "AppShouldFinishStreaming", new TimerTaskImpl<ApplicationManagerImpl>( this, &ApplicationManagerImpl::EndNaviStreaming))); @@ -2973,11 +2973,11 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id, } void ApplicationManagerImpl::SendHMIStatusNotification( - const utils::SharedPtr<Application> app) { + const std::shared_ptr<Application> app) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = @@ -3517,7 +3517,7 @@ void ApplicationManagerImpl::SendDriverDistractionState( return; } smart_objects::SmartObjectSPtr on_driver_distraction = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*on_driver_distraction)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); @@ -3640,7 +3640,7 @@ bool ApplicationManagerImpl::IsAppSubscribedForWayPoints( LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); - if (subscribed_way_points_apps_list_.find(app) == + if (subscribed_way_points_apps_list_.find(app->app_id()) == subscribed_way_points_apps_list_.end()) { return false; } @@ -3651,7 +3651,7 @@ void ApplicationManagerImpl::SubscribeAppForWayPoints( ApplicationSharedPtr app) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); - subscribed_way_points_apps_list_.insert(app); + subscribed_way_points_apps_list_.insert(app->app_id()); LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); @@ -3661,7 +3661,7 @@ void ApplicationManagerImpl::UnsubscribeAppFromWayPoints( ApplicationSharedPtr app) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); - subscribed_way_points_apps_list_.erase(app); + subscribed_way_points_apps_list_.erase(app->app_id()); LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc index 9799b170dc..ea74e78f4e 100644 --- a/src/components/application_manager/src/command_holder_impl.cc +++ b/src/components/application_manager/src/command_holder_impl.cc @@ -43,7 +43,7 @@ CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager) void CommandHolderImpl::Suspend( ApplicationSharedPtr application, CommandType type, - utils::SharedPtr<smart_objects::SmartObject> command) { + std::shared_ptr<smart_objects::SmartObject> command) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(application); LOG4CXX_DEBUG(logger_, diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index dbe89b8881..db78ad15f0 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -40,7 +40,7 @@ namespace { struct AppExtensionPredicate { AppExtensionUID uid; bool operator()(const ApplicationSharedPtr app) { - return app ? app->QueryInterface(uid).valid() : false; + return app ? (app->QueryInterface(uid).use_count() != 0) : false; } }; } diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 491fc72de4..18b3d2a94e 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -34,7 +34,7 @@ #include <numeric> #include <string> #include "utils/macro.h" -#include "utils/make_shared.h" + #include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" @@ -145,7 +145,7 @@ struct DisallowedParamsInserter { VehicleData::const_iterator it = vehicle_data.find(param); if (vehicle_data.end() != it) { smart_objects::SmartObjectSPtr disallowed_param = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared<smart_objects::SmartObject>(smart_objects::SmartType_Map); (*disallowed_param)[strings::data_type] = (*it).second; (*disallowed_param)[strings::result_code] = code_; response_[strings::msg_params][param.c_str()] = *disallowed_param; @@ -273,7 +273,7 @@ void CommandRequestImpl::SendResponse( } smart_objects::SmartObjectSPtr result = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& response = *result; @@ -417,7 +417,7 @@ uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject* msg_params, bool use_events) { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared<smart_objects::SmartObject>(); const uint32_t hmi_correlation_id = application_manager_.GetNextHMICorrelationID(); @@ -455,7 +455,7 @@ uint32_t CommandRequestImpl::SendHMIRequest( void CommandRequestImpl::CreateHMINotification( const hmi_apis::FunctionID::eType& function_id, const NsSmart::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared<smart_objects::SmartObject>(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc index 1fef383213..649b52fde9 100644 --- a/src/components/application_manager/src/commands/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/notification_from_hmi.cc @@ -76,7 +76,7 @@ void NotificationFromHMI::SendNotificationToMobile( void NotificationFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared<smart_objects::SmartObject>(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc index f77495ac31..b993ab033e 100644 --- a/src/components/application_manager/src/commands/request_from_hmi.cc +++ b/src/components/application_manager/src/commands/request_from_hmi.cc @@ -33,7 +33,7 @@ #include "application_manager/commands/request_from_hmi.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" -#include "utils/make_shared.h" + namespace application_manager { @@ -74,7 +74,7 @@ void RequestFromHMI::SendResponse( const hmi_apis::FunctionID::eType function_id, const hmi_apis::Common_Result::eType result_code) { smart_objects::SmartObjectSPtr message = - ::utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); FillCommonParametersOfSO(*message, correlation_id, function_id); (*message)[strings::params][strings::message_type] = MessageType::kResponse; @@ -91,7 +91,7 @@ void RequestFromHMI::SendErrorResponse( const hmi_apis::Common_Result::eType result_code, const std::string error_message) { smart_objects::SmartObjectSPtr message = - ::utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); FillCommonParametersOfSO(*message, correlation_id, function_id); (*message)[strings::params][strings::message_type] = diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc index 123dbad828..bf732830f2 100644 --- a/src/components/application_manager/src/commands/response_from_hmi.cc +++ b/src/components/application_manager/src/commands/response_from_hmi.cc @@ -80,7 +80,7 @@ void ResponseFromHMI::SendResponseToMobile( void ResponseFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared<smart_objects::SmartObject>(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc index 0587327791..6fb88ddd3b 100644 --- a/src/components/application_manager/src/help_prompt_manager_impl.cc +++ b/src/components/application_manager/src/help_prompt_manager_impl.cc @@ -38,7 +38,7 @@ #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" #include "utils/logger.h" -#include "utils/make_shared.h" + CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl") @@ -86,7 +86,7 @@ bool HelpPromptManagerImpl::AddCommand( LOG4CXX_DEBUG(logger_, "Will be added " << count_new_commands << " commands"); smart_objects::SmartObjectSPtr vr_item = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Array); smart_objects::SmartArray& ar_vr_cmd = *(vr_item->asArray()); smart_objects::SmartArray& ar_cmd = *(commands.asArray()); @@ -207,7 +207,7 @@ void HelpPromptManagerImpl::SendTTSRequest() { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "TTS request for appID:" << app_.app_id()); smart_objects::SmartObjectSPtr tts_global_properties = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (tts_global_properties) { smart_objects::SmartObject& ref = *tts_global_properties; @@ -241,7 +241,7 @@ void HelpPromptManagerImpl::SendUIRequest() { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "UI request for appID:" << app_.app_id()); smart_objects::SmartObjectSPtr ui_global_properties = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (ui_global_properties) { smart_objects::SmartObject& ref = *ui_global_properties; diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index ce8514010f..b1872dfaab 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -223,7 +223,7 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( const uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr notification =std::make_shared<smart_objects::SmartObject>(); DCHECK_OR_RETURN_VOID(notification); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index e1bc2b5125..0033fe4fb6 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -42,7 +42,7 @@ namespace application_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState") -HmiState::HmiState(utils::SharedPtr<Application> app, +HmiState::HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr, StateID state_id) : app_(app) @@ -55,7 +55,7 @@ HmiState::HmiState(utils::SharedPtr<Application> app, LOG4CXX_DEBUG(logger_, *this); } -HmiState::HmiState(utils::SharedPtr<Application> app, +HmiState::HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : app_(app) , state_id_(STATE_ID_REGULAR) @@ -115,7 +115,7 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state() return AudioStreamingState::NOT_AUDIBLE; } -VRHmiState::VRHmiState(utils::SharedPtr<Application> app, +VRHmiState::VRHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_VR_SESSION) {} @@ -123,7 +123,7 @@ DEPRECATED VRHmiState::VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr) : HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {} -TTSHmiState::TTSHmiState(utils::SharedPtr<Application> app, +TTSHmiState::TTSHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {} @@ -147,7 +147,7 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state() } VideoStreamingHmiState::VideoStreamingHmiState( - utils::SharedPtr<Application> app, const ApplicationManager& app_mngr) + std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_VIDEO_STREAMING) {} mobile_apis::VideoStreamingState::eType @@ -159,7 +159,7 @@ VideoStreamingHmiState::video_streaming_state() const { return mobile_apis::VideoStreamingState::NOT_STREAMABLE; } -NaviStreamingHmiState::NaviStreamingHmiState(utils::SharedPtr<Application> app, +NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : VideoStreamingHmiState(app, app_mngr) { set_state_id(STATE_ID_NAVI_STREAMING); @@ -185,7 +185,7 @@ NaviStreamingHmiState::audio_streaming_state() const { return expected_state; } -PhoneCallHmiState::PhoneCallHmiState(utils::SharedPtr<Application> app, +PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {} @@ -210,7 +210,7 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const { return HMILevel::HMI_BACKGROUND; } -SafetyModeHmiState::SafetyModeHmiState(utils::SharedPtr<Application> app, +SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {} @@ -218,7 +218,7 @@ DEPRECATED SafetyModeHmiState::SafetyModeHmiState( uint32_t app_id, const ApplicationManager& app_mngr) : HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {} -DeactivateHMI::DeactivateHMI(utils::SharedPtr<Application> app, +DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {} @@ -238,7 +238,7 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const { return HMILevel::HMI_BACKGROUND; } -AudioSource::AudioSource(utils::SharedPtr<Application> app, +AudioSource::AudioSource(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) {} @@ -256,7 +256,7 @@ mobile_apis::HMILevel::eType AudioSource::hmi_level() const { return mobile_apis::HMILevel::HMI_BACKGROUND; } -EmbeddedNavi::EmbeddedNavi(utils::SharedPtr<Application> app, +EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {} diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 81491b7bf9..aa3f2449ee 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -61,7 +61,7 @@ #include "utils/file_system.h" #include "utils/macro.h" #include "utils/logger.h" -#include "utils/make_shared.h" + #include "formatters/formatter_json_rpc.h" #include "formatters/CFormatterJsonSDLRPCv2.h" @@ -258,7 +258,7 @@ MessageHelper::CreateHMINotification(hmi_apis::FunctionID::eType function_id) { using smart_objects::SmartType_Map; LOG4CXX_AUTO_TRACE(logger_); SmartObjectSPtr notification_ptr = - utils::MakeShared<SmartObject>(SmartType_Map); + std::make_shared<SmartObject>(SmartType_Map); SmartObject& notification = *notification_ptr; notification[strings::params][strings::message_type] = static_cast<int32_t>(kNotification); @@ -315,7 +315,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI( hmi_apis::messageType::eType message_type, const uint32_t correlation_id) { using namespace smart_objects; - SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map); SmartObject& ref = *message; ref[strings::params][strings::message_type] = static_cast<int>(message_type); @@ -331,7 +331,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification( const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); 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::OnHashChangeID; @@ -399,7 +399,7 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = static_cast<int32_t>( @@ -698,7 +698,7 @@ void MessageHelper::SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr notification = std::make_shared<smart_objects::SmartObject>(); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; @@ -739,8 +739,8 @@ void MessageHelper::SendActivateAppToHMI( return; } - utils::SharedPtr<smart_objects::SmartObject> message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::shared_ptr<smart_objects::SmartObject> message = + std::make_shared<smart_objects::SmartObject>(smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_ActivateApp; @@ -825,7 +825,7 @@ void MessageHelper::CreateGetVehicleDataRequest( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr request = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*request)[strings::params][strings::message_type] = static_cast<int>(kRequest); @@ -853,7 +853,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr response = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*response)[strings::params][strings::function_id] = static_cast<int>(function_id); @@ -877,7 +877,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr device_list_so = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); (*device_list_so)[strings::device_list] = @@ -911,7 +911,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO( uint32_t function_id, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr module_info = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); smart_objects::SmartObject& object = *module_info; object[strings::params][strings::message_type] = static_cast<int>(kRequest); @@ -927,7 +927,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon( const std::string& path_to_icon, uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr set_icon = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (!set_icon) { @@ -954,7 +954,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification( LOG4CXX_AUTO_TRACE(logger_); SmartObjectSPtr notification_ptr = - utils::MakeShared<SmartObject>(SmartType_Map); + std::make_shared<SmartObject>(SmartType_Map); if (!notification_ptr) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; @@ -988,7 +988,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp( using namespace mobile_apis; LOG4CXX_AUTO_TRACE(logger_); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application pointer "); return; } @@ -1044,7 +1044,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app, void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return; } @@ -1064,7 +1064,7 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI( LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectList requests; - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return requests; } @@ -1197,7 +1197,7 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app, smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp( ApplicationConstSharedPtr app) { smart_objects::SmartObjectSPtr result = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (!result) { return NULL; @@ -1420,7 +1420,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration( void MessageHelper::SendUIChangeRegistrationRequestToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Application is not valid"); return; } @@ -1595,7 +1595,7 @@ bool MessageHelper::CreateHMIApplicationStruct( void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return; } @@ -1651,7 +1651,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI( bool is_unexpected_disconnect, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; @@ -1681,7 +1681,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID(); 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] = hmi_apis::FunctionID::BasicCommunication_ActivateApp; @@ -1724,8 +1724,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id, return; } - utils::SharedPtr<smart_objects::SmartObject> message = - utils::MakeShared<smart_objects::SmartObject>( + std::shared_ptr<smart_objects::SmartObject> message = + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = @@ -1744,7 +1744,7 @@ void MessageHelper::SendSDLActivateAppResponse( const uint32_t correlation_id, ApplicationManager& app_mngr) { 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] = @@ -1793,7 +1793,7 @@ void MessageHelper::SendSDLActivateAppResponse( void MessageHelper::SendOnSDLConsentNeeded( const policy::DeviceParams& device_info, ApplicationManager& app_man) { 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] = @@ -1833,7 +1833,7 @@ void MessageHelper::SendGetUserFriendlyMessageResponse( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared<smart_objects::SmartObject>(smart_objects::SmartType_Map); if (!message) { return; } @@ -1903,7 +1903,7 @@ void MessageHelper::SendGetListOfPermissionsResponse( using namespace smart_objects; using namespace hmi_apis; - SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map); DCHECK_OR_RETURN_VOID(message); SmartObject& params = (*message)[strings::params]; @@ -1945,7 +1945,7 @@ void MessageHelper::SendGetListOfPermissionsResponse( using namespace smart_objects; using namespace hmi_apis; - SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map); DCHECK_OR_RETURN_VOID(message); SmartObject& params = (*message)[strings::params]; @@ -1986,7 +1986,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse( response_data[strings::msg_params][strings::success] = false; response_data[strings::params][strings::connection_key] = connection_key; - return utils::MakeShared<smart_objects::SmartObject>(response_data); + return std::make_shared<smart_objects::SmartObject>(response_data); } void MessageHelper::SendNaviSetVideoConfig( @@ -2136,7 +2136,7 @@ void MessageHelper::SendOnDataStreaming( } smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); (*notification)[strings::params][strings::function_id] = @@ -2226,7 +2226,7 @@ void MessageHelper::SendSystemRequestNotification( #endif DCHECK(app_mngr.GetRPCService().ManageMobileCommand( - utils::MakeShared<smart_objects::SmartObject>(content), + std::make_shared<smart_objects::SmartObject>(content), commands::Command::SOURCE_SDL)); } @@ -2394,7 +2394,7 @@ void MessageHelper::SendOnPermissionsChangeNotification( } app_mngr.GetRPCService().ManageMobileCommand( - utils::MakeShared<smart_objects::SmartObject>(content), + std::make_shared<smart_objects::SmartObject>(content), commands::Command::SOURCE_SDL); } @@ -2479,14 +2479,14 @@ void MessageHelper::SendOnAppPermissionsChangedNotification( } app_mngr.GetRPCService().ManageHMICommand( - utils::MakeShared<smart_objects::SmartObject>(message)); + std::make_shared<smart_objects::SmartObject>(message)); } void MessageHelper::SendGetStatusUpdateResponse(const std::string& status, const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (!message) { return; @@ -2507,7 +2507,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); DCHECK(message); @@ -2525,7 +2525,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, void MessageHelper::SendOnStatusUpdate(const std::string& status, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (!message) { return; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 88c01c7af7..ce0bac9c0e 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -54,7 +54,7 @@ #include "interfaces/MOBILE_API.h" #include "utils/file_system.h" #include "utils/scope_guard.h" -#include "utils/make_shared.h" + #include "utils/helpers.h" #include "policy/policy_manager.h" @@ -224,7 +224,7 @@ struct LinksCollector { } void operator()(const ApplicationSharedPtr& app) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Skip current application."); @@ -258,7 +258,7 @@ struct LinkAppToDevice { } void operator()(const ApplicationSharedPtr& app) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Skip current application."); @@ -328,7 +328,7 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings, , dl_handle_(0) , last_activated_app_id_(0) , app_to_device_link_lock_(true) - , statistic_manager_impl_(utils::MakeShared<StatisticManagerImpl>(this)) + , statistic_manager_impl_(std::make_shared<StatisticManagerImpl>(this)) , settings_(settings) , application_manager_(application_manager) {} @@ -355,14 +355,14 @@ bool PolicyHandler::LoadPolicyLibrary() { if (CreateManager()) { policy_manager_->set_listener(this); event_observer_ = - utils::SharedPtr<PolicyEventObserver>(new PolicyEventObserver( + std::shared_ptr<PolicyEventObserver>(new PolicyEventObserver( this, application_manager_.event_dispatcher())); } } else { LOG4CXX_ERROR(logger_, error); } - return policy_manager_.valid(); + return (policy_manager_.use_count() != 0); } bool PolicyHandler::CreateManager() { @@ -375,11 +375,11 @@ bool PolicyHandler::CreateManager() { char* error_string = dlerror(); if (NULL == error_string) { policy_manager_ = - utils::SharedPtr<PolicyManager>(create_manager(), delete_manager); + std::shared_ptr<PolicyManager>(create_manager(), delete_manager); } else { LOG4CXX_WARN(logger_, error_string); } - return policy_manager_.valid(); + return (policy_manager_.use_count() != 0); } const PolicySettings& PolicyHandler::get_settings() const { @@ -520,7 +520,7 @@ void PolicyHandler::SendOnAppPermissionsChanged( << policy_app_id); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id); return; } @@ -555,7 +555,7 @@ struct SmartObjectToInt { StatusNotifier PolicyHandler::AddApplication( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) { - POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>()); + POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>()); return policy_manager_->AddApplication(application_id, hmi_types); } @@ -591,7 +591,7 @@ void PolicyHandler::OnAppPermissionConsentInternal( if (connection_key) { ApplicationSharedPtr app = application_manager_.application(connection_key); - if (app.valid()) { + if (app.use_count() != 0) { out_permissions.policy_app_id = app->policy_app_id(); DeviceParams device_params = GetDeviceParams( app->device(), @@ -618,7 +618,7 @@ void PolicyHandler::OnAppPermissionConsentInternal( // If list of apps sent to HMI for user consents is not the same as // current, // permissions should be set only for coincident to registered apps - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Permissions setting skipped."); @@ -733,7 +733,7 @@ std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions( ApplicationSharedPtr app = application_manager_.application(connection_key); std::vector<FunctionalGroupPermission> group_permissions; - if (NULL == app.get() || !app.valid()) { + if (NULL == app.get() || app.use_count() == 0) { LOG4CXX_WARN(logger_, "Connection key '" << connection_key @@ -883,7 +883,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired( ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Application with id '" << policy_app_id @@ -958,7 +958,7 @@ void PolicyHandler::OnPendingPermissionChange( POLICY_LIB_CHECK_VOID(); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "No app found for " << policy_app_id << " policy app id."); return; @@ -1269,7 +1269,7 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key, LOG4CXX_AUTO_TRACE(logger_); POLICY_LIB_CHECK_VOID(); ApplicationSharedPtr app = application_manager_.application(connection_key); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Activated App failed: no app found."); return; } @@ -1363,7 +1363,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); @@ -1416,7 +1416,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); @@ -1627,7 +1627,7 @@ void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) { listeners_.remove(listener); } -utils::SharedPtr<usage_statistics::StatisticsManager> +std::shared_ptr<usage_statistics::StatisticsManager> PolicyHandler::GetStatisticManager() const { return statistic_manager_impl_; } @@ -1669,7 +1669,7 @@ custom_str::CustomString PolicyHandler::GetAppName( ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index e052e347f0..1c103b13af 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -35,7 +35,7 @@ #include "application_manager/request_controller.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/request_to_hmi.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace application_manager { @@ -176,7 +176,7 @@ RequestController::TResult RequestController::addHMIRequest( const RequestPtr request) { LOG4CXX_AUTO_TRACE(logger_); - if (!request.valid()) { + if (request.use_count() == 0) { LOG4CXX_ERROR(logger_, "HMI request pointer is invalid"); return RequestController::INVALID_DATA; } @@ -185,7 +185,7 @@ RequestController::TResult RequestController::addHMIRequest( const uint64_t timeout_in_mseconds = static_cast<uint64_t>(request->default_timeout()); RequestInfoPtr request_info_ptr = - utils::MakeShared<HMIRequestInfo>(request, timeout_in_mseconds); + std::make_shared<HMIRequestInfo>(request, timeout_in_mseconds); if (0 == timeout_in_mseconds) { LOG4CXX_DEBUG(logger_, @@ -287,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests( std::list<RequestPtr>::iterator request_it = mobile_request_list_.begin(); while (mobile_request_list_.end() != request_it) { RequestPtr request = (*request_it); - if ((request.valid()) && (request->connection_key() == app_id)) { + if ((request.use_count() != 0) && (request->connection_key() == app_id)) { mobile_request_list_.erase(request_it++); } else { ++request_it; @@ -488,7 +488,7 @@ void RequestController::Worker::threadMain() { const uint32_t timeout_in_mseconds = request_ptr->default_timeout(); RequestInfoPtr request_info_ptr = - utils::MakeShared<MobileRequestInfo>(request_ptr, timeout_in_mseconds); + std::make_shared<MobileRequestInfo>(request_ptr, timeout_in_mseconds); if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) { commands::CommandRequestImpl* cmd_request = diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 9a5828d939..04210a7572 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -151,7 +151,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key, RequestInfoPtr result; // Request info for searching in request info set by log_n time - utils::SharedPtr<FakeRequestInfo> request_info_for_search( + std::shared_ptr<FakeRequestInfo> request_info_for_search( new FakeRequestInfo(connection_key, correlation_id)); sync_primitives::AutoLock lock(this_lock_); diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index be2bff5534..74054eab29 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -48,7 +48,7 @@ #include "utils/helpers.h" #include "application_manager/resumption/resumption_data_db.h" #include "application_manager/resumption/resumption_data_json.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace resumption { @@ -79,7 +79,7 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager) , application_manager_(application_manager) {} #ifdef BUILD_TESTS void ResumeCtrlImpl::set_resumption_storage( - utils::SharedPtr<ResumptionData> mock_storage) { + std::shared_ptr<ResumptionData> mock_storage) { resumption_storage_ = mock_storage; } diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index 42894a36a8..3152d1f749 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -54,7 +54,7 @@ RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager) RPCHandlerImpl::~RPCHandlerImpl() {} void RPCHandlerImpl::ProcessMessageFromMobile( - const utils::SharedPtr<Message> message) { + const std::shared_ptr<Message> message) { LOG4CXX_AUTO_TRACE(logger_); #ifdef TELEMETRY_MONITOR AMTelemetryObserver::MessageMetricSharedPtr metric( @@ -62,7 +62,7 @@ void RPCHandlerImpl::ProcessMessageFromMobile( metric->begin = date_time::DateTime::getCurrentTime(); #endif // TELEMETRY_MONITOR smart_objects::SmartObjectSPtr so_from_mobile = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); DCHECK_OR_RETURN_VOID(so_from_mobile); if (!so_from_mobile) { @@ -91,9 +91,9 @@ void RPCHandlerImpl::ProcessMessageFromMobile( } void RPCHandlerImpl::ProcessMessageFromHMI( - const utils::SharedPtr<Message> message) { + const std::shared_ptr<Message> message) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject); + smart_objects::SmartObjectSPtr smart_object = std::make_shared<smart_objects::SmartObject>(); if (!smart_object) { LOG4CXX_ERROR(logger_, "Null pointer"); @@ -154,7 +154,7 @@ void RPCHandlerImpl::OnMessageReceived( return; } - utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message); + std::shared_ptr<Message> outgoing_message = ConvertRawMsgToMessage(message); if (outgoing_message) { LOG4CXX_DEBUG(logger_, "Posting new Message"); @@ -220,7 +220,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( LOG4CXX_WARN(logger_, "Failed to parse string to smart object :" << message.json_message()); - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( message.connection_key(), message.function_id(), @@ -245,7 +245,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( << " binary size should be " << message.data_size() << " payload data size is " << message.payload_size()); - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( message.connection_key(), message.function_id(), @@ -310,7 +310,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION; smart_objects::SmartObjectSPtr msg_to_send = - new smart_objects::SmartObject(output); + std::make_shared<smart_objects::SmartObject>(output); v1_shema.attachSchema(*msg_to_send, false); app_manager_.GetRPCService().SendMessageToMobile(msg_to_send); return false; @@ -329,11 +329,11 @@ bool RPCHandlerImpl::ConvertMessageToSO( return true; } -utils::SharedPtr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( +std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( const protocol_handler::RawMessagePtr message) { LOG4CXX_AUTO_TRACE(logger_); DCHECK(message); - utils::SharedPtr<Message> outgoing_message; + std::shared_ptr<Message> outgoing_message; LOG4CXX_DEBUG(logger_, "Service type." << message->service_type()); if (message->service_type() != protocol_handler::kRpc && @@ -347,7 +347,7 @@ utils::SharedPtr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( MobileMessageHandler::HandleIncomingMessageProtocol(message); if (convertion_result) { - outgoing_message = convertion_result; + outgoing_message = std::shared_ptr<Message>(convertion_result); } else { LOG4CXX_ERROR(logger_, "Received invalid message"); } diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index 11a98fc970..bdd6c8e0c2 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -327,8 +327,8 @@ void RPCServiceImpl::Handle(const impl::MessageToMobile message) { return; } - utils::SharedPtr<protocol_handler::RawMessage> rawMessage = - MobileMessageHandler::HandleOutgoingMessageProtocol(message); + std::shared_ptr<protocol_handler::RawMessage> rawMessage( + MobileMessageHandler::HandleOutgoingMessageProtocol(message)); if (!rawMessage) { LOG4CXX_ERROR(logger_, "Failed to create raw message."); @@ -404,7 +404,7 @@ void RPCServiceImpl::SendMessageToMobile( "Attached schema to message, result if valid: " << message->isValid()); // Messages to mobile are not yet prioritized so use default priority value - utils::SharedPtr<Message> message_to_send( + std::shared_ptr<Message> message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); if (!ConvertSOtoMessage((*message), (*message_to_send))) { LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string"); @@ -486,7 +486,7 @@ void RPCServiceImpl::SendMessageToHMI( } // SmartObject |message| has no way to declare priority for now - utils::SharedPtr<Message> message_to_send( + std::shared_ptr<Message> message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); if (!message_to_send) { LOG4CXX_ERROR(logger_, "Null pointer"); diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 1a1e5543df..f7a147d6df 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -35,7 +35,7 @@ #include "application_manager/usage_statistics.h" #include "application_manager/rpc_service.h" #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "connection_handler/connection_handler.h" namespace application_manager { @@ -472,7 +472,7 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel( return result; } - const bool is_active_app_exist = app_mngr_.active_application(); + const bool is_active_app_exist = (bool)app_mngr_.active_application(); if (is_audio_app) { if (does_audio_app_with_same_type_exist) { result = app_mngr_.GetDefaultHmiLevel(app); @@ -853,7 +853,7 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) { DCHECK_OR_RETURN_VOID(app); const HmiStatePtr regular = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(regular); - HmiStatePtr new_regular = utils::MakeShared<HmiState>(*regular); + HmiStatePtr new_regular = std::make_shared<HmiState>(*regular); LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'"); const bool is_audio_app = app->IsAudioApplication(); @@ -968,53 +968,53 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const { } HmiStatePtr StateControllerImpl::CreateHmiState( - utils::SharedPtr<Application> app, HmiState::StateID state_id) const { + std::shared_ptr<Application> app, HmiState::StateID state_id) const { using namespace utils; LOG4CXX_AUTO_TRACE(logger_); HmiStatePtr new_state; switch (state_id) { case HmiState::STATE_ID_PHONE_CALL: { - new_state = MakeShared<PhoneCallHmiState>(app, app_mngr_); + new_state = std::make_shared<PhoneCallHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_SAFETY_MODE: { - new_state = MakeShared<SafetyModeHmiState>(app, app_mngr_); + new_state = std::make_shared<SafetyModeHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_VR_SESSION: { - new_state = MakeShared<VRHmiState>(app, app_mngr_); + new_state = std::make_shared<VRHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_TTS_SESSION: { - new_state = MakeShared<TTSHmiState>(app, app_mngr_); + new_state = std::make_shared<TTSHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_VIDEO_STREAMING: { - new_state = MakeShared<VideoStreamingHmiState>(app, app_mngr_); + new_state = std::make_shared<VideoStreamingHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_NAVI_STREAMING: { - new_state = MakeShared<NaviStreamingHmiState>(app, app_mngr_); + new_state = std::make_shared<NaviStreamingHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_REGULAR: { - new_state = MakeShared<HmiState>(app, app_mngr_); + new_state = std::make_shared<HmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_POSTPONED: { - new_state = MakeShared<HmiState>(app, app_mngr_, state_id); + new_state = std::make_shared<HmiState>(app, app_mngr_, state_id); break; } case HmiState::STATE_ID_DEACTIVATE_HMI: { - new_state = MakeShared<DeactivateHMI>(app, app_mngr_); + new_state = std::make_shared<DeactivateHMI>(app, app_mngr_); break; } case HmiState::STATE_ID_AUDIO_SOURCE: { - new_state = MakeShared<AudioSource>(app, app_mngr_); + new_state = std::make_shared<AudioSource>(app, app_mngr_); break; } case HmiState::STATE_ID_EMBEDDED_NAVI: { - new_state = MakeShared<EmbeddedNavi>(app, app_mngr_); + new_state = std::make_shared<EmbeddedNavi>(app, app_mngr_); break; } default: diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc index 80755b6509..8081dee139 100644 --- a/src/components/application_manager/src/usage_statistics.cc +++ b/src/components/application_manager/src/usage_statistics.cc @@ -35,7 +35,7 @@ #include "smart_objects/enum_schema_item.h" #include "policy/usage_statistics/statistics_manager.h" #include "utils/macro.h" -#include "utils/make_shared.h" + using namespace mobile_apis; using namespace NsSmartDeviceLink::NsSmartObjects; @@ -56,7 +56,7 @@ std::string LanguageIdToString(Language::eType lang_id) { UsageStatistics::UsageStatistics( const std::string& app_id, - utils::SharedPtr<StatisticsManager> statistics_manager) + std::shared_ptr<StatisticsManager> statistics_manager) : time_in_hmi_state_sptr_( new usage_statistics::AppStopwatchImpl(statistics_manager, app_id)) , app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI) @@ -78,7 +78,7 @@ UsageStatistics::UsageStatistics( UsageStatistics::UsageStatistics( const std::string& app_id, - utils::SharedPtr<StatisticsManager> statistics_manager, + std::shared_ptr<StatisticsManager> statistics_manager, AppStopwatch* time_in_hmi_state_ptr) : time_in_hmi_state_sptr_(time_in_hmi_state_ptr) , app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI) |