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