Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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...))
 
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_
 

Detailed Description

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

Definition at line 20 of file registry.hh.

Member Typedef Documentation

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

Context name -> pointer to implementation.

Definition at line 130 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 25 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.

Definition at line 100 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 108 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 >
template<typename T >
auto vcsn::dyn::detail::Registry< Fun >::call_variadic ( const std::vector< T > &  ts) -> decltype(std::declval<Fun>()(ts))
inline

Definition at line 117 of file registry.hh.

References vcsn::signature::sig, and vcsn::vname().

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

Here is the call graph for this function:

template<typename Fun >
const Fun* vcsn::dyn::detail::Registry< Fun >::get0 ( const signature sig)
inline
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 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_.

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

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 32 of file registry.hh.

Referenced by vcsn::dyn::detail::Registry< Fun >::get0(), and vcsn::dyn::detail::Registry< Fun >::set().

template<typename Fun >
std::string vcsn::dyn::detail::Registry< Fun >::name_
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().


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