summaryrefslogtreecommitdiff
path: root/include/hashmember.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-07 15:21:51 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-07 15:21:51 +0100
commit8c6652ae30202ba50f989a3b4d6c7255e4351251 (patch)
treea1cedea97187cd66082c688ae40e5202945017a3 /include/hashmember.h
parent834c9d477a3f73ca42d13cb777d451b63f1cbf3a (diff)
update documentation, implemented comparison operator for hashmember class, added Value constructor that receives a Php::Type to initialize as a specific type, added Value constructors to initialize a Value directly from a map or a vector, fixed value comparison operators, added casting constructors to cast a value to a vector or a map
Diffstat (limited to 'include/hashmember.h')
-rw-r--r--include/hashmember.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/hashmember.h b/include/hashmember.h
index 9933445..65ca23d 100644
--- a/include/hashmember.h
+++ b/include/hashmember.h
@@ -317,6 +317,17 @@ public:
Value operator%(double value) { return this->value() % value; }
/**
+ * Comparison operators
+ * @param value
+ */
+ template <typename T> bool operator==(const T &value) const { return (T)*this == value; }
+ template <typename T> bool operator!=(const T &value) const { return (T)*this != value; }
+ template <typename T> bool operator<=(const T &value) const { return (T)*this <= value; }
+ template <typename T> bool operator>=(const T &value) const { return (T)*this >= value; }
+ template <typename T> bool operator< (const T &value) const { return (T)*this < value; }
+ template <typename T> bool operator> (const T &value) const { return (T)*this > value; }
+
+ /**
* Handle calls to the hash member
* @param param0
* @param param1