2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FBaseColIComparerT.h
20 * @brief This is the header file for the %IComparerT interface.
22 * This header file contains the declarations of the %IComparerT interface.
24 #ifndef _FBASE_COL_ICOMPARER_T_H_
25 #define _FBASE_COL_ICOMPARER_T_H_
27 #include <FBaseTypes.h>
30 namespace Tizen { namespace Base { namespace Collection
33 * @interface IComparerT
34 * @brief This interface allows derived classes to compare 2 template-based objects of the same type.
38 * The %IComparerT interface allows derived classes to compare 2 template-based objects of the
41 template< class Type >
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 ~IComparerT(void) { }
55 * Compares two given instances of the same type.
59 * @return An error code
60 * @param[in] obj1 The first object to compare
61 * @param[in] obj2 The second object to compare
62 * @param[out] cmp The result of comparison
63 * @exception E_SUCCESS The method is successful.
64 * @exception E_INVALID_ARG The specified object instances are not of the expected type.
65 * @remarks The value of @c cmp can be:
68 * < 0 if the value of @c obj1 is less than the value of @c obj2
69 * == 0 if the value of @c obj1 is equal to the value of @c obj2
70 * > 0 if the value of @c obj1 is greater than the value of @c obj2
73 virtual result Compare(const Type& obj1, const Type& obj2, int& cmp) const = 0;
76 }}} // Tizen::Base::Collection
78 #endif // _FBASE_COL_ICOMPARER_T_H_