2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseColICollectionT.h
19 * @brief This is the header file for the %ICollectionT interface.
21 * This header file contains the declarations of the %ICollectionT interface.
24 #ifndef _FBASE_COL_BASE_ICOLLECTION_T_H_
25 #define _FBASE_COL_BASE_ICOLLECTION_T_H_
27 #include <FBaseTypes.h>
28 #include <FBaseColIEnumeratorT.h>
29 #include <FBaseRtMutex.h>
32 namespace Tizen { namespace Base { namespace Collection
36 * @interface ICollectionT
37 * @brief This interface represents a template-based collection of objects.
38 * It defines the size, and enumerators.
42 * The %ICollectionT interface represents a template-based collection of objects.
43 * It defines the size, and enumerators.
45 template< class Type >
50 * This polymorphic destructor should be overridden if required. @n
51 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
55 virtual ~ICollectionT(void) {}
58 * Gets the number of objects currently stored in the collection.
62 * @return The number of objects currently stored in the collection
64 virtual int GetCount(void) const = 0;
67 * Gets the enumerator of the %ICollectionT derived class,
68 * or returns @c null if an exception occurs.
72 * @return A pointer to an enumerator interface of the %ICollectionT derived class, @n
73 * else @c null if an exception occurs
74 * @exception E_SUCCESS The method is successful.
75 * @exception E_OUT_OF_MEMORY The memory is insufficient.
76 * @remarks Use this method to obtain an enumerator (an instance of the IEnumeratorT derived class)
77 * to iterate over a collection (an instance of the %ICollectionT derived class).
78 * @remarks The specific error code can be accessed using the GetLastResult() method.
79 * @see Tizen::Base::Collection::IEnumerator
81 virtual IEnumeratorT< Type >* GetEnumeratorN(void) const = 0;
85 }}} // Tizen::Base::Collection
87 #endif // _FBASE_COL_ICOLLECTION_T_H_