Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FBaseColMapEntry.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                FBaseColMapEntry.h
19  * @brief               This is the header file for the %MapEntry class.
20  *
21  * This header file contains the declarations of the %MapEntry class.
22  */
23 #ifndef _FCOL_MAP_ENTRY_H_
24 #define _FCOL_MAP_ENTRY_H_
25
26 #include <FBaseObject.h>
27
28 namespace Tizen { namespace Base { namespace Collection
29 {
30
31 /**
32  * @class MapEntry
33  * @brief       This class represents a key-value pair.
34  *
35  * @since 2.0
36  *
37  * The %MapEntry class represents a key-value pair.
38  *
39  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/mapentry.htm">MapEntry</a>.
40  */
41 class _OSP_EXPORT_ MapEntry
42         : public Object
43 {
44 public:
45         /**
46          * This is the default constructor for this class.
47          *
48          * @since 2.0
49          *
50          * @param[in]   key             The key
51          * @param[in]   value   The value
52          */
53         MapEntry(const Object& key, const Object& value);
54
55         /**
56          * This destructor overrides Tizen::Base::Object::~Object().
57          *
58          * @since 2.0
59          */
60         virtual ~MapEntry(void);
61
62         /**
63          * Gets the key corresponding to this entry.
64          *
65          * @since 2.0
66          *
67          * @return      The key corresponding to this entry
68          * @see                 GetValue()
69          */
70         virtual const Object* GetKey(void) const;
71
72         /**
73          * Gets the value corresponding to this entry.
74          *
75          * @since 2.0
76          *
77          * @return      The value corresponding to this entry
78          * @see                 GetKey()
79          */
80         virtual const Object* GetValue(void) const;
81
82         /**
83          * Gets the key corresponding to this entry.
84          *
85          * @since 2.0
86          *
87          * @return      The key corresponding to this entry
88          * @see                 GetValue()
89          */
90         virtual Object* GetKey(void);
91
92         /**
93          * Gets the value corresponding to this entry.
94          *
95          * @since 2.0
96          *
97          * @return      The value corresponding to this entry
98          * @see                 GetKey()
99          */
100         virtual Object* GetValue(void);
101
102         /**
103          * Compares the value of the given Tizen::Base::Object to the
104          * value of the calling object.
105          *
106          * @since 2.0
107          *
108          * @return              @c true if the values are equal, @n
109          *                              else @c false
110          * @param[in]   obj             The object to compare with the calling object
111          * @remarks     This method returns @c false if the given object is not a %MapEntry object.
112          */
113         virtual bool Equals(const Object& obj) const;
114
115         /**
116          * Gets the hash value of the current instance.
117          *
118          * @since 2.0
119          *
120          * @return      The hash value of the current instance
121          * @remarks     The two Tizen::Base::Object::Equals() instances must return the same hash value. @n
122          *                      For better performance, the used hash function must generate a random distribution for all the inputs.
123          */
124         virtual int GetHashCode(void) const;
125
126 protected:
127         /**
128          * This is the default constructor for this class.
129          *
130          * @since 2.0
131          */
132         MapEntry(void);
133         Object* _pKey;
134         Object* _pValue;
135
136 private:
137         /**
138          * This is the copy constructor for this class.
139          *
140          * @param[in]   entry The instance of the MapEntry class to copy from
141          */
142         MapEntry(const MapEntry& entry);
143
144         /**
145          * Assigns the value of the specified instance to the current instance of %MapEntry.
146          *
147          * @param[in]   entry An instance of %MapEntry
148          */
149         MapEntry& operator =(const MapEntry& entry);
150
151         friend class _MapEntryImpl;
152         class _MapEntryImpl* __pMapEntryImpl;
153
154 }; // MapEntry
155
156 }}} // Tizen::Collection
157
158 #endif // _FCOL_MAP_ENTRY_H_