Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 Proc-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 Proc-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

 proc
 Proc-Layer implementation namespace root.
 
 proc::control
 Proc-Layer dispatcher, controller and administrative facilities.
 
 proc::control::bind_arg
 

Class Documentation

struct proc::control::bind_arg::_Type
Class Members
typedef typename _Fun< SIG >::Args Args
typedef typename _Fun< SIG >::Ret Ret
typedef SIG Sig
typedef Tuple< Args > ArgTuple
+ Collaboration diagram for _Type< SIG >:
struct proc::control::bind_arg::_Type< std::tuple< TYPES...> >
Class Members
Args
typedef void Ret
typedef typename
FunctionTypedef< void, Args >
::Sig
Sig
ArgTuple
+ Collaboration diagram for _Type< std::tuple< TYPES...> >:
struct proc::control::bind_arg::AcceptArgs
+ Inheritance diagram for AcceptArgs< TAR, BA, RET, TYPES >:
+ Collaboration diagram for AcceptArgs< TAR, BA, RET, TYPES >:
struct proc::control::bind_arg::AcceptBind
+ Inheritance diagram for AcceptBind< TAR, BA, RET, TYPES >:
+ Collaboration diagram for AcceptBind< TAR, BA, RET, TYPES >:
struct proc::control::bind_arg::Dummy
+ Collaboration diagram for Dummy: