enum_description.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include <string>
11 #include <utility>
13 
14 
15 namespace illumina { namespace interop { namespace constants
16 {
19  template<typename Enum>
21  {
22  public:
24  typedef Enum enum_t;
25 
26  public:
28  enum_description() : m_value(static_cast<Enum>(constants::Unknown)){}
34  enum_description(const enum_t val, const std::string& description) : m_value(val), m_description(description){}
39  enum_description(const std::pair<metric_type, std::string >& pair) :
40  m_value(pair.first), m_description(pair.second){}
41 
42  public:
47  enum_t value()const
48  {
49  return m_value;
50  }
55  const std::string& description()const
56  {
57  return m_description;
58  }
63  operator enum_t()const
64  {
65  return m_value;
66  }
67 
68  private:
69  Enum m_value;
70  std::string m_description;
71  };
72 }}}
73 
74 
75 
enum_description(const enum_t val, const std::string &description)
Definition: enum_description.h:34
Definition: enum_description.h:15
enum_description(const std::pair< metric_type, std::string > &pair)
Definition: enum_description.h:39
enum_t value() const
Definition: enum_description.h:47
enum_description()
Definition: enum_description.h:28
Definition: enum_description.h:20
Enum enum_t
Definition: enum_description.h:24
const std::string & description() const
Definition: enum_description.h:55