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