sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FBaseColICollection.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FBaseColICollection.h
20  * @brief               This is the header file for the %ICollection interface.
21  *
22  * This header file contains the declarations of the %ICollection interface.
23  *
24  */
25 #ifndef _FBASE_COL_ICOLLECTION_H_
26 #define _FBASE_COL_ICOLLECTION_H_
27
28 #ifdef ICollection
29 #undef ICollection
30 #endif
31
32 #include <FBaseTypes.h>
33 #include <FBaseColIEnumerator.h>
34 #include <FBaseRtMutex.h>
35
36
37 #ifdef ICollection
38 #undef ICollection
39 #endif
40
41 namespace Tizen { namespace Base { namespace Collection
42 {
43
44 /**
45  * @interface ICollection
46  * @brief       This interface represents a collection of objects.
47  *                      It defines the size, enumerators, and the synchronization mechanism of a collection.
48  *
49  * @since 2.0
50  *
51  * The %ICollection interface represents a collection of objects. It defines the size, enumerators, and the synchronization mechanism of a collection.
52  *
53  */
54 class _OSP_EXPORT_ ICollection
55 {
56 public:
57         /**
58          * This polymorphic destructor should be overridden if required. @n
59          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
60          *
61          * @since 2.0
62          */
63         virtual ~ICollection(void) {}
64
65         /**
66          * Gets the number of objects currently stored in the collection.
67          *
68          * @since 2.0
69          *
70          * @return              An integer value indicating the number of objects currently stored in the collection
71          */
72         virtual int GetCount(void) const = 0;
73
74         /**
75          * Gets the enumerator of the %ICollection derived class,
76          * or returns @c null if some exception occurs.
77          *
78          * @since 2.0
79          *
80          * @return          A pointer to an enumerator interface of the %ICollection derived class, @n
81          *                              else @c null if an exception occurs
82          * @exception   E_SUCCESS                       The method is successful.
83          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
84          * @remarks             Use this method to obtain an enumerator (an instance of the IEnumerator derived class)
85          *                              to iterate over a collection (an instance of the %ICollection derived class).
86          * @remarks             The specific error code can be accessed using GetLastResult() method.
87          * @see                 Tizen::Base::Collection::IEnumerator
88          *
89          */
90         virtual IEnumerator* GetEnumeratorN(void) const = 0;
91
92 protected:
93         //
94         // This method is for internal use only. Using this method can cause behavioral, security-related,
95         // and consistency-related issues in the application.
96         // This method is reserved and may change its name at any time without prior notice.
97         //
98         // @since 2.0
99         //
100         virtual void ICollection_Reserved1(void) { }
101
102         //
103         // This method is for internal use only. Using this method can cause behavioral, security-related,
104         // and consistency-related issues in the application.
105         // This method is reserved and may change its name at any time without prior notice.
106         //
107         // @since 2.0
108         //
109         virtual void ICollection_Reserved2(void) { }
110
111 }; // ICollection
112
113 }}} // Tizen::Base::Collection
114
115 #endif // _FBASE_COL_ICOLLECTION_H_