summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 12:35:14 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 12:35:14 +0100
commitf8775b64f67cc464e024cf79cd98eed30c659d25 (patch)
treee38670c0a68d8fcc8e4e9d819c0a2fb2c27659d9 /include/base.h
parent147f9395449db7fcb32957ae840017cff2740831 (diff)
implemented magic __compare() method
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h
index 6541549..e99023b 100644
--- a/include/base.h
+++ b/include/base.h
@@ -218,6 +218,20 @@ public:
* @return bool
*/
virtual bool __toBool();
+
+ /**
+ * Compare the object with a different object of the same type
+ *
+ * This method should return 0 if both objects are equal, a negative value
+ * if the 'this' object is smaller, and a positive value if the 'this'
+ * object is bigger.
+ *
+ * The passed in object is an instance of base
+ *
+ * @param that Object to compare with
+ * @return int
+ */
+ virtual bool __compare(const Base &that) const;
private: