1 #ifndef REF_COUNTED_DALI_VECTOR_H
2 #define REF_COUNTED_DALI_VECTOR_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/object/ref-object.h>
29 * @brief A reference counting wrapper for a vector class that allows
30 * a set of referencing smart pointers to collaborate in managing its
31 * lifetime and eventually cleaning it up.
33 * This should only be allocated on the new/delete heap, not a thread's
35 * @tparam T type of the data that the vector holds
37 template< typename T >
38 class RefCountedVector : public RefObject
42 * @brief Construct empty vector.
49 * @brief Get the referenced vector.
51 * @return A reference to the vector that this object wraps.
53 Vector< T >& GetVector()
58 // Not copyable or movable
59 RefCountedVector( const RefCountedVector& ) = delete; ///< Deleted copy constructor
60 RefCountedVector( RefCountedVector&& ) = delete; ///< Deleted move constructor
61 RefCountedVector& operator=( const RefCountedVector& ) = delete; ///< Deleted copy assignment operator
62 RefCountedVector& operator=( RefCountedVector&& ) = delete; ///< Deleted move assignment operator
65 virtual ~RefCountedVector()
71 Vector< T > mVector; ///< The vector of data
76 #endif // REF_COUNTED_DALI_VECTOR_H