Vcsn  2.3
Be Rational
vcsn::dyn::detail::Registry< Fun > Class Template Reference

#include <registry.hh>

Collaboration diagram for vcsn::dyn::detail::Registry< Fun >:

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...))
 

Public Attributes

bool debug = getenv("VCSN_DYN")
 Whether log messages should be issued. More...
 

Private Types

using map_t = std::unordered_map< signature, Fun * >
 Signature -> pointer to implementation. More...
 

Private Attributes

std::string name_
 Function name (e.g., "determinize"). More...
 
map_t map_
 

Detailed Description

template<typename Fun>
class vcsn::dyn::detail::Registry< Fun >

Definition at line 21 of file registry.hh.

Member Typedef Documentation

template<typename Fun >
using vcsn::dyn::detail::Registry< Fun >::map_t = std::unordered_map<signature, Fun*>
private

Signature -> pointer to implementation.

Definition at line 129 of file registry.hh.

Constructor & Destructor Documentation

template<typename Fun >
vcsn::dyn::detail::Registry< Fun >::Registry ( const std::string &  name)
inline

Create a register for an algorithm.

Parameters
namethe name of the algo.

Definition at line 26 of file registry.hh.

template<typename Fun >
vcsn::dyn::detail::Registry< Fun >::Registry ( )
delete

Member Function Documentation

template<typename Fun >
template<typename... Args>
auto vcsn::dyn::detail::Registry< Fun >::call ( const signature sig,
Args &&...  args 
) -> decltype(std::declval<Fun>()(args...))
inline

Call function for signature sig.

make_context needs this signature.

Definition at line 110 of file registry.hh.

Referenced by vcsn::dyn::detail::Registry< Fun >::call().

template<typename Fun >
template<typename... Args>
auto vcsn::dyn::detail::Registry< Fun >::call ( Args &&...  args) -> decltype(std::declval<Fun>()(args...))
inline

Definition at line 118 of file registry.hh.

References vcsn::dyn::detail::Registry< Fun >::call(), and vcsn::vsignature().

Here is the call graph for this function:

template<typename Fun >
const Fun* vcsn::dyn::detail::Registry< Fun >::get ( const signature sig)
inline

Get function for signature sig.

Definition at line 75 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::res, vcsn::dyn::detail::Registry< Fun >::signatures(), and VCSN_REQUIRE.

Here is the call graph for this function:

template<typename Fun >
const Fun* vcsn::dyn::detail::Registry< Fun >::get0 ( const signature sig)
inline

Get function for signature sig.

Definition at line 45 of file registry.hh.

References vcsn::dyn::detail::Registry< Fun >::map_, and vcsn::dyn::detail::Registry< Fun >::name_.

Referenced by vcsn::dyn::detail::Registry< Fun >::get().

template<typename Fun >
bool vcsn::dyn::detail::Registry< Fun >::set ( const signature sig,
Fun *  fn 
)
inline

Register function fn for signature sig.

Definition at line 36 of file registry.hh.

References vcsn::dyn::detail::Registry< Fun >::map_, and vcsn::dyn::detail::Registry< Fun >::name_.

template<typename Fun >
std::string vcsn::dyn::detail::Registry< Fun >::signatures ( const signature sig) const
inline

A message about a failed signature compilation.

Definition at line 57 of file registry.hh.

References vcsn::dyn::detail::Registry< Fun >::map_, vcsn::res, vcsn::sort(), and vcsn::signature::to_string().

Referenced by vcsn::dyn::detail::Registry< Fun >::get().

Here is the call graph for this function:

Member Data Documentation

template<typename Fun >
bool vcsn::dyn::detail::Registry< Fun >::debug = getenv("VCSN_DYN")

Whether log messages should be issued.

Definition at line 33 of file registry.hh.

template<typename Fun >
std::string vcsn::dyn::detail::Registry< Fun >::name_
private

Function name (e.g., "determinize").

Definition at line 127 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().


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