2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FBaseColIMapEnumerator.h
19 * @brief This is the header file for the %IMapEnumerator interface.
21 * This header file contains the declarations of the %IMapEnumerator interface.
23 #ifndef _FBASE_COL_IMAP_ENUMERATOR_H_
24 #define _FBASE_COL_IMAP_ENUMERATOR_H_
26 #include <FBaseColIEnumerator.h>
27 #include <FBaseObject.h>
30 namespace Tizen { namespace Base { namespace Collection
36 * @interface IMapEnumerator
37 * @brief This interface supports simple iteration over a map.
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 E_INVALID_OPERATION message.
46 * The %IMapEnumerator interface supports simple iteration over a map.
47 * One can only access the elements in a collection through %IMapEnumerator. The elements cannot be modified through this interface.
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>.
52 class _OSP_EXPORT_ IMapEnumerator
53 : public virtual IEnumerator
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.
62 virtual ~IMapEnumerator(void) {}
65 * Gets the current object from the collection.
69 * @return A pointer to the current object in the collection, @n
70 * else @c null if an exception occurs
71 * @exception E_SUCCESS The method is successful.
72 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
73 * - The current state of the instance prohibits the execution of the specified operation. @n
74 * - The enumerator is currently positioned before the first element or after the last element. @n
75 * - The collection is modified after the enumerator is created.
76 * @remarks The specific error code can be accessed using the GetLastResult() method.
77 * @see GetLastResult()
79 virtual Object* GetCurrent(void) const = 0;
82 * Gets the current key in the map.
86 * @return A pointer to the current key in the map, @n
87 * else @c null if an exception occurs
88 * @exception E_SUCCESS The method is successful.
89 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
90 * - The current state of the instance prohibits the execution of the specified operation. @n
91 * - The enumerator is currently positioned before the first element or after the last element. @n
92 * - The collection is modified after the enumerator is created.
93 * @remarks The specific error code can be accessed using the GetLastResult() method.
94 * @see GetLastResult()
96 virtual Object* GetKey(void) const = 0;
99 * Gets the current value in the map.
103 * @return A pointer to the current value in the map, @n
104 * else @c null if an exception occurs
105 * @exception E_SUCCESS The method is successful.
106 * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n
107 * - The current state of the instance prohibits the execution of the specified operation. @n
108 * - The enumerator is currently positioned before the first element or after the last element. @n
109 * - The collection is modified after the enumerator is created.
110 * @remarks The specific error code can be accessed using the GetLastResult() method.
111 * @see GetLastResult()
113 virtual Object* GetValue(void) const = 0;
117 }}} // Tizen::Base::Collection
119 #endif // _FBASE_COL_IMAP_ENUMERATOR_H_