summaryrefslogtreecommitdiff
path: root/include/classbase.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/classbase.h
parent147f9395449db7fcb32957ae840017cff2740831 (diff)
implemented magic __compare() method
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/classbase.h b/include/classbase.h
index da027ab..01f1d55 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -108,6 +108,14 @@ public:
virtual Base *clone(Base *orig) const = 0;
/**
+ * Compare two objects
+ * @param object1
+ * @param object2
+ * @return int
+ */
+ virtual int compare(Base *object1, Base *object2) const = 0;
+
+ /**
* Is this a traversable class?
* @return bool
*/
@@ -383,6 +391,14 @@ private:
static int cast(struct _zval_struct *object, struct _zval_struct *retval, int type);
/**
+ * Function to compare two objects
+ * @param object1
+ * @param object2
+ * @return int
+ */
+ static int compare(struct _zval_struct *object1, struct _zval_struct *object2);
+
+ /**
* Name of the class
* @var string
*/