From 2f6b2e48580eb311821d84eae0c336db6339289d Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 28 Sep 2017 18:03:41 +0100 Subject: [PATCH] Moved Dali::Vector functions to support C++11 range-based loop to Public API Change-Id: Iebb3261eb8880d80e7a8a950f263510197ba7408 --- automated-tests/src/dali/utc-Dali-Vector.cpp | 1 - dali/devel-api/CMakeLists.txt | 1 - dali/devel-api/common/dali-vector-devel.h | 54 --------------------------- dali/devel-api/common/owner-container.h | 1 - dali/devel-api/file.list | 1 - dali/internal/event/events/key-event-impl.cpp | 1 - dali/public-api/common/dali-vector.h | 22 ++++++++++- 7 files changed, 21 insertions(+), 60 deletions(-) delete mode 100644 dali/devel-api/common/dali-vector-devel.h diff --git a/automated-tests/src/dali/utc-Dali-Vector.cpp b/automated-tests/src/dali/utc-Dali-Vector.cpp index 28fe6b6..c7fbe71 100644 --- a/automated-tests/src/dali/utc-Dali-Vector.cpp +++ b/automated-tests/src/dali/utc-Dali-Vector.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include using namespace Dali; diff --git a/dali/devel-api/CMakeLists.txt b/dali/devel-api/CMakeLists.txt index bcded75..7345f37 100644 --- a/dali/devel-api/CMakeLists.txt +++ b/dali/devel-api/CMakeLists.txt @@ -32,7 +32,6 @@ SET( DEVEL_API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/common/circular-queue.h - ${CMAKE_CURRENT_SOURCE_DIR}/common/dali-vector-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.h ${CMAKE_CURRENT_SOURCE_DIR}/common/map-wrapper.h ${CMAKE_CURRENT_SOURCE_DIR}/common/owner-container.h diff --git a/dali/devel-api/common/dali-vector-devel.h b/dali/devel-api/common/dali-vector-devel.h deleted file mode 100644 index 08e3abf..0000000 --- a/dali/devel-api/common/dali-vector-devel.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef DALI_VECTOR_DEVEL_H -#define DALI_VECTOR_DEVEL_H - -/* - * 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. - * 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. - * - */ - -// EXTERNAL INCLUDES - -// INTERNAL INCLUDES -#include - -namespace Dali -{ -/** - * Dali::Vector support for C++11 Range-based for loop: for( item : container ) - * - * @param vector The vector to iterate - * @return The start iterator - */ -template< class T > -typename T::Iterator begin( T& vector ) -{ - return vector.Begin(); -} - -/** - * Dali::Vector support for C++11 Range-based for loop: for( item : container ) - * - * @param vector The vector to iterate - * @return The end iterator - */ -template< class T > -typename T::Iterator end( T& vector ) -{ - return vector.End(); -} - -} // namespace Dali - -#endif /* DALI_VECTOR_DEVEL_H */ diff --git a/dali/devel-api/common/owner-container.h b/dali/devel-api/common/owner-container.h index b5ac951..f35b278 100644 --- a/dali/devel-api/common/owner-container.h +++ b/dali/devel-api/common/owner-container.h @@ -21,7 +21,6 @@ // INTERNAL INCLUDES #include #include -#include namespace Dali { diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 85ddc1e..d0c6797 100644 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -34,7 +34,6 @@ devel_api_core_animation_header_files = \ devel_api_core_common_header_files = \ $(devel_api_src_dir)/common/circular-queue.h \ - $(devel_api_src_dir)/common/dali-vector-devel.h \ $(devel_api_src_dir)/common/hash.h \ $(devel_api_src_dir)/common/map-wrapper.h \ $(devel_api_src_dir)/common/owner-container.h \ diff --git a/dali/internal/event/events/key-event-impl.cpp b/dali/internal/event/events/key-event-impl.cpp index d686b83..68e9ad8 100644 --- a/dali/internal/event/events/key-event-impl.cpp +++ b/dali/internal/event/events/key-event-impl.cpp @@ -20,7 +20,6 @@ // INTERNAL INCLUDES #include -#include namespace Dali { diff --git a/dali/public-api/common/dali-vector.h b/dali/public-api/common/dali-vector.h index 916fed7..8d16df1 100644 --- a/dali/public-api/common/dali-vector.h +++ b/dali/public-api/common/dali-vector.h @@ -2,7 +2,7 @@ #define __DALI_VECTOR_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. @@ -489,6 +489,26 @@ public: // API } /** + * Support for C++11 Range-based for loop: for( item : container ). + * @SINCE_1_2.60 + * @return The start iterator + */ + Iterator begin() const + { + return Begin(); + } + + /** + * Support for C++11 Range-based for loop: for( item : container ). + * @SINCE_1_2.60 + * @return The end iterator + */ + Iterator end() const + { + return End(); + } + + /** * @brief Subscript operator. * @SINCE_1_0.0 * @param[in] index Index of the element -- 2.7.4