6#include <system/object.h>
10namespace Collections {
25#ifdef ASPOSE_COMPARE_BY_REF
51 : m_comparator(comparator)
58 m_comparator = comparator;
66 template <
typename Q = T>
67 typename std::enable_if<detail::has_operator_less<Q>::value,
bool>::type
operator()(
const Q &x,
const Q &y)
const
70 return m_comparator ? m_comparator->Compare(x, y) < 0 : (x < y);
78 template <
typename Q = T>
79 typename std::enable_if<!detail::has_operator_less<Q>::value,
bool>::type
operator()(
const Q &x,
const Q &y)
const
81 return m_comparator ? m_comparator->Compare(x, y) < 0 :
false;
106 RTTI_INFO_TEMPLATE_CLASS(
ThisType, System::BaseTypesInfo<BaseType>);
138 RTTI_INFO_TEMPLATE_CLASS(
ThisType, System::BaseTypesInfo<BaseType>);
151 return s_default_comparer;
Provides a base class for implementations of the System.Collections.Generic.IComparer generic interfa...
Definition: icomparer.h:129
Comparer()
Definition: icomparer.h:141
static SharedPtr< IComparer< T > > get_Default()
Returns a default sort order comparer for the type specified by the generic argument.
Definition: icomparer.h:148
Default comparator class. Uses operator < and operator == to compare values. Objects of this class sh...
Definition: icomparer.h:97
virtual int Compare(typename ThisType::args_type x, typename ThisType::args_type y) const override
Actual data comparison.
Definition: icomparer.h:113
Interface that compares two objects in greater-equal-less sense. Objects of this class should only be...
Definition: icomparer.h:20
const T & args_type
Comparison argument type.
Definition: icomparer.h:27
virtual int Compare(args_type x, args_type y) const =0
Comparison function.
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9
Adapter to use IComparer within STL environment. Uses IComparer if set; otherwise,...
Definition: icomparer.h:44
ComparerAdapter()
Constructs adapter without any comparator available.
Definition: icomparer.h:46
ComparerAdapter(const SharedPtr< System::Collections::Generic::IComparer< T > > &comparator)
Constructs adapter.
Definition: icomparer.h:50
void set_Comparator(const SharedPtr< IComparer< T > > &comparator)
Sets comparator object.
Definition: icomparer.h:56
std::enable_if< detail::has_operator_less< Q >::value, bool >::type operator()(const Q &x, const Q &y) const
Comparison function for types with operator < available.
Definition: icomparer.h:67
std::enable_if<!detail::has_operator_less< Q >::value, bool >::type operator()(const Q &x, const Q &y) const
Comparison function for types with operator < not available.
Definition: icomparer.h:79