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