Lumiera  0.pre.03
»edit your freedom«
argument-tuple-accept.hpp File Reference

Go to the source code of this file.

Description

Mixin-templates providing arbitrary function call operators and argument binding functions.

By inheriting from one of these templates, a class can accept a specifically typed binding or function call, as specified by the template parameters, or alternatively it can inherit a complete set of templated argument binding functions, assuming that the matching signature can be detected at runtime. These templates are used for the Steam-Layer command frontend, to bind to the actual command arguments.

The AcceptArgumentBinding template allows to mix in a bind(...) function. Thereby, the correct number and types of arguments is derived according to the function signature given as template parameter. The class mixing in this template needs to provide a suitable member function bindArg(Tuple<...>), which accepts all the command arguments packaged together into a tuple (record). AcceptArgumentTuple works similar, but provides function call operators rather.

Contrary to this, the AcceptAnyBinding mixin template provides a complete set of bind(...) functions, accepting up to 9 arbitrary call parameters and again forwarding the call to a template member function bindArg(Tuple<...>) This helper template is used on the control::Command frontend objects; in this case, there is a runtime type-check built into CommandImpl which will throw when the provided arguments don't fit the (hidden) function signature embedded within the CommandMutation (functor).

Todo:
switch to variadic templates. Requires a rework of Types<...> /////////////////////////////////////TICKET #967
See also
Command
CommandDef
argument-tuple-accept-test.cpp
command-invocation.hpp

Definition in file argument-tuple-accept.hpp.

#include "lib/meta/typelist.hpp"
#include "lib/meta/function.hpp"
#include "lib/meta/tuple-helper.hpp"
#include <utility>
#include <tuple>

Classes

struct  _Type< SIG >
 
struct  _Type< std::tuple< TYPES... > >
 
struct  AcceptAnyBind< TAR, BA, RET >
 
class  AcceptAnyBinding< TAR, RET, BASE >
 Helper Template for control::Command, mix-in complete set of bind(...) functions. More...
 
struct  AcceptArgs< TAR, BA, RET, TYPES >
 
struct  AcceptArgs< TAR, BA, RET, Types< T1 > >
 < Accept binding for 1 Argument More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2 > >
 < Accept binding for 2 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3 > >
 < Accept binding for 3 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4 > >
 < Accept binding for 4 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4, T5 > >
 < Accept binding for 5 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6 > >
 < Accept binding for 6 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7 > >
 < Accept binding for 7 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7, T8 > >
 < Accept binding for 8 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7, T8, T9 > >
 < Accept binding for 9 Arguments More...
 
struct  AcceptArgs< TAR, BA, RET, Types<> >
 < Accept dummy binding (0 Arguments) More...
 
class  AcceptArgumentBinding< SIG, TAR, BASE >
 Helper Template for Steam-Layer control::Command : mix in a bind(...) function. More...
 
class  AcceptArgumentBindingRet< RET, SIG, TAR, BASE >
 Variation of AcceptArgumentBinding, allowing to control the return type of the generated bind(...) functions independently from SIG. More...
 
class  AcceptArgumentTuple< SIG, TAR, BASE >
 Helper Template for building a Functor or function-like class: Mix in a function call operator, which mimics the specified signature SIG . More...
 
struct  AcceptBind< TAR, BA, RET, TYPES >
 
struct  AcceptBind< TAR, BA, RET, Types< T1 > >
 < Accept binding for 1 Argument More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2 > >
 < Accept binding for 2 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3 > >
 < Accept binding for 3 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4 > >
 < Accept binding for 4 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4, T5 > >
 < Accept binding for 5 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6 > >
 < Accept binding for 6 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7 > >
 < Accept binding for 7 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7, T8 > >
 < Accept binding for 8 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types< T1, T2, T3, T4, T5, T6, T7, T8, T9 > >
 < Accept binding for 9 Arguments More...
 
struct  AcceptBind< TAR, BA, RET, Types<> >
 < Accept dummy binding (0 Arguments) More...
 
struct  Dummy
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::control
 Steam-Layer dispatcher, controller and administrative facilities.