17 #ifndef _DECAF_UTIL_COMPARATORS_EQUALS_H_
18 #define _DECAF_UTIL_COMPARATORS_EQUALS_H_
26 namespace comparators {
33 template<
typename E >
40 virtual bool operator()(
const E& left,
const E& right)
const {
44 virtual int compare(
const E& o1,
const E& o2)
const {
59 template<
typename E >
68 return left->equals(*right);
69 }
else if (left ==
NULL && right ==
NULL) {
78 return o1->compareTo(*o2);
83 }
else if (o1.
get() < o2.
get()) {
virtual ~Equals()
Definition: Equals.h:38
virtual bool operator()(const decaf::lang::Pointer< E > &left, const decaf::lang::Pointer< E > &right) const
Implementation of the Binary function interface as a means of allowing a Comparator to be passed to a...
Definition: Equals.h:66
A comparison function, which imposes a total ordering on some collection of objects.
Definition: Comparator.h:40
#define NULL
Definition: Config.h:33
Equals()
Definition: Equals.h:37
virtual bool operator()(const E &left, const E &right) const
Implementation of the Binary function interface as a means of allowing a Comparator to be passed to a...
Definition: Equals.h:40
Equals()
Definition: Equals.h:63
virtual ~Equals()
Definition: Equals.h:64
PointerType get() const
Gets the real pointer that is contained within this Pointer.
Definition: Pointer.h:188
Equality comparator that utilizes the default equality comparison expression == to determine if two v...
Definition: Equals.h:34
virtual int compare(const decaf::lang::Pointer< E > &o1, const decaf::lang::Pointer< E > &o2) const
Compares its two arguments for order.
Definition: Equals.h:76
virtual int compare(const E &o1, const E &o2) const
Compares its two arguments for order.
Definition: Equals.h:44
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53