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