summaryrefslogtreecommitdiff
path: root/src/base.cpp
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 /src/base.cpp
parent147f9395449db7fcb32957ae840017cff2740831 (diff)
implemented magic __compare() method
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp
index a9faac3..a77b30f 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -256,6 +256,28 @@ bool Base::__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
+ */
+bool Base::__compare(const Base &that) const
+{
+ // throw an exception that will be caught in the ClassBase class,
+ // so that the default implementation of the function can be called
+ throw NotImplemented();
+
+ // unreachable code
+ return 1;
+}
+
+/**
* End namespace
*/
}