diff options
author | Lutz Bichler <Lutz.Bichler@bmw.de> | 2015-06-17 11:29:46 +0200 |
---|---|---|
committer | Lutz Bichler <Lutz.Bichler@bmw.de> | 2015-06-17 11:29:46 +0200 |
commit | c52b2b094ef5844c182f097b14923764758dfe80 (patch) | |
tree | f4e0446c1f8411dca5336884e2bc10a820ef8722 /include/CommonAPI/Enumeration.hpp | |
parent | 6c463fcc3dcee619925f08ea09e19a86b9e581cc (diff) | |
download | genivi-common-api-runtime-c52b2b094ef5844c182f097b14923764758dfe80.tar.gz |
CommonAPI 3.1.2
Diffstat (limited to 'include/CommonAPI/Enumeration.hpp')
-rw-r--r-- | include/CommonAPI/Enumeration.hpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/include/CommonAPI/Enumeration.hpp b/include/CommonAPI/Enumeration.hpp index 1a4d5f4..da0372d 100644 --- a/include/CommonAPI/Enumeration.hpp +++ b/include/CommonAPI/Enumeration.hpp @@ -8,11 +8,11 @@ namespace CommonAPI { -template <typename _Base> +template<typename _Base> struct Enumeration { Enumeration() = default; - Enumeration(const _Base &_value) - : value_(_value) { + Enumeration(const _Base &_value) : + value_(_value) { } inline Enumeration &operator=(const _Base &_value) { @@ -24,12 +24,28 @@ struct Enumeration { return value_; } - inline bool operator == (const Enumeration<_Base> &_other) const { - return value_ == _other.value_; + inline bool operator==(const Enumeration<_Base> &_other) const { + return (value_ == _other.value_); } - inline bool operator != (const Enumeration<_Base> &_other) const { - return value_ != _other.value_; + inline bool operator!=(const Enumeration<_Base> &_other) const { + return (value_ != _other.value_); + } + + inline bool operator<(const Enumeration<_Base> &_other) const { + return (value_ < _other.value_); + } + + inline bool operator<=(const Enumeration<_Base> &_other) const { + return (value_ <= _other.value_); + } + + inline bool operator>(const Enumeration<_Base> &_other) const { + return (value_ > _other.value_); + } + + inline bool operator>=(const Enumeration<_Base> &_other) const { + return (value_ >= _other.value_); } _Base value_; |