![]() |
Lumiera 0.pre.04
»edit your freedom«
|
Mixin-templates providing arbitrary function call operators and argument binding functions. More...
Go to the source code of this file.
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).
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... | |
| struct steam::control::bind_arg::_Type |