summaryrefslogtreecommitdiff
path: root/include/hashmember.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-15 18:31:42 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-15 18:31:42 +0100
commit3bcd6e21d1142b5ec35f99c4bdcd925bf7ae5083 (patch)
tree08903d9b7e7b2bd57fa1a01fc873d618a17b0a8f /include/hashmember.h
parent38b866988761f4da01eab769dc660b06b07e97be (diff)
added empty() function, and added HardCoded class
Diffstat (limited to 'include/hashmember.h')
-rw-r--r--include/hashmember.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/hashmember.h b/include/hashmember.h
index 41c40d3..d61e5c9 100644
--- a/include/hashmember.h
+++ b/include/hashmember.h
@@ -53,6 +53,16 @@ public:
}
/**
+ * Is this an existing hash member (true) or only one that is ready
+ * to be assigned a new value to, but that is not yet in the hashtable
+ * @return bool
+ */
+ bool exists() const
+ {
+ return _base->contains(_index);
+ }
+
+ /**
* Retrieve the original value
* @return Value
*/
@@ -179,6 +189,7 @@ public:
HashMember &operator+=(char value) { return operator=(this->value() + value); }
HashMember &operator+=(const std::string &value) { return operator=(this->value() + value); }
HashMember &operator+=(const char *value) { return operator=(this->value() + value); }
+ HashMember &operator+=(const HardCoded &value) { return operator=(this->value() + value); }
HashMember &operator+=(double value) { return operator=(this->value() + value); }
/**
@@ -194,6 +205,7 @@ public:
HashMember &operator-=(char value) { return operator=(this->value() - value); }
HashMember &operator-=(const std::string &value) { return operator=(this->value() - value); }
HashMember &operator-=(const char *value) { return operator=(this->value() - value); }
+ HashMember &operator-=(const HardCoded &value) { return operator=(this->value() - value); }
HashMember &operator-=(double value) { return operator=(this->value() - value); }
/**
@@ -209,6 +221,7 @@ public:
HashMember &operator*=(char value) { return operator=(this->value() * value); }
HashMember &operator*=(const std::string &value) { return operator=(this->value() * value); }
HashMember &operator*=(const char *value) { return operator=(this->value() * value); }
+ HashMember &operator*=(const HardCoded &value) { return operator=(this->value() * value); }
HashMember &operator*=(double value) { return operator=(this->value() * value); }
/**
@@ -224,6 +237,7 @@ public:
HashMember &operator/=(char value) { return operator=(this->value() / value); }
HashMember &operator/=(const std::string &value) { return operator=(this->value() / value); }
HashMember &operator/=(const char *value) { return operator=(this->value() / value); }
+ HashMember &operator/=(const HardCoded &value) { return operator=(this->value() / value); }
HashMember &operator/=(double value) { return operator=(this->value() / value); }
/**
@@ -239,6 +253,7 @@ public:
HashMember &operator%=(char value) { return operator=(this->value() % value); }
HashMember &operator%=(const std::string &value) { return operator=(this->value() % value); }
HashMember &operator%=(const char *value) { return operator=(this->value() % value); }
+ HashMember &operator%=(const HardCoded &value) { return operator=(this->value() % value); }
HashMember &operator%=(double value) { return operator=(this->value() % value); }
/**
@@ -254,6 +269,7 @@ public:
Value operator+(char value) { return this->value() + value; }
Value operator+(const std::string &value) { return this->value() + value; }
Value operator+(const char *value) { return this->value() + value; }
+ Value operator+(const HardCoded &value) { return this->value() + value; }
Value operator+(double value) { return this->value() + value; }
/**
@@ -269,6 +285,7 @@ public:
Value operator-(char value) { return this->value() - value; }
Value operator-(const std::string &value) { return this->value() - value; }
Value operator-(const char *value) { return this->value() - value; }
+ Value operator-(const HardCoded &value) { return this->value() - value; }
Value operator-(double value) { return this->value() - value; }
/**
@@ -284,6 +301,7 @@ public:
Value operator*(char value) { return this->value() * value; }
Value operator*(const std::string &value) { return this->value() * value; }
Value operator*(const char *value) { return this->value() * value; }
+ Value operator*(const HardCoded &value) { return this->value() * value; }
Value operator*(double value) { return this->value() * value; }
/**
@@ -299,6 +317,7 @@ public:
Value operator/(char value) { return this->value() / value; }
Value operator/(const std::string &value) { return this->value() / value; }
Value operator/(const char *value) { return this->value() / value; }
+ Value operator/(const HardCoded &value) { return this->value() / value; }
Value operator/(double value) { return this->value() / value; }
/**
@@ -314,6 +333,7 @@ public:
Value operator%(char value) { return this->value() % value; }
Value operator%(const std::string &value) { return this->value() % value; }
Value operator%(const char *value) { return this->value() % value; }
+ Value operator%(const HardCoded &value) { return this->value() % value; }
Value operator%(double value) { return this->value() % value; }
/**