activemq-cpp-3.6.0
decaf::lang::PointerComparator< T, R > Class Template Reference

This implementation of Comparator is designed to allows objects in a Collection to be sorted or tested for equality based on the value of the Object being Pointed to and not the value of the contained pointer in the Pointer instance. More...

#include <src/main/decaf/lang/Pointer.h>

Inheritance diagram for decaf::lang::PointerComparator< T, R >:

Public Member Functions

virtual ~PointerComparator ()
virtual bool operator() (const Pointer< T, R > &left, const Pointer< T, R > &right) const
virtual int compare (const Pointer< T, R > &left, const Pointer< T, R > &right) const
- Public Member Functions inherited from decaf::util::Comparator< Pointer< T, R > >
virtual ~Comparator ()
virtual bool operator() (const Pointer< T, R > &left, const Pointer< T, R > &right) const =0
 Implementation of the Binary function interface as a means of allowing a Comparator to be passed to an STL Map for use as the sorting criteria.
virtual int compare (const Pointer< T, R > &o1, const Pointer< T, R > &o2) const =0
 Compares its two arguments for order.

Detailed Description

template<typename T, typename R = decaf::util::concurrent::atomic::AtomicRefCounter>
class decaf::lang::PointerComparator< T, R >

This implementation of Comparator is designed to allows objects in a Collection to be sorted or tested for equality based on the value of the Object being Pointed to and not the value of the contained pointer in the Pointer instance.

This can be useful in the case where a series of values in a Collection is more efficiently accessed in the Objects Natural Order and not the underlying pointers location in memory.

Also this allows Pointer objects that Point to different instances of the same type to be compared based on the comparison of the object itself and not just the value of the pointer.

Constructor & Destructor Documentation

template<typename T , typename R = decaf::util::concurrent::atomic::AtomicRefCounter>
virtual decaf::lang::PointerComparator< T, R >::~PointerComparator ( )
inlinevirtual

Member Function Documentation

template<typename T , typename R = decaf::util::concurrent::atomic::AtomicRefCounter>
virtual int decaf::lang::PointerComparator< T, R >::compare ( const Pointer< T, R > &  left,
const Pointer< T, R > &  right 
) const
inlinevirtual
template<typename T , typename R = decaf::util::concurrent::atomic::AtomicRefCounter>
virtual bool decaf::lang::PointerComparator< T, R >::operator() ( const Pointer< T, R > &  left,
const Pointer< T, R > &  right 
) const
inlinevirtual

The documentation for this class was generated from the following file: