[2.2.1] Apply reviewed header file (Base to Collection)
[platform/framework/native/appfw.git] / inc / FBaseColIHashCodeProviderT.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                FBaseColIHashCodeProviderT.h
19  * @brief               This is the header file for the %IHashCodeProviderT interface.
20  *
21  * This header file contains the declarations of the %IHashCodeProviderT interface.
22  */
23 #ifndef _FBASE_COL_IHASH_CODE_PROVIDER_T_H_
24 #define _FBASE_COL_IHASH_CODE_PROVIDER_T_H_
25
26 namespace Tizen { namespace Base { namespace Collection
27 {
28
29 /**
30  * @interface   IHashCodeProviderT
31  * @brief       This interface represents classes that provide the hash code of a specific type of template-based object.
32  *
33  * @since 2.0
34  *
35  * The %IHashCodeProviderT interface represents classes that provide the hash code of a specific type of template-based object.
36  *
37  */
38 template< class Type >
39 class IHashCodeProviderT
40 {
41 public:
42         /**
43          * This polymorphic destructor should be overridden if required. @n
44          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
45          *
46          * @since 2.0
47          */
48         virtual ~IHashCodeProviderT(void) {}
49
50         /**
51          * Gets the hash code of the specified object.
52          *
53          * @since 2.0
54          *
55          * @return              The hash code of the specified object
56          * @param[in]   obj     A pointer to the object whose hash code is required
57          * @remarks
58          *                              - The hash algorithm is usually of a specific type.
59          *                              - Two equal instances must return the same hash value. @n
60          *                              For better performance, the used hash function must generate a random distribution for all the inputs.
61          */
62         virtual int GetHashCode(const Type& obj) const = 0;
63
64 }; // IHashCodeProviderT
65
66 }}} // Tizen::Base::Collection
67
68 #endif // _FBASE_COL_IHASH_CODE_PROVIDER_T_H_