azure-core
extendable_enumeration.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 #pragma once
4 
10 #pragma once
11 
12 #include <string>
13 
14 namespace Azure { namespace Core { namespace _internal {
38  template <class T> class ExtendableEnumeration {
39  private:
40  std::string m_enumerationValue;
41 
42  protected:
43  ~ExtendableEnumeration() = default;
44 
45  public:
51  explicit ExtendableEnumeration(std::string enumerationValue)
52  : m_enumerationValue(std::move(enumerationValue))
53  {
54  }
55 
59  ExtendableEnumeration() = default;
60 
66  bool operator==(T const& other) const noexcept
67  {
68  return m_enumerationValue == other.m_enumerationValue;
69  }
70 
76  bool operator!=(T const& other) const noexcept { return !operator==(other); }
77 
82  std::string const& ToString() const { return m_enumerationValue; }
83  };
84 }}} // namespace Azure::Core::_internal
Azure
Azure SDK abstractions.
Definition: azure_assert.hpp:55