[ACR][10/10/2013][Remove]Removing API versioning to support E_OUT_OF_RANGE exception...
[platform/framework/native/appfw.git] / inc / FBaseColICollectionT.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file                FBaseColICollectionT.h
19  * @brief               This is the header file for the %ICollectionT interface.
20  *
21  * This header file contains the declarations of the %ICollectionT interface.
22  *
23  */
24 #ifndef _FBASE_COL_BASE_ICOLLECTION_T_H_
25 #define _FBASE_COL_BASE_ICOLLECTION_T_H_
26
27 #include <FBaseTypes.h>
28 #include <FBaseColIEnumeratorT.h>
29 #include <FBaseRtMutex.h>
30
31
32 namespace Tizen { namespace Base { namespace Collection
33 {
34
35 /**
36  * @interface   ICollectionT
37  * @brief               This interface represents a template-based collection of objects.
38  *                              It defines the size, and enumerators.
39  *
40  * @since 2.0
41  *
42  * The %ICollectionT interface represents a template-based collection of objects.
43  * It defines the size, and enumerators.
44  */
45 template< class Type >
46 class ICollectionT
47 {
48 public:
49         /**
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.
52          *
53          * @since 2.0
54          */
55         virtual ~ICollectionT(void) {}
56
57         /**
58          * Gets the number of objects currently stored in the collection.
59          *
60          * @since 2.0
61          *
62          * @return              The number of objects currently stored in the collection
63          */
64         virtual int GetCount(void) const = 0;
65
66         /**
67          * Gets the enumerator of the %ICollectionT derived class,
68          * or returns @c null if an exception occurs.
69          *
70          * @since 2.0
71          *
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
80          */
81         virtual IEnumeratorT< Type >* GetEnumeratorN(void) const = 0;
82
83 }; // ICollectionT
84
85 }}} // Tizen::Base::Collection
86
87 #endif // _FBASE_COL_ICOLLECTION_T_H_