[2.2.1] Apply reviewed header file (Base to Collection)
[platform/framework/native/appfw.git] / inc / FBaseColIHashCodeProvider.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                FBaseColIHashCodeProvider.h
19  * @brief               This is the header file for the %IHashCodeProvider interface.
20  *
21  * This header file contains the declarations of the %IHashCodeProvider interface.
22  */
23 #ifndef _FBASE_COL_IHASH_CODE_PROVIDER_H_
24 #define _FBASE_COL_IHASH_CODE_PROVIDER_H_
25
26 namespace Tizen {namespace Base
27 {
28 class Object;
29 }}
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33
34 /**
35  * @interface   IHashCodeProvider
36  * @brief               This interface represents classes that provide the hash code of a specific type of object.
37  *
38  * @since 2.0
39  *
40  * The %IHashCodeProvider interface represents classes that provide the hash code of a specific type of object.
41  */
42 class _OSP_EXPORT_ IHashCodeProvider
43 {
44 public:
45         /**
46          * This polymorphic destructor should be overridden if required. @n
47          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
48          *
49          * @since 2.0
50          */
51         virtual ~IHashCodeProvider(void) {}
52
53         /**
54          * Gets the hash code of the specified object.
55          *
56          * @since 2.0
57          *
58          * @return              The hash code of the specified object
59          * @param[in]   obj             A pointer to the object whose hash code is required
60          * @remarks
61          *                              - The hash algorithm is usually of a specific type.
62          *                              - Two equal instances must return the same hash value. @n
63          *                              For better performance, the used hash function must generate a random distribution for all the inputs.
64          */
65         virtual int GetHashCode(const Tizen::Base::Object& obj) const = 0;
66
67 protected:
68         //
69         // This method is for internal use only. Using this method can cause behavioral, security-related,
70         // and consistency-related issues in the application.
71         // This method is reserved and may change its name at any time without prior notice.
72         //
73         // @since 2.0
74         //
75         virtual void IHashCodeProvider_Reserved1(void) { }
76
77         //
78         // This method is for internal use only. Using this method can cause behavioral, security-related,
79         // and consistency-related issues in the application.
80         // This method is reserved and may change its name at any time without prior notice.
81         //
82         // @since 2.0
83         //
84         virtual void IHashCodeProvider_Reserved2(void) { }
85
86 }; // IHashCodeProvider
87
88 }}} // Tizen::Base::Collection
89
90 #endif // _FBASE_COL_IHASH_CODE_PROVIDER_H_