Merge reviewed_inc
[platform/framework/native/appfw.git] / inc / FBaseColIMapEnumeratorT.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                FBaseColIMapEnumeratorT.h
20  * @brief               This is the header file for the %IMapEnumeratorT interface.
21  *
22  * This header file contains the declarations of the %IMapEnumeratorT interface.
23  */
24 #ifndef _FBASE_COL_IMAP_ENUMERATOR_T_H_
25 #define _FBASE_COL_IMAP_ENUMERATOR_T_H_
26
27 #include <FBaseColIEnumeratorT.h>
28 #include <FBaseColMapEntryT.h>
29
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33
34 /**
35  * @interface IMapEnumeratorT
36  * @brief       This interface supports simple iteration over a template-based map. @n
37  *                      Using this method, you can only access the elements in the map. You cannot modify the elements.
38  *
39  * @since 2.0
40  *
41  * @remarks
42  * An enumerator remains valid as long as the map remains unchanged.
43  * If changes are made to the map, such as adding, modifying, or
44  * deleting elements, the enumerator is irrecoverably invalidated. The next call to any method returns an @c E_INVALID_OPERATION message.
45  *
46  * The %IMapEnumeratorT interface supports simple iteration over a template-based map.
47  *                      Using this method, you can only access the elements in the map. You cannot modify the elements.
48  *
49  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/hashmap_multihashmap.htm">HashMap and MultiHashMap</a>.
50  *
51  */
52 template< class KeyType, class ValueType >
53 class IMapEnumeratorT
54         : public virtual IEnumeratorT< MapEntryT< KeyType, ValueType > >
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 ~IMapEnumeratorT(void) {}
64
65         /**
66          * Gets the current key in the map.
67          *
68          * @since 2.0
69          *
70          * @return              An error code
71          * @param[out]  key The current key
72          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation. @n
73          *                                                                      The enumerator is currently positioned before the first element or after the last element or the collection is modified after the enumerator is created.
74          * @exception   E_SUCCESS                       The method is successful.
75          */
76         virtual result GetKey(KeyType& key) const = 0;
77
78         /**
79          * Gets the current value in the map.
80          *
81          * @since 2.0
82          *
83          * @return              An error code
84          * @param[out]  value The current value
85          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation. @n
86          *                                                                      The enumerator is currently positioned before the first element or after the last element or the collection is modified after the enumerator is created.
87          * @exception   E_SUCCESS                       The method is successful.
88          */
89         virtual result GetValue(ValueType& value) const = 0;
90
91 }; // IMapEnumeratorT
92
93 }}} // Tizen::Base::Collection
94
95 #endif // _FBASE_COL_IMAP_ENUMERATOR_H_