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