#include <misc.hh>
Public Member Functions | |
| virtual | ~Comparable () |
| virtual int | compareTo (Comparable *other)=0 |
| Compare two objects c1 and c2. | |
Static Public Member Functions | |
| static int | compareFun (const void *p1, const void *p2) |
| This static method may be used as compare function for qsort(3), for an array of Object* (Object*[] or Object**). | |
Used for sorting etc.
| lout::misc::Comparable::~Comparable | ( | ) | [virtual] |
| int lout::misc::Comparable::compareFun | ( | const void * | p1, | |
| const void * | p2 | |||
| ) | [static] |
This static method may be used as compare function for qsort(3), for an array of Object* (Object*[] or Object**).
Referenced by lout::container::untyped::Vector::sort().
| virtual int lout::misc::Comparable::compareTo | ( | Comparable * | other | ) | [pure virtual] |
Compare two objects c1 and c2.
return a value < 0, when c1 is less than c2, a value > 0, when c1 is greater than c2, or 0, when c1 and c2 are equal.
If also object::Object is implemented, and if c1.equals(c2), c1.compareTo(c2) must be 0, but, unlike you may expect, the reversed is not necessarily true. This method returns 0, if, according to the rules for sorting, there is no difference, but there may still be differences (not relevant for sorting), which "equals" will care about.
Implemented in dw::core::EmptyIterator, dw::core::TextIterator, dw::core::DeepIterator, dw::core::CharIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::compareTo(), and dw::core::Iterator::equals().
1.5.9