Comparator::Comparable< KeyType, Policy > Class Template Reference

#include <Comparable.hpp>

List of all members.


Detailed Description

template<class KeyType, class Policy = DefaultComparator>
class Comparator::Comparable< KeyType, Policy >

This is a very simple class used to compare against a given (templated) key at runtime.

            // Let's use long as keys
            Comparable<long> a(0), b(1);
            if (a.Compare(b) == Comparable::Equal)
                // Values are equal
                printf("Equal!\n");
            else if (a.Compare(b) == Comparable::Less)
                // In this example, we should get here as a is less than b
                printf("Less!\n");
            else
                printf("Greater!\n");


Public Types

typedef CompareType Result

Public Member Functions

 Comparable (KeyType _key)
 No default constructor, must provide a key.
Result Compare (const KeyType &_key) const
 Compare this item against the given key.
KeyType Key () const
 Return the key in this comparator.


Member Typedef Documentation

template<class KeyType, class Policy = DefaultComparator>
typedef CompareType Comparator::Comparable< KeyType, Policy >::Result


Constructor & Destructor Documentation

template<class KeyType, class Policy = DefaultComparator>
Comparator::Comparable< KeyType, Policy >::Comparable ( KeyType  _key  )  [inline]

No default constructor, must provide a key.


Member Function Documentation

template<class KeyType, class Policy = DefaultComparator>
Result Comparator::Comparable< KeyType, Policy >::Compare ( const KeyType &  _key  )  const [inline]

Compare this item against the given key.

template<class KeyType, class Policy = DefaultComparator>
KeyType Comparator::Comparable< KeyType, Policy >::Key (  )  const [inline]

Return the key in this comparator.


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

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is