diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-03 10:07:52 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-03 10:07:52 +0100 |
commit | 7c8422653051baead5ed17ffc055b4d9e23a2e72 (patch) | |
tree | d5810f4e438e2a293664eb2887780ff3798e1b23 | |
parent | c1537e04e922bd8cb1d9a62670698d712ead657f (diff) | |
download | sink-7c8422653051baead5ed17ffc055b4d9e23a2e72.tar.gz sink-7c8422653051baead5ed17ffc055b4d9e23a2e72.zip |
Comparison operator for ApplicationDomainType
-rw-r--r-- | common/domain/applicationdomaintype.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index b4d6f8a..157415f 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -149,6 +149,16 @@ public: | |||
149 | ApplicationDomainType(const ApplicationDomainType &other); | 149 | ApplicationDomainType(const ApplicationDomainType &other); |
150 | ApplicationDomainType& operator=(const ApplicationDomainType &other); | 150 | ApplicationDomainType& operator=(const ApplicationDomainType &other); |
151 | 151 | ||
152 | inline bool operator==(const ApplicationDomainType &other) | ||
153 | { | ||
154 | return other.identifier() == identifier(); | ||
155 | } | ||
156 | |||
157 | inline bool operator!=(const ApplicationDomainType &other) | ||
158 | { | ||
159 | return !(*this == other); | ||
160 | } | ||
161 | |||
152 | template <typename DomainType> | 162 | template <typename DomainType> |
153 | DomainType cast() { | 163 | DomainType cast() { |
154 | static_assert(std::is_base_of<ApplicationDomainType, DomainType>::value, "You can only cast to base classes of ApplicationDomainType."); | 164 | static_assert(std::is_base_of<ApplicationDomainType, DomainType>::value, "You can only cast to base classes of ApplicationDomainType."); |