summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2018-07-13 13:20:39 -0700
committerGitHub <noreply@github.com>2018-07-13 13:20:39 -0700
commit45109a01ccfd5176c4eba28bcbcfb5bf9148b46c (patch)
tree5d47192e4c9b8892b1ce7d8f353be15f8faab962
parent8a183605c87bcd4984742170839def8237bf55bf (diff)
parent7911d4a89a46651168ff69b5eb1c859464d40685 (diff)
downloadsdl_core-45109a01ccfd5176c4eba28bcbcfb5bf9148b46c.tar.gz
Merge pull request #2277 from smartdevicelink/feature/remove_auto_ptr
replace auto_ptr with unique_ptr
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h34
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h2
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc2
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc112
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc2
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc2
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc4
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc6
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc2
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc6
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc2
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc6
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc4
-rw-r--r--src/components/utils/include/utils/timer.h2
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/intergen/cppgen/src/cppgen/handler_interface.cc4
18 files changed, 112 insertions, 93 deletions
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
index 92d6bbd9ef..ccbf4c7c01 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -153,7 +153,7 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
/**
* @brief returns pointer to data base
*/
- std::auto_ptr<utils::dbms::SQLDatabase> db_;
+ std::unique_ptr<utils::dbms::SQLDatabase> db_;
/**
* @brief indicate initializing status of DB
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..2a6cdb0745 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -10,9 +10,39 @@
namespace app_launch {
class AppLaunchCtrlImpl;
-class DeviceAppsLauncherImpl;
+class DeviceAppsLauncher;
class AppsLauncher;
class AppLaunchSettings;
+class Launcher;
+class LauncherGenerator;
+
+// impl class must be defined for unique_ptr in DeviceAppsLauncher
+class DeviceAppsLauncherImpl {
+ public:
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher);
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch);
+
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const utils::SharedPtr<Launcher>& launcher) const;
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ std::vector<utils::SharedPtr<Launcher> > free_launchers_;
+ std::vector<utils::SharedPtr<Launcher> > works_launchers_;
+ DeviceAppsLauncher& interface_;
+};
+
/**
* @brief The MultipleAppsLauncher struct
* should manage launching applications and gaps between launching application
@@ -36,7 +66,7 @@ class DeviceAppsLauncher {
private:
application_manager::ApplicationManager& app_mngr_;
const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ std::unique_ptr<DeviceAppsLauncherImpl> impl_;
friend class DeviceAppsLauncherImpl;
DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
};
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index bc579d0137..399b710286 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -1485,7 +1485,7 @@ class ApplicationManagerImpl
hmi_message_handler::HMIMessageHandler* hmi_handler_;
connection_handler::ConnectionHandler* connection_handler_;
- std::auto_ptr<policy::PolicyHandlerInterface> policy_handler_;
+ std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
@@ -1514,7 +1514,7 @@ class ApplicationManagerImpl
static uint32_t corelation_id_;
static const uint32_t max_corelation_id_;
- std::auto_ptr<HMICapabilities> hmi_capabilities_;
+ std::unique_ptr<HMICapabilities> hmi_capabilities_;
// The reason of HU shutdown
mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
@@ -1523,7 +1523,7 @@ class ApplicationManagerImpl
* about persistent application data on disk, and save session ID for resuming
* application in case INGITION_OFF or MASTER_RESSET
*/
- std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+ std::unique_ptr<resumption::ResumeCtrl> resume_ctrl_;
HmiInterfacesImpl hmi_interfaces_;
@@ -1538,8 +1538,8 @@ class ApplicationManagerImpl
sync_primitives::Lock timer_pool_lock_;
mutable sync_primitives::Lock stopping_application_mng_lock_;
StateControllerImpl state_ctrl_;
- std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
- std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchData> app_launch_dto_;
+ std::unique_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
/**
* @brief ReregisterWaitList is list of applications expected to be
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index 886389b05c..aa07e41cad 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -66,7 +66,7 @@ class UsageStatistics {
void RecordTLSError();
private:
- std::auto_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
+ std::unique_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
usage_statistics::AppInfo app_registration_language_gui_;
usage_statistics::AppInfo app_registration_language_vui_;
usage_statistics::AppCounter count_of_rejected_rpc_calls_;
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 f3adfc749b..64f9102d90 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
@@ -384,7 +384,7 @@ bool AppLaunchDataDB::WriteDb() {
utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
#ifdef __QNX__
- std::auto_ptr<utils::dbms::SQLDatabase> db_qnx(
+ std::unique_ptr<utils::dbms::SQLDatabase> db_qnx(
new utils::dbms::SQLDatabase(kDatabaseName));
db_qnx.get()->Open();
return db_qnx.get();
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 0eb9245cf8..9c67c70e2c 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
@@ -61,7 +61,7 @@ class Launcher {
} else {
LOG4CXX_DEBUG(logger_,
"All Apps on " << apps_on_device_->first
- << " posponed launched");
+ << " postponed launched");
device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
}
}
@@ -116,71 +116,59 @@ struct LauncherGenerator {
AppsLauncher& apps_launcher_;
};
-class DeviceAppsLauncherImpl {
- public:
- DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
- AppsLauncher& apps_launcher)
- : interface_(interface) {
- sync_primitives::AutoLock lock(launchers_lock_);
- LauncherGenerator generate(
- interface.app_mngr_.resume_controller(), interface, apps_launcher);
- free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
- std::generate_n(std::back_inserter(free_launchers_),
- interface.settings_.max_number_of_ios_device(),
- generate);
- }
-
- bool LaunchAppsOnDevice(
- const std::string& device_mac,
- const std::vector<ApplicationDataPtr>& applications_to_launch) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "On Device " << device_mac << " will be launched "
- << applications_to_launch.size() << " apps");
- AppsOnDevicePtr apps_on_device =
- utils::MakeShared<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();
- LauncherPtr launcher = *it;
- works_launchers_.push_back(launcher);
- free_launchers_.erase(it);
- launcher->Start(apps_on_device);
- return true;
- }
+// DeviceAppsLauncherImpl member function definitions
+DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : interface_(interface) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ LauncherGenerator generate(
+ interface.app_mngr_.resume_controller(), interface, apps_launcher);
+ free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
+ std::generate_n(std::back_inserter(free_launchers_),
+ interface.settings_.max_number_of_ios_device(),
+ generate);
+}
- struct LauncherFinder {
- LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+bool DeviceAppsLauncherImpl::LauncherFinder::operator()(
+ const utils::SharedPtr<Launcher>& launcher) const {
+ return device_mac_ == launcher->apps_on_device_->first;
+}
- bool operator()(const LauncherPtr& launcher) const {
- return device_mac_ == launcher->apps_on_device_->first;
- }
+bool DeviceAppsLauncherImpl::LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "On Device " << device_mac << " will be launched "
+ << applications_to_launch.size() << " apps");
+ AppsOnDevicePtr apps_on_device =
+ utils::MakeShared<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();
+ LauncherPtr launcher = *it;
+ works_launchers_.push_back(launcher);
+ free_launchers_.erase(it);
+ launcher->Start(apps_on_device);
+ return true;
+}
- std::string device_mac_;
- };
-
- bool StopLaunchingAppsOnDevice(const std::string& device_mac) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(launchers_lock_);
- const Launchers::iterator it = std::find_if(works_launchers_.begin(),
- works_launchers_.end(),
- LauncherFinder(device_mac));
- if (it == works_launchers_.end()) {
- return false;
- }
- LauncherPtr launcher = *it;
- launcher->Clear();
- free_launchers_.push_back(launcher);
- works_launchers_.erase(it);
- return true;
+bool DeviceAppsLauncherImpl::StopLaunchingAppsOnDevice(
+ const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const Launchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ LauncherFinder(device_mac));
+ if (it == works_launchers_.end()) {
+ return false;
}
-
- private:
- sync_primitives::Lock launchers_lock_;
- Launchers free_launchers_;
- Launchers works_launchers_;
- DeviceAppsLauncher& interface_;
-};
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ return true;
+}
bool DeviceAppsLauncher::LaunchAppsOnDevice(
const std::string& device_mac,
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 8e64bc952b..1ee368a212 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -179,7 +179,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
return NULL;
}
- std::auto_ptr<application_manager::Message> outgoing_message(
+ std::unique_ptr<application_manager::Message> outgoing_message(
new application_manager::Message(
protocol_handler::MessagePriority::FromServiceType(
message->service_type())));
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 1b90f29647..2fda4a7031 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -164,7 +164,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
NiceMock<ch_test::MockConnectionHandler> connection_handler_mock_;
NiceMock<resumprion_test::MockResumeCtrl> resume_ctrl_mock_;
NiceMock<app_launch_test::MockAppLaunchSettings> settings_;
- std::auto_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
};
app_launch::ApplicationData AppDataFromApp(
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
index e095f0682e..bfae920dbf 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -113,7 +113,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
return test_db_;
}
- static std::auto_ptr<AppLaunchDataDB> res_db_;
+ static std::unique_ptr<AppLaunchDataDB> res_db_;
AppLaunchDataDB* res_db() {
return res_db_.get();
@@ -145,7 +145,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
};
utils::dbms::SQLDatabase* AppLaunchDataDBTest::test_db_ = NULL;
-std::auto_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
+std::unique_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
void AppLaunchDataDBTest::AddApplicationDataWithIncreaseTable(
const ApplicationData& data) {
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index cc7d3f5814..04006954b5 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -67,7 +67,7 @@ class AppLaunchDataJsonTest : public ::testing::Test {
private:
virtual void SetUp() {
::file_system::DeleteFile(kAppStorageFile);
- test_last_state_ = std::auto_ptr<resumption::LastState>(
+ test_last_state_ = std::unique_ptr<resumption::LastState>(
new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
@@ -102,8 +102,8 @@ class AppLaunchDataJsonTest : public ::testing::Test {
void GetApplicationData_EXPECT_FALSE(const ApplicationData& in_data);
std::string AddCounter(const std::string& inp, int32_t val);
- std::auto_ptr<resumption::LastState> test_last_state_;
- std::auto_ptr<AppLaunchDataJson> res_json_;
+ std::unique_ptr<resumption::LastState> test_last_state_;
+ std::unique_ptr<AppLaunchDataJson> res_json_;
void SetTimestamp(const ApplicationData& in_data, TimevalStruct& timestamp);
};
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index 41d1ddc128..d2bba895c8 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -204,7 +204,7 @@ class ApplicationManagerImplTest : public ::testing::Test {
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_app_mngr_;
- std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
application_manager::MockMessageHelper* mock_message_helper_;
utils::SharedPtr<MockApplication> mock_app_ptr_;
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index 6efef83052..b07ce310e9 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -78,14 +78,14 @@ class UsageStatisticsTest : public testing::Test {
protected:
utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_;
- std::auto_ptr<application_manager::UsageStatistics>
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object1_sptr_;
const std::string language_;
};
TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
// Arrange
- std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(
+ std::unique_ptr<MockAppStopwatch> mock_app_stopwatch_object(
new MockAppStopwatch);
// Checks
@@ -93,7 +93,7 @@ TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
EXPECT_CALL(*mock_app_stopwatch_object, Switch(kTestAppStopwatchId));
// Act
- std::auto_ptr<application_manager::UsageStatistics>
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object2_sptr_(
new application_manager::UsageStatistics(
kAppId,
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 729f216fc3..270b38d724 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -1591,7 +1591,7 @@ void ConnectionHandlerImpl::OnConnectionEnded(
connection_list_lock_.Release();
return;
}
- std::auto_ptr<Connection> connection(itr->second);
+ std::unique_ptr<Connection> connection(itr->second);
connection_list_.erase(itr);
connection_list_lock_.Release();
diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
index 0b0831eaad..a5589cc904 100644
--- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
@@ -81,14 +81,14 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static utils::dbms::SQLQuery* query_wrapper_;
// Gtest can show message that this object doesn't destroyed
- static std::auto_ptr<policy_handler_test::MockPolicySettings>
+ static std::unique_ptr<policy_handler_test::MockPolicySettings>
policy_settings_;
static void SetUpTestCase() {
const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest";
reps = new SQLPTRepresentation(in_memory_);
ASSERT_TRUE(reps != NULL);
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
+ policy_settings_ = std::unique_ptr<policy_handler_test::MockPolicySettings>(
new policy_handler_test::MockPolicySettings());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -348,7 +348,7 @@ SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
utils::dbms::SQLQuery* SQLPTRepresentationTest::query_wrapper_ = 0;
const std::string SQLPTRepresentationTest::kDatabaseName = ":memory:";
const bool SQLPTRepresentationTest::in_memory_ = true;
-std::auto_ptr<policy_handler_test::MockPolicySettings>
+std::unique_ptr<policy_handler_test::MockPolicySettings>
SQLPTRepresentationTest::policy_settings_;
class SQLPTRepresentationTest2 : public ::testing::Test {
diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
index a5f3741331..40dae10a4f 100644
--- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -78,12 +78,12 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static const std::string kAppStorageFolder;
// Gtest can show message that this object doesn't destroyed
- std::auto_ptr<NiceMock<MockPolicySettings> > policy_settings_;
+ std::unique_ptr<NiceMock<MockPolicySettings> > policy_settings_;
void SetUp() OVERRIDE {
file_system::CreateDirectory(kAppStorageFolder);
reps = new SQLPTRepresentation;
- policy_settings_ = std::auto_ptr<NiceMock<MockPolicySettings> >(
+ policy_settings_ = std::unique_ptr<NiceMock<MockPolicySettings> >(
new NiceMock<MockPolicySettings>());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
diff --git a/src/components/utils/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index ab3d48ef6f..e391db992c 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -218,7 +218,7 @@ class Timer {
mutable sync_primitives::Lock state_lock_;
- mutable std::auto_ptr<TimerDelegate> delegate_;
+ mutable std::unique_ptr<TimerDelegate> delegate_;
threads::Thread* thread_;
/**
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index cf3e2c692c..58a2cf5873 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -5,7 +5,8 @@ include(ExternalProject)
set(intergen_SOURCES "${CMAKE_CURRENT_LIST_DIR}/intergen")
set(intergen_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/intergen")
set(intergen_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/intergen")
-set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR})
+set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR} -DCMAKE_CXX_FLAGS="-std=gnu++0x")
+
ExternalProject_Add(intergen
SOURCE_DIR ${intergen_SOURCES}
diff --git a/tools/intergen/cppgen/src/cppgen/handler_interface.cc b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
index 57b41523fd..a078b7af9a 100644
--- a/tools/intergen/cppgen/src/cppgen/handler_interface.cc
+++ b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
@@ -76,7 +76,7 @@ void HandlerInterface::CollectMethods() {
assert(!"Unexpected function message type");
}
}
- std::auto_ptr<CppClass::Method> destructor(
+ std::unique_ptr<CppClass::Method> destructor(
new CppClass::Method(this, CppClass::kPublic,
"~"+name(), "",
CppFunction::kVirtual));
@@ -93,7 +93,7 @@ void HandlerInterface::AddFunctionMessageHandlers(
message_ns.ForwardDeclare(Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kStruct,
func_msg->name()));
- std::auto_ptr<CppClass::Method> method(
+ std::unique_ptr<CppClass::Method> method(
new CppClass::Method(
this, CppClass::kPublic, "Handle" + func_msg->name(),
"void", CppFunction::kVirtual | CppFunction::kAbstract));