activemq-cpp-3.4.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

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 ( ) [inline, virtual]

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 [inline, virtual]
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 [inline, virtual]

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