From: Adeel Kazmi Date: Thu, 28 Sep 2017 14:38:17 +0000 (+0100) Subject: Move WeakHandle to the Public API X-Git-Tag: dali_1.2.60~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24503c90b174b62a3d34e4d45366cb3b1d345105;p=platform%2Fcore%2Fuifw%2Fdali-core.git Move WeakHandle to the Public API Change-Id: Ie324f3da23047374b6a857b1d74ca5867caa2969 --- diff --git a/automated-tests/src/dali/utc-Dali-WeakHandle.cpp b/automated-tests/src/dali/utc-Dali-WeakHandle.cpp index 9fc86a5..186e5c3 100644 --- a/automated-tests/src/dali/utc-Dali-WeakHandle.cpp +++ b/automated-tests/src/dali/utc-Dali-WeakHandle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ */ #include -#include #include using namespace Dali; diff --git a/dali/devel-api/CMakeLists.txt b/dali/devel-api/CMakeLists.txt index 75151be..0bdfd9a 100644 --- a/dali/devel-api/CMakeLists.txt +++ b/dali/devel-api/CMakeLists.txt @@ -56,7 +56,6 @@ SET( DEVEL_API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/object/csharp-type-registry.h ${CMAKE_CURRENT_SOURCE_DIR}/object/handle-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/object/property-helper-devel.h - ${CMAKE_CURRENT_SOURCE_DIR}/object/weak-handle.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderer-devel.h diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 6fa8e0c..4a5d6eb 100644 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -13,7 +13,6 @@ devel_api_src_files = \ $(devel_api_src_dir)/images/nine-patch-image.cpp \ $(devel_api_src_dir)/images/pixel-data-devel.cpp \ $(devel_api_src_dir)/object/handle-devel.cpp \ - $(devel_api_src_dir)/object/weak-handle.cpp \ $(devel_api_src_dir)/object/csharp-type-registry.cpp \ $(devel_api_src_dir)/scripting/scripting.cpp \ $(devel_api_src_dir)/signals/signal-delegate.cpp \ @@ -61,8 +60,7 @@ devel_api_core_object_header_files = \ $(devel_api_src_dir)/object/csharp-type-info.h \ $(devel_api_src_dir)/object/csharp-type-registry.h \ $(devel_api_src_dir)/object/handle-devel.h \ - $(devel_api_src_dir)/object/property-helper-devel.h \ - $(devel_api_src_dir)/object/weak-handle.h + $(devel_api_src_dir)/object/property-helper-devel.h devel_api_core_rendering_header_files = \ $(devel_api_src_dir)/rendering/renderer-devel.h diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index eb3ec85..e16eed2 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/dali/public-api/CMakeLists.txt b/dali/public-api/CMakeLists.txt index c7f2e58..618e22c 100644 --- a/dali/public-api/CMakeLists.txt +++ b/dali/public-api/CMakeLists.txt @@ -191,6 +191,7 @@ SET(PUBLIC_API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/object/type-info.h ${CMAKE_CURRENT_SOURCE_DIR}/object/type-registry.h ${CMAKE_CURRENT_SOURCE_DIR}/object/type-registry-helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/object/weak-handle.h ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task.h ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task-list.h diff --git a/dali/public-api/dali-core.h b/dali/public-api/dali-core.h index f0a4516..3e602bf 100644 --- a/dali/public-api/dali-core.h +++ b/dali/public-api/dali-core.h @@ -107,6 +107,7 @@ #include #include #include +#include #include #include diff --git a/dali/public-api/file.list b/dali/public-api/file.list index e23504d..d594cd0 100644 --- a/dali/public-api/file.list +++ b/dali/public-api/file.list @@ -86,6 +86,7 @@ public_api_src_files = \ $(public_api_src_dir)/signals/functor-delegate.cpp \ $(public_api_src_dir)/object/type-info.cpp \ $(public_api_src_dir)/object/type-registry.cpp \ + $(public_api_src_dir)/object/weak-handle.cpp \ $(public_api_src_dir)/dali-core-version.cpp @@ -198,7 +199,8 @@ public_api_core_object_header_files = \ $(public_api_src_dir)/object/ref-object.h \ $(public_api_src_dir)/object/type-info.h \ $(public_api_src_dir)/object/type-registry.h \ - $(public_api_src_dir)/object/type-registry-helper.h + $(public_api_src_dir)/object/type-registry-helper.h \ + $(public_api_src_dir)/object/weak-handle.h public_api_core_render_tasks_header_files = \ $(public_api_src_dir)/render-tasks/render-task.h \ diff --git a/dali/devel-api/object/weak-handle.cpp b/dali/public-api/object/weak-handle.cpp similarity index 96% rename from dali/devel-api/object/weak-handle.cpp rename to dali/public-api/object/weak-handle.cpp index cfe628b..42905b0 100644 --- a/dali/devel-api/object/weak-handle.cpp +++ b/dali/public-api/object/weak-handle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // INTERNAL INCLUDES #include diff --git a/dali/devel-api/object/weak-handle.h b/dali/public-api/object/weak-handle.h similarity index 66% rename from dali/devel-api/object/weak-handle.h rename to dali/public-api/object/weak-handle.h index 982a036..47883a8 100644 --- a/dali/devel-api/object/weak-handle.h +++ b/dali/public-api/object/weak-handle.h @@ -1,8 +1,8 @@ -#ifndef __DALI_WEAK_HANDLE_H__ -#define __DALI_WEAK_HANDLE_H__ +#ifndef DALI_WEAK_HANDLE_H +#define DALI_WEAK_HANDLE_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,18 @@ namespace Dali { +/** + * @addtogroup dali_core_object + * @{ + */ /** - * @brief Base class to store a weak pointer to an internal Dali object. The handle to the object - * can be accessed if the object exists, and such access is not reference counted. When the object - * is deleted, the weak pointer will be set to NULL, and any further attmpt to access to a deleted - * object will return an empty handle. + * @brief Base class to store a weak pointer to an internal DALi object. * + * The handle to the object can be accessed if the object exists, and such access is not reference counted. + * When the object is deleted, the weak pointer will be set to NULL, and any further attempt to access to a + * deleted object will return an empty handle. + * @SINCE_1_2.60 */ class DALI_IMPORT_API WeakHandleBase { @@ -39,24 +44,28 @@ public: /** * @brief Default constructor which provides an uninitialized Dali::WeakHandleBase. + * @SINCE_1_2.60 */ WeakHandleBase(); /** - * @brief This constructor creates a weak handle of the Dali object. + * @brief This constructor creates a weak handle of the DALi object. * - * @param [in] handle A reference to the handle of the Dali object. + * @SINCE_1_2.60 + * @param [in] handle A reference to the handle of the DALi object */ WeakHandleBase( Handle& handle ); /** * @brief Destructor to free resources. + * @SINCE_1_2.60 */ ~WeakHandleBase(); /** * @brief Copy constructor. * + * @SINCE_1_2.60 * @param [in] handle A reference to the copied WeakHandleBase */ WeakHandleBase(const WeakHandleBase& handle); @@ -64,7 +73,8 @@ public: /** * @brief Assignment operator. * - * It makes this WeakHandleBase point to the same internal Dali object as the copied WeakHandleBase + * It makes this WeakHandleBase point to the same internal DALi object as the copied WeakHandleBase + * @SINCE_1_2.60 * @param [in] rhs A reference to the copied WeakHandleBase * @return A reference to this WeakHandleBase */ @@ -73,41 +83,49 @@ public: /** * @brief Equality operator overload. * - * @param [in] rhs A reference to the compared WeakHandleBase. - * @return true if the handle points to the same Dali resource, or if both are uninitialized. + * @SINCE_1_2.60 + * @param [in] rhs A reference to the compared WeakHandleBase + * @return true if the handle points to the same DALi resource, or if both are uninitialized */ bool operator==(const WeakHandleBase& rhs) const; /** * @brief Inequality operator overload. * - * @param [in] rhs A reference to the compared WeakHandleBase. - * @return true if the handle points to the different Dali resources. + * @SINCE_1_2.60 + * @param [in] rhs A reference to the compared WeakHandleBase + * @return true if the handle points to the different DALi resources */ bool operator!=(const WeakHandleBase& rhs) const; /** - * @brief Gets the handle to the Dali object. + * @brief Gets the handle to the DALi object. * - * @return The handle of the Dali object pointed by this WeakHandleBase or an empty handle if the Dali object doesn't exist. + * @SINCE_1_2.60 + * @return The handle of the DALi object pointed by this WeakHandleBase or an empty handle if the DALi object doesn't exist */ Handle GetBaseHandle() const; /** - * @brief Resets this weak handle to not point to any Dali object + * @brief Resets this weak handle to not point to any DALi object + * @SINCE_1_2.60 */ void Reset(); protected: + /// @cond internal struct Impl; Impl* mImpl; + /// @endcond }; /** - * @brief Weak handle for the given type of Dali object. + * @brief Weak handle for the given type of DALi object. + * @SINCE_1_2.60 + * @see WeakHandleBase */ template < class T > class WeakHandle : public WeakHandleBase @@ -185,6 +203,9 @@ public: } }; +/** + * @} + */ } // namespace Dali -#endif // __DALI_WEAK_HANDLE_H__ +#endif // DALI_WEAK_HANDLE_H