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 FBaseColIMapEnumeratorT.h
19 * @brief This is the header file for the %IMapEnumeratorT interface.
21 * This header file contains the declarations of the %IMapEnumeratorT interface.
23 #ifndef _FBASE_COL_IMAP_ENUMERATOR_T_H_
24 #define _FBASE_COL_IMAP_ENUMERATOR_T_H_
26 #include <FBaseColIEnumeratorT.h>
27 #include <FBaseColMapEntryT.h>
29 namespace Tizen { namespace Base { namespace Collection
33 * @interface IMapEnumeratorT
34 * @brief This interface supports a simple iteration over a template-based map. @n
35 * Using this method, you can only access the elements in the map. You cannot modify the elements.
39 * @remarks An enumerator remains valid as long as the map remains unchanged. @n
40 * If changes are made to the map, such as adding, modifying, or
41 * deleting elements, the enumerator is irrecoverably invalidated. @n
42 * The next call to any method returns @c E_INVALID_OPERATION.
44 * The %IMapEnumeratorT interface supports a simple iteration over a template-based map.
45 * Using this method, you can only access the elements in the map. You cannot modify the elements.
47 * 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 template< class KeyType, class ValueType >
52 : public virtual IEnumeratorT< MapEntryT< KeyType, ValueType > >
56 * This polymorphic destructor should be overridden if required. @n
57 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
61 virtual ~IMapEnumeratorT(void) {}
64 * Gets the current key in the map.
68 * @return An error code
69 * @param[out] key The current key
70 * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
71 * - The current state of the instance prohibits the execution of the specified operation.
72 * - The enumerator is currently positioned before the first element or after the last element.
73 * - The collection is modified after the enumerator is created.
74 * @exception E_SUCCESS The method is successful.
76 virtual result GetKey(KeyType& key) const = 0;
79 * Gets the current value in the map.
83 * @return An error code
84 * @param[out] value The current value
85 * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
86 * - The current state of the instance prohibits the execution of the specified operation.
87 * - The enumerator is currently positioned before the first element or after the last element.
88 * - The collection is modified after the enumerator is created.
89 * @exception E_SUCCESS The method is successful.
91 virtual result GetValue(ValueType& value) const = 0;
95 }}} // Tizen::Base::Collection
97 #endif // _FBASE_COL_IMAP_ENUMERATOR_H_