Remove DPL::AutoPtr
authorJihoon Chung <jihoon.chung@samsaung.com>
Fri, 11 Oct 2013 04:42:55 +0000 (13:42 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 14 Oct 2013 10:11:52 +0000 (10:11 +0000)
[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

modules/core/config.cmake
modules/core/include/dpl/auto_ptr.h [deleted file]

index 774f8fe..8596c3c 100644 (file)
@@ -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 (file)
index 3d23091..0000000
+++ /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 <list>
-#include <set>
-#include <string>
-
-#include <dpl/availability.h>
-
-namespace DPL {
-/*
- * base deleter func
- */
-template <typename T>
-struct UniversalFree {};
-
-// Template Specialization
-#define DECLARE_DELETER(type, function)           \
-    template <> \
-    struct UniversalFree <type> {           \
-        void universal_free(type * ptr){                  \
-            if (ptr) {                                      \
-                function(ptr); }                           \
-        }                                                \
-    };
-
-template <typename T>
-class AutoPtr
-{
-  public:
-    DPL_DEPRECATED_WITH_MESSAGE("use std::unique_ptr or std::shared_ptr") AutoPtr(T *ptr) :
-        m_data(ptr)
-    {}
-
-    AutoPtr(const AutoPtr<T> &second)
-    {
-        m_data = second.m_data;
-        second.m_data = 0;
-    }
-
-    AutoPtr & operator=(const AutoPtr &second)
-    {
-        if (this != &second) {
-            UniversalFree<T> 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<T> 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