From: Jihoon Chung Date: Fri, 11 Oct 2013 04:42:55 +0000 (+0900) Subject: Remove DPL::AutoPtr X-Git-Tag: accepted/tizen/20131022.010752^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e69b6fc76570ffa035b2bc693e95312187c4c05a;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Remove DPL::AutoPtr [Issue#] LINUXWRT-1012 [Issue#] N/A [Problem] DPL::AutoPtr should replace to use standard library. [Cause] After C++11 is enabled, std::unique_ptr and std::shared_ptr is available. DPL::AutoPtr isn't necessary to exist in the DPL. [Solution] Remove DPL::AutoPtr [Verification] Build packages those have dependecy with wrt-commons. * cert-svc uses AutoPtr which is implemented in own package. [SCMRequest] N/A Change-Id: I100f4075e37ebf3c1b88f96f96cfc6d0901af666 --- diff --git a/modules/core/config.cmake b/modules/core/config.cmake index 774f8fe..8596c3c 100644 --- a/modules/core/config.cmake +++ b/modules/core/config.cmake @@ -84,7 +84,6 @@ SET(DPL_CORE_HEADERS ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/apply.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/assert.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/atomic.h - ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/auto_ptr.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/availability.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/binary_queue.h ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/bool_operator.h diff --git a/modules/core/include/dpl/auto_ptr.h b/modules/core/include/dpl/auto_ptr.h deleted file mode 100644 index 3d23091..0000000 --- a/modules/core/include/dpl/auto_ptr.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * @file auto_ptr.h - * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com) - * @author Tomasz Swierczek (t.swierczek@samsung.com) - * @version 1.0 - * @brief This file contais definictions of specific AutoPtr class. - */ -#ifndef _AUTO_PTR_H_ -#define _AUTO_PTR_H_ - -#include -#include -#include - -#include - -namespace DPL { -/* - * base deleter func - */ -template -struct UniversalFree {}; - -// Template Specialization -#define DECLARE_DELETER(type, function) \ - template <> \ - struct UniversalFree { \ - void universal_free(type * ptr){ \ - if (ptr) { \ - function(ptr); } \ - } \ - }; - -template -class AutoPtr -{ - public: - DPL_DEPRECATED_WITH_MESSAGE("use std::unique_ptr or std::shared_ptr") AutoPtr(T *ptr) : - m_data(ptr) - {} - - AutoPtr(const AutoPtr &second) - { - m_data = second.m_data; - second.m_data = 0; - } - - AutoPtr & operator=(const AutoPtr &second) - { - if (this != &second) { - UniversalFree deleter; - deleter.universal_free(m_data); - m_data = second.m_data; - second.m_data = 0; - } - return *this; - } - - /** - * overloaded -> operator, so smart ptr could act as ordinary ptr - */ - T* operator->() - { - return m_data; - } - - ~AutoPtr() - { - UniversalFree deleter; - deleter.universal_free(m_data); - } - - /** - * get internal pointer - */ - T* get(void) - { - return m_data; - } - - private: - mutable T *m_data; -}; -} // namespace DPL - -#endif // AUTO_PTR