X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fhelpers%2Fround-robin-container-view.h;h=5a5f07c5fd046507b2dc09f3352258bcd359a9f0;hb=21b574541aac2281c92020c0f62f7754897808b2;hp=c3619f9495b37be1e9ae770d45e933145c723367;hpb=f06a2008293be70a6ae7ff89d45b52f4d49d0fc0;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/helpers/round-robin-container-view.h b/dali-toolkit/internal/helpers/round-robin-container-view.h index c3619f9..5a5f07c 100644 --- a/dali-toolkit/internal/helpers/round-robin-container-view.h +++ b/dali-toolkit/internal/helpers/round-robin-container-view.h @@ -3,7 +3,7 @@ #define DALI_TOOLKIT_INTERNAL_ROUND_ROBIN_CONTAINER_VIEW_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -25,13 +25,10 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - /** * @brief RoundRobinContainerView is a view to a container that allows iterating through the elements cyclically. */ @@ -59,6 +56,14 @@ public: } /** + * @brief Clear all elements. + */ + void Clear() + { + mElements.clear(); + } + + /** * @brief Reset the position of the iterator returned by GetNext() to the first element. */ void Reset() @@ -89,12 +94,21 @@ public: return mElements.cend(); } + /** + * @brief Returns the element count. + * @return The element count + */ + size_t GetElementCount() const + { + return mElements.size(); + } + // default members ~RoundRobinContainerView() = default; - RoundRobinContainerView(const RoundRobinContainerView&) = delete; - RoundRobinContainerView& operator=(const RoundRobinContainerView&) = delete; - RoundRobinContainerView(RoundRobinContainerView&&) = default; + RoundRobinContainerView(const RoundRobinContainerView&) = delete; + RoundRobinContainerView& operator=(const RoundRobinContainerView&) = delete; + RoundRobinContainerView(RoundRobinContainerView&&) = default; RoundRobinContainerView& operator=(RoundRobinContainerView&&) = default; private: @@ -110,8 +124,8 @@ private: } private: - ContainerType mElements; //< container of elements - size_t mNextIndex; //< index to the next element to be viewed + ContainerType mElements; //< container of elements + size_t mNextIndex; //< index to the next element to be viewed }; } // namespace Internal @@ -120,5 +134,4 @@ private: } // namespace Dali - #endif // DALI_TOOLKIT_INTERNAL_ROUND_ROBIN_CONTAINER_VIEW_H