Horizon
Public Member Functions | List of all members
horizon::LutEnumStr< T > Class Template Reference

Trivial bidirectional map for mapping strings to enums. More...

#include <lut.hpp>

Public Member Functions

 LutEnumStr (std::initializer_list< std::pair< const std::string, const T >> s)
 
const T lookup (const std::string &s) const
 
const T lookup (const std::string &s, T def) const
 
const std::string & lookup_reverse (const T s) const
 
 LutEnumStr (std::initializer_list< std::pair< const std::string, const T >> s)
 
const T lookup (const std::string &s) const
 
const T lookup (const std::string &s, T def) const
 
const std::string & lookup_reverse (const T s) const
 

Detailed Description

template<typename T>
class horizon::LutEnumStr< T >

Trivial bidirectional map for mapping strings to enums.

Used for serializing and derserializing objects to/from json.

Member Function Documentation

◆ lookup() [1/2]

template<typename T >
const T horizon::LutEnumStr< T >::lookup ( const std::string &  s) const
inline
Returns
the enum corresponding to string s

◆ lookup() [2/2]

template<typename T >
const T horizon::LutEnumStr< T >::lookup ( const std::string &  s) const
inline
Returns
the enum corresponding to string s

◆ lookup_reverse() [1/2]

template<typename T >
const std::string& horizon::LutEnumStr< T >::lookup_reverse ( const T  s) const
inline
Returns
the string corresponding to enum s

◆ lookup_reverse() [2/2]

template<typename T >
const std::string& horizon::LutEnumStr< T >::lookup_reverse ( const T  s) const
inline
Returns
the string corresponding to enum s

The documentation for this class was generated from the following file: