Vcsn
2.0
Be Rational
|
#include <registry.hh>
Public Member Functions | |
Registry (const std::string &name) | |
Create a register for an algorithm. More... | |
Registry ()=delete | |
bool | set (const signature &sig, Fun fn) |
Register function fn for signature sig. More... | |
const Fun * | get0 (const signature &sig) |
Get function for signature sig. More... | |
std::string | signatures (const signature &sig) const |
A message about a failed signature compilation. More... | |
const Fun & | get (const signature &sig) |
Get function for signature sig. More... | |
template<typename... Args> | |
auto | call (const signature &sig, Args &&...args) -> decltype(std::declval< Fun >()(args...)) |
Call function for signature sig. More... | |
template<typename... Args> | |
auto | call (Args &&...args) -> decltype(std::declval< Fun >()(args...)) |
template<typename T > | |
auto | call_variadic (const std::vector< T > &ts) -> decltype(std::declval< Fun >()(ts)) |
Public Attributes | |
bool | debug = getenv("VCSN_DYN") |
Whether log messages should be issued. More... | |
Private Types | |
using | map_t = std::map< signature, Fun * > |
Context name -> pointer to implementation. More... | |
Private Attributes | |
std::string | name_ |
Function name (e.g., "determinize"). More... | |
map_t | map_ |
Definition at line 20 of file registry.hh.
|
private |
Context name -> pointer to implementation.
Definition at line 130 of file registry.hh.
|
inline |
Create a register for an algorithm.
name | the name of the algo. |
Definition at line 25 of file registry.hh.
|
delete |
|
inline |
Call function for signature sig.
Definition at line 100 of file registry.hh.
Referenced by vcsn::dyn::detail::Registry< Fun >::call().
|
inline |
Definition at line 108 of file registry.hh.
References vcsn::dyn::detail::Registry< Fun >::call(), and vcsn::vsignature().
|
inline |
Definition at line 117 of file registry.hh.
References vcsn::signature::sig, and vcsn::vname().
|
inline |
Get function for signature sig.
Definition at line 68 of file registry.hh.
References vcsn::dyn::jit_error::assertions, vcsn::dyn::compile(), vcsn::dyn::detail::Registry< Fun >::get0(), vcsn::dyn::detail::Registry< Fun >::name_, vcsn::require(), and vcsn::dyn::detail::Registry< Fun >::signatures().
|
inline |
Get function for signature sig.
Definition at line 44 of file registry.hh.
References vcsn::dyn::detail::Registry< Fun >::debug, vcsn::dyn::detail::Registry< Fun >::map_, and vcsn::dyn::detail::Registry< Fun >::name_.
Referenced by vcsn::dyn::detail::Registry< Fun >::get().
|
inline |
Register function fn for signature sig.
Definition at line 35 of file registry.hh.
References vcsn::dyn::detail::Registry< Fun >::debug, vcsn::dyn::detail::Registry< Fun >::map_, and vcsn::dyn::detail::Registry< Fun >::name_.
|
inline |
A message about a failed signature compilation.
Definition at line 56 of file registry.hh.
References vcsn::dyn::detail::Registry< Fun >::map_, and vcsn::signature::to_string().
Referenced by vcsn::dyn::detail::Registry< Fun >::get().
bool vcsn::dyn::detail::Registry< Fun >::debug = getenv("VCSN_DYN") |
Whether log messages should be issued.
Definition at line 32 of file registry.hh.
Referenced by vcsn::dyn::detail::Registry< Fun >::get0(), and vcsn::dyn::detail::Registry< Fun >::set().
|
private |
Definition at line 131 of file registry.hh.
Referenced by vcsn::dyn::detail::Registry< Fun >::get0(), vcsn::dyn::detail::Registry< Fun >::set(), and vcsn::dyn::detail::Registry< Fun >::signatures().
|
private |
Function name (e.g., "determinize").
Definition at line 128 of file registry.hh.
Referenced by vcsn::dyn::detail::Registry< Fun >::get(), vcsn::dyn::detail::Registry< Fun >::get0(), and vcsn::dyn::detail::Registry< Fun >::set().