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 FBaseShortComparer.h
20 * @brief This is the header file for the %ShortComparer class.
23 * @see Tizen::Base::Collection::IComparer
25 * This header file contains the declarations of the %ShortComparer class.
27 #ifndef _FBASE_SHORT_COMPARER_H_
28 #define _FBASE_SHORT_COMPARER_H_
30 #include <FBaseTypes.h>
31 #include <FBaseObject.h>
32 #include <FBaseColIComparer.h>
35 namespace Tizen { namespace Base
38 * @class ShortComparer
39 * @brief This class compares 2 instances of the Short type for equivalence.
43 * The %ShortComparer class compares 2 instances of the Short type for equivalence.
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/collection_comparison.htm">Collection Comparisons</a>.
47 * The following example demonstrates how to use the %ShortComparer class.
53 * using namespace Tizen::Base;
56 * MyClass::ShortComparerSample(void)
60 * ShortComparer comparer;
63 * comparer.Compare(s1, s2, cmp);
71 class _OSP_EXPORT_ ShortComparer
73 , public virtual Tizen::Base::Collection::IComparer
77 * This is the default constructor for this class.
84 * This destructor overrides Tizen::Base::Object::~Object().
88 virtual ~ShortComparer(void);
91 * Compares two given instances of type Short.
95 * @return An error code
96 * @param[in] obj1 An object of Short to compare
97 * @param[in] obj2 An object of Short to compare
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:
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
109 virtual result Compare(const Tizen::Base::Object& obj1, const Tizen::Base::Object& obj2, int& cmp) const;
114 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
116 ShortComparer(const ShortComparer& obj);
119 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
121 ShortComparer& operator =(const ShortComparer& rhs);
123 friend class _ShortComparerImpl;
124 class _ShortComparerImpl * __pShortComparerImpl;
130 #endif // _FBASE_SHORT_COMPARER_H_