Awali
Another Weighted Automata library
Namespaces | Macros | Typedefs | Functions
enum_utils.hh File Reference
#include <awali/common/enums.hh>
#include <vector>
#include <string>

Go to the source code of this file.

Namespaces

 awali
 Main namespace of Awali.
 
 awali::internal
 Namespace containing implementation details of elements common to sttc and dyn layers (not stable).
 

Macros

#define GENERATE_MAKE_ENUM(id, enum_t)
 

Typedefs

using awali::internal::enum_join_t = long
 

Functions

std::string awali::default_extension_of (io_format_t val)
 Return the default extension of a file written in given format. More...
 
enum_join_t awali::internal::enum_of_string (const std::string &enum_name, const std::string &value)
 
std::vector< enum_join_t > awali::internal::enum_values (std::string const &enum_name)
 
template<typename T = direction_t>
constexpr auto awali::internal::index_of () -> typename std::enable_if< std::is_same< T, direction_t >::value, short unsigned >::type
 
unsigned short awali::internal::index_of_enum (std::string enum_name)
 
direction_t awali::make_direction (std::string const &name)
 Builds a direction_t from a string describing its name. More...
 
template<typename T = direction_t>
auto awali::internal::make_enum (std::string const &str) -> typename std::enable_if< std::is_same< T, direction_t >::value, T >::type
 
exp_to_aut_algo_t awali::make_exp_to_aut_algo (std::string const &name)
 Builds a exp_to_aut_algo_t from a string describing its name. More...
 
io_format_t awali::make_io_format (std::string const &name)
 Builds a io_format_t from a string describing its name. More...
 
layout_t awali::make_layout (std::string const &name)
 Builds a layout_t from a string describing its name. More...
 
quotient_algo_t awali::make_quotient_algo (std::string const &name)
 Builds a quotient_algo_t from a string describing its name. More...
 
state_elim_order_t awali::make_state_elim_order_t (std::string const &name)
 Builds a state_elim_order_t from a string describing its name. More...
 
std::string awali::name_of (direction_t val)
 Return the canonical string reprensation of given direction_t. More...
 
std::string awali::name_of (exp_to_aut_algo_t val)
 Return the canonical string reprensation of given exp_to_aut_algo_t. More...
 
std::string awali::name_of (io_format_t val)
 Return the canonical string reprensation of given io_format_t. More...
 
std::string awali::name_of (layout_t val)
 Return the canonical string reprensation of given layout_t. More...
 
std::string awali::name_of (quotient_algo_t val)
 Return the canonical string reprensation of given quotient_algo_t. More...
 
std::string awali::name_of (state_elim_order_t val)
 Return the canonical string reprensation of given state_elim_order_t. More...
 
template<typename T = direction_t>
auto awali::internal::values_of () -> typename std::enable_if< std::is_same< T, direction_t >::value, std::vector< T > const & >::type
 

Macro Definition Documentation

◆ GENERATE_MAKE_ENUM

#define GENERATE_MAKE_ENUM (   id,
  enum_t 
)
Value:
template<typename T=enum_t> \
auto make_enum(std::string const& str) \
{ return (enum_t) enum_of_string(#enum_t,str); } \
\
template<typename T=enum_t> \
auto values_of() \
std::vector<T> const&>::type \
{ static std::vector<enum_t> values; \
if (values.empty()) \
for (auto v : enum_values(#enum_t)) \
values.push_back((enum_t) v); \
return values; } \
\
template<typename T=enum_t> \
constexpr auto index_of() \
short unsigned>::type \
{return id;}
auto make_enum(std::string const &str) -> typename std::enable_if< std::is_same< T, direction_t >::value, T >::type
Definition: enum_utils.hh:159
std::vector< enum_join_t > enum_values(std::string const &enum_name)
constexpr auto index_of() -> typename std::enable_if< std::is_same< T, direction_t >::value, short unsigned >::type
Definition: enum_utils.hh:159
auto values_of() -> typename std::enable_if< std::is_same< T, direction_t >::value, std::vector< T > const & >::type
Definition: enum_utils.hh:159
enum_join_t enum_of_string(const std::string &enum_name, const std::string &value)
static constexpr TOP< void > value
Definition: priority.hh:93