Vcsn  2.4
Be Rational
kind.hh File Reference
#include <istream>
#include <vcsn/misc/stream.hh>
#include <vcsn/misc/symbol.hh>
#include <vcsn/misc/type_traits.hh>
Include dependency graph for kind.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  vcsn::labels_are_letters
struct  vcsn::is_lal< Kinded >
struct  vcsn::labels_are_nullable
struct  vcsn::is_lan< Kinded >
struct  vcsn::labels_are_one
struct  vcsn::is_lao< Kinded >
struct  vcsn::labels_are_expressions
struct  vcsn::is_lar< Kinded >
struct  vcsn::labels_are_tuples
struct  vcsn::is_lat< Kinded >
struct  vcsn::labels_are_words
struct  vcsn::is_law< Kinded >




#define DEFINE(Abbrev, Name)
 Define the kinds, and auxiliary tools. More...

Macro Definition Documentation

#define DEFINE (   Abbrev,
struct labels_are_ ## Name \
{ \
static symbol sname() \
{ \
static auto res = symbol{#Abbrev}; \
return res; \
} \
static void make(std::istream& is) \
{ \
eat(is, sname()); \
} \
}; \
template <typename Kinded> \
struct is_ ## Abbrev \
: std::is_same<typename Kinded::kind_t, labels_are_ ## Name> \
return res
Definition: multiply.hh:398
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
Definition: symbol.hh:23
symbol sname()
Definition: name.hh:65

Define the kinds, and auxiliary tools.

is_ABBREV<Kinded>: Whether Kinded has a specific kind_t

if_ABBREV<Kinded, R = Kinded>: Provide "overloading" on parameter types, for instance to require letter_t when labels_are_letters, and word_t when labels_are_words. See expressionset::atom and expressionset::atom_ for an example.

It is very tempting to turn these guys into members of context, but then, instead of "(if_lal<Ctx, letter_t> v)", one must write "(typename Cxx::template if_lal<letter_t> v)".

Definition at line 26 of file kind.hh.