17 #ifndef AWALI_COMMON_ENUMS_UTILS_HH
18 #define AWALI_COMMON_ENUMS_UTILS_HH
128 const std::string&
value);
130 std::vector<enum_join_t>
enum_values (std::string
const& enum_name);
135 #define GENERATE_MAKE_ENUM(id,enum_t) \
136 template<typename T=enum_t> \
137 auto make_enum(std::string const& str) \
138 -> typename std::enable_if<std::is_same<T,enum_t>::value,T>::type \
139 { return (enum_t) enum_of_string(#enum_t,str); } \
141 template<typename T=enum_t> \
143 -> typename std::enable_if<std::is_same<T,enum_t>::value, \
144 std::vector<T> const&>::type \
145 { static std::vector<enum_t> values; \
146 if (values.empty()) \
147 for (auto v : enum_values(#enum_t)) \
148 values.push_back((enum_t) v); \
151 template<typename T=enum_t> \
152 constexpr auto index_of() \
153 -> typename std::enable_if<std::is_same<T,enum_t>::value, \
154 short unsigned>::type \
169 #undef GENERATE_MAKE_ENUM
#define GENERATE_MAKE_ENUM(id, enum_t)
Definition: enum_utils.hh:135
direction_t
Used in some algorithms in which one may considers transitions forward or backwards.
Definition: enums.hh:35
state_elim_order_t
The different strategies for choosing which state to eliminate first when transforming an automaton i...
Definition: enums.hh:107
layout_t
The different layout that we may pass to program dot to compute geometry of automata.
Definition: enums.hh:44
quotient_algo_t
The different algorithms for computing the minimal quotient.
Definition: enums.hh:64
star_status_t
The different behaviours a weightset may have with respect to the star.
Definition: enums.hh:163
minim_algo_t
The different algorithms for computing the minimal automaton.
Definition: enums.hh:55
io_format_t
The different format for input/output of automata and expressions.
Definition: enums.hh:123
exp_to_aut_algo_t
The different algorithms for transforming an expression into an automaton.
Definition: enums.hh:70
unsigned short index_of_enum(std::string enum_name)
std::vector< enum_join_t > enum_values(std::string const &enum_name)
long enum_join_t
Definition: enum_utils.hh:125
enum_join_t enum_of_string(const std::string &enum_name, const std::string &value)
static constexpr TOP< void > value
Definition: priority.hh:93
Main namespace of Awali.
Definition: ato.hh:22
exp_to_aut_algo_t make_exp_to_aut_algo(std::string const &name)
Builds a exp_to_aut_algo_t from a string describing its name.
layout_t make_layout(std::string const &name)
Builds a layout_t from a string describing its name.
direction_t make_direction(std::string const &name)
Builds a direction_t from a string describing its name.
quotient_algo_t make_quotient_algo(std::string const &name)
Builds a quotient_algo_t from a string describing its name.
io_format_t make_io_format(std::string const &name)
Builds a io_format_t from a string describing its name.
std::string name_of(direction_t val)
Return the canonical string reprensation of given direction_t.
std::string default_extension_of(io_format_t val)
Return the default extension of a file written in given format.
state_elim_order_t make_state_elim_order_t(std::string const &name)
Builds a state_elim_order_t from a string describing its name.