Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Comparable Class Reference

An Object that can be compared, for sorting purposes, etc. More...

#include <mobject.h>

Inheritance diagram for Comparable:

Float Int String List of all members.

Public Methods

virtual int hashfunc (int hashsize) const
virtual int operator== (const Comparable &other) const=0
virtual int compare (const Comparable &other) const

Detailed Description

An Object that can be compared, for sorting purposes, etc.

It has also a hash function for hashing.

Definition at line 179 of file mobject.h.


Member Function Documentation

virtual int compare const Comparable &    other const [inline, virtual]
 

This should be overloaded to enable quicksorting of the inheritor.

Definition at line 199 of file mobject.h.

virtual int hashfunc int    hashsize const [inline, virtual]
 

Hash function.

Inheritors should overload this if they want to be used as a key in Map, etc.

Returns:
Hash value.
Parameters:
hashsize  Hash size.

Reimplemented in Int, and String.

Definition at line 191 of file mobject.h.

virtual int operator== const Comparable &    other const [pure virtual]
 

Equality comparison.

Must be overloaded.

Implemented in Int, Float, and String.


The documentation for this class was generated from the following file:
Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18