[2.2.1] Apply reviewed header file (Base to Collection)
[platform/framework/native/appfw.git] / inc / FBaseColIComparerT.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                FBaseColIComparerT.h
19  * @brief               This is the header file for the %IComparerT interface.
20  *
21  * This header file contains the declarations of the %IComparerT interface.
22  */
23 #ifndef _FBASE_COL_ICOMPARER_T_H_
24 #define _FBASE_COL_ICOMPARER_T_H_
25
26 #include <FBaseTypes.h>
27
28 namespace Tizen { namespace Base { namespace Collection
29 {
30 /**
31  * @interface IComparerT
32  * @brief This interface allows derived classes to compare two template-based objects of the same type.
33  *
34  * @since 2.0
35  *
36  * The %IComparerT interface allows derived classes to compare two template-based objects of the
37  * same type.
38  */
39 template< class Type >
40 class IComparerT
41 {
42 public:
43         /**
44          * This polymorphic destructor should be overridden if required. @n
45          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
46          *
47          * @since 2.0
48          */
49         virtual ~IComparerT(void) { }
50
51 public:
52         /**
53          * Compares two given instances of the same type.
54          *
55          * @since 2.0
56          *
57          * @return              An error code
58          * @param[in]   obj1    The first object to compare
59          * @param[in]   obj2    The second object to compare
60          * @param[out]  cmp             The result of the comparison
61          * @exception   E_SUCCESS               The method is successful.
62          * @exception   E_INVALID_ARG   The specified object instances are not of the expected type.
63          * @remarks             The value of @c cmp can be:
64          *
65          * @code
66          * <  0  if the value of obj1 is less than the value of obj2
67          * == 0  if the value of obj1 is equal to the value of obj2
68          * >  0  if the value of obj1 is greater than the value of obj2
69          * @endcode
70          */
71         virtual result Compare(const Type& obj1, const Type& obj2, int& cmp) const = 0;
72
73 }; //  IComparerT
74 }}} // Tizen::Base::Collection
75
76 #endif // _FBASE_COL_ICOMPARER_T_H_