Move system-server under server/system.
[platform/framework/native/appfw.git] / inc / FBaseDoubleComparer.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                FBaseDoubleComparer.h
19  * @brief               This is the header file for the %DoubleComparer class.
20  *
21  * @see                 Double and Tizen::Base::Collection::IComparer
22  *
23  * This header file contains the declarations of the %DoubleComparer class.
24  */
25 #ifndef _FBASE_DOUBLE_COMPARER_H_
26 #define _FBASE_DOUBLE_COMPARER_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseColIComparer.h>
30
31 namespace Tizen { namespace Base
32 {
33 /**
34  *      @class  DoubleComparer
35  *      @brief  This class checks for equivalence between 2 instances of the %Double type.
36  *
37  *      @since 2.0
38  *
39  *      The %DoubleComparer class checks for equivalence between 2 instances of the Double type.
40  *
41  *  For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/collection_comparison.htm">Collection Comparisons</a>.
42  *
43  *  The following example demonstrates how to use the %DoubleComparer class.
44  *
45  *      @code
46  *
47  *      #include <FBase.h>
48  *
49  *      using namespace Tizen::Base;
50  *
51  *      void
52  *      MyClass::DoubleComparerSample(void)
53  *      {
54  *              Double d1(123);
55  *              Double d2(124);
56  *              DoubleComparer comparer;
57  *
58  *              // Compare 2 instances of Double
59  *              int cmp;
60  *              comparer.Compare(d1, d2, cmp);
61  *              if (cmp < 0)
62  *              {
63  *                      // ...
64  *              }
65  *      }
66  *      @endcode
67  */
68 class _OSP_EXPORT_ DoubleComparer
69         : public Object
70         , public virtual Tizen::Base::Collection::IComparer
71 {
72 public:
73         /**
74          * This is the default constructor for this class.
75          *
76          * @since 2.0
77          */
78         DoubleComparer(void);
79
80         /**
81          * This destructor overrides Tizen::Base::Object::~Object().
82          *
83          * @since 2.0
84          */
85         virtual ~DoubleComparer(void);
86
87         /**
88          *      Compares two given instances of type Double.
89          *
90          *      @since 2.0
91          *
92          *      @return         An error code
93          *      @param[in]      obj1    The first instance of type Double
94          *      @param[in]      obj2    The second instance of type Double
95          *      @param[out] cmp         The result of comparison
96          *  @exception  E_SUCCESS               The method is successful.
97          *  @exception  E_INVALID_ARG   The specified object instances are not of the expected type.
98          *  @remarks    The value of @c cmp can be:
99          *
100          *      @code
101          *      <  0  if the value of @c obj1 is less than the value of @c obj2
102          *      == 0  if the value of @c obj1 is equal to the value of @c obj2
103          *      >  0  if the value of @c obj1 is greater than the value of @c obj2
104          *      @endcode
105          */
106         virtual result Compare(const Tizen::Base::Object& obj1, const Tizen::Base::Object& obj2, int& cmp) const;
107
108 private:
109         /**
110          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
111          */
112         DoubleComparer(const DoubleComparer& obj);
113
114         /**
115          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
116          */
117         DoubleComparer& operator =(const DoubleComparer& rhs);
118
119         friend class _DoubleComparerImpl;
120         class _DoubleComparerImpl* __pDoubleComparerImpl;
121
122 }; // DoubleComparer
123 }} // Tizen::Base
124 #endif // _FBASE_DOUBLE_COMPARER_H_