summaryrefslogtreecommitdiff
path: root/include/CommonAPI/Enumeration.hpp
diff options
context:
space:
mode:
authorJürgen Gehring <juergen.gehring@bmw.de>2015-06-11 06:57:47 -0700
committerJürgen Gehring <juergen.gehring@bmw.de>2015-06-11 06:57:47 -0700
commit6c463fcc3dcee619925f08ea09e19a86b9e581cc (patch)
tree17e765e0623c58778150605d1cd0340c658ce6ab /include/CommonAPI/Enumeration.hpp
parent1d83eb38e546e0165f1ad6821f04445b2b9b19d2 (diff)
downloadgenivi-common-api-runtime-6c463fcc3dcee619925f08ea09e19a86b9e581cc.tar.gz
CommonAPI 3.1.1
Diffstat (limited to 'include/CommonAPI/Enumeration.hpp')
-rw-r--r--include/CommonAPI/Enumeration.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/CommonAPI/Enumeration.hpp b/include/CommonAPI/Enumeration.hpp
new file mode 100644
index 0000000..1a4d5f4
--- /dev/null
+++ b/include/CommonAPI/Enumeration.hpp
@@ -0,0 +1,40 @@
+// Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef COMMONAPI_ENUMERATION_HPP_
+#define COMMONAPI_ENUMERATION_HPP_
+
+namespace CommonAPI {
+
+template <typename _Base>
+struct Enumeration {
+ Enumeration() = default;
+ Enumeration(const _Base &_value)
+ : value_(_value) {
+ }
+
+ inline Enumeration &operator=(const _Base &_value) {
+ value_ = _value;
+ return (*this);
+ }
+
+ inline operator const _Base() const {
+ 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_;
+ }
+
+ _Base value_;
+};
+
+} // namespace CommonAPI
+
+#endif // COMMONAPI_ENUMERATION_HPP_