gms: added missing operator==() required for endpoint_state_map comparison.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
Vlad Zolotarov
2015-05-10 17:34:56 +03:00
parent c1f0d285bb
commit 1e32bdf090
3 changed files with 16 additions and 0 deletions

View File

@@ -43,6 +43,13 @@ private:
db_clock::time_point _update_timestamp;
bool _is_alive;
public:
bool operator==(const endpoint_state& other) const {
return _heart_beat_state == other._heart_beat_state &&
_application_state == other._application_state &&
_update_timestamp == other._update_timestamp &&
_is_alive == other._is_alive;
}
endpoint_state()
: _heart_beat_state(0)
, _update_timestamp(db_clock::now())

View File

@@ -35,6 +35,10 @@ private:
int32_t _generation;
int32_t _version;
public:
bool operator==(const heart_beat_state& other) const {
return _generation == other._generation && _version == other._version;
}
heart_beat_state(int32_t gen)
: _generation(gen)
, _version(0) {

View File

@@ -72,6 +72,11 @@ public:
int version;
sstring value;
public:
bool operator==(const versioned_value& other) const {
return version == other.version &&
value == other.value;
}
versioned_value()
: version(version_generator::get_next_version())
, value("") {