2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FBaseColIHashCodeProvider.h
19 * @brief This is the header file for the %IHashCodeProvider interface.
21 * This header file contains the declarations of the %IHashCodeProvider interface.
23 #ifndef _FBASE_COL_IHASH_CODE_PROVIDER_H_
24 #define _FBASE_COL_IHASH_CODE_PROVIDER_H_
26 namespace Tizen {namespace Base
31 namespace Tizen { namespace Base { namespace Collection
35 * @interface IHashCodeProvider
36 * @brief This interface represents classes that can provide the hash code of a specific type of object.
40 * The %IHashCodeProvider interface represents classes that can provide the hash code of a specific type of object.
42 class _OSP_EXPORT_ IHashCodeProvider
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.
51 virtual ~IHashCodeProvider(void) {}
54 * Gets the hash code of the specified object.
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 The hash algorithm is usually specific to a type.
61 * Two equal instances must return the same hash value.
62 * For better performance, the used hash function must generate a random distribution for all inputs.
64 virtual int GetHashCode(const Tizen::Base::Object& obj) const = 0;
68 // This method is for internal use only. Using this method can cause behavioral, security-related,
69 // and consistency-related issues in the application.
70 // This method is reserved and may change its name at any time without prior notice.
74 virtual void IHashCodeProvider_Reserved1(void) { }
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.
84 virtual void IHashCodeProvider_Reserved2(void) { }
86 }; // IHashCodeProvider
88 }}} // Tizen::Base::Collection
90 #endif // _FBASE_COL_IHASH_CODE_PROVIDER_H_