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 FBaseColIMapEnumerator.h
20 * @brief This is the header file for the %IMapEnumerator interface.
22 * This header file contains the declarations of the %IMapEnumerator interface.
24 #ifndef _FBASE_COL_IMAP_ENUMERATOR_H_
25 #define _FBASE_COL_IMAP_ENUMERATOR_H_
27 #include <FBaseColIEnumerator.h>
28 #include <FBaseObject.h>
31 namespace Tizen { namespace Base { namespace Collection
37 * @interface IMapEnumerator
38 * @brief This interface supports simple iteration over a map.
43 * An enumerator remains valid as long as the map remains unchanged.
44 * If changes are made to the map, such as adding, modifying, or
45 * deleting elements, the enumerator is irrecoverably invalidated. The next call to any method returns an E_INVALID_OPERATION message.
47 * The %IMapEnumerator interface supports simple iteration over a map.
48 * One can only access the elements in a collection through %IMapEnumerator. The elements cannot be modified through this interface.
50 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/hashmap_multihashmap.htm">HashMap and MultiHashMap</a>.
53 class _OSP_EXPORT_ IMapEnumerator
54 : public virtual IEnumerator
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.
63 virtual ~IMapEnumerator(void) {}
66 * Gets the current object from the collection.
70 * @return A pointer to the current object in the collection, @n
71 * else @c null if an exception occurs
72 * @exception E_SUCCESS The method is successful.
73 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
74 * - The current state of the instance prohibits the execution of the specified operation. @n
75 * - The enumerator is currently positioned before the first element or after the last element. @n
76 * - The collection is modified after the enumerator is created.
77 * @remarks The specific error code can be accessed using the GetLastResult() method.
78 * @see GetLastResult()
80 virtual Object* GetCurrent(void) const = 0;
83 * Gets the current key in the map.
87 * @return A pointer to the current key in the map, @n
88 * else @c null if an exception occurs
89 * @exception E_SUCCESS The method is successful.
90 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
91 * - The current state of the instance prohibits the execution of the specified operation. @n
92 * - The enumerator is currently positioned before the first element or after the last element. @n
93 * - The collection is modified after the enumerator is created.
94 * @remarks The specific error code can be accessed using the GetLastResult() method.
95 * @see GetLastResult()
97 virtual Object* GetKey(void) const = 0;
100 * Gets the current value in the map.
104 * @return A pointer to the current value in the map, @n
105 * else @c null if an exception occurs
106 * @exception E_SUCCESS The method is successful.
107 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
108 * - The current state of the instance prohibits the execution of the specified operation. @n
109 * - The enumerator is currently positioned before the first element or after the last element. @n
110 * - The collection is modified after the enumerator is created.
111 * @remarks The specific error code can be accessed using the GetLastResult() method.
112 * @see GetLastResult()
114 virtual Object* GetValue(void) const = 0;
118 }}} // Tizen::Base::Collection
120 #endif // _FBASE_COL_IMAP_ENUMERATOR_H_