Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
argument-tuple-accept.hpp File Reference

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

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

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>

Namespaces

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

Classes

struct  AcceptArgs< TAR, BA, RET, Types< ARGS... > >
 
struct  AcceptBind< TAR, BA, RET, Types< ARGS... > >
 
struct  AcceptAnyBind< TAR, BA, RET >
 
struct  _Type< SIG >
 
struct  _Type< std::tuple< TYPES... > >
 
struct  Dummy
 
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...
 
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  AcceptAnyBinding< TAR, RET, BASE >
 Helper Template for control::Command, mix-in complete set of bind(...) functions. More...
 

Class Documentation

◆ steam::control::bind_arg::_Type

struct steam::control::bind_arg::_Type
Class Members
typedef Args Args
typedef Ret Ret
typedef SIG Sig
typedef Tuple< Args > ArgTuple
+ Collaboration diagram for _Type< SIG >:

◆ steam::control::bind_arg::_Type< std::tuple< TYPES... > >

struct steam::control::bind_arg::_Type< std::tuple< TYPES... > >
Class Members
typedef Seq Args
typedef void Ret
typedef Sig Sig
typedef tuple< TYPES... > ArgTuple
+ Collaboration diagram for _Type< std::tuple< TYPES... > >: