|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Wraps a member function of some object and stores its default arguments. Moving from CallableMemberWrapper does not work since this class holds const members and a reference to the object the member function is invoked on. Copy instead. More...
#include <Util.h>
Inheritance diagram for Util::CallableMemberWrapper< ObjectT, CallableT >:Public Member Functions | |
| constexpr | CallableMemberWrapper (ObjectT &Object, const CallableT Callable, ArgumentTs DefaultArgs={}) noexcept |
Constructs a CallableMemberWrapper instance. | |
| template<typename... ArgTs> | |
| auto | operator() (ArgTs &&...Args) const |
| Invokes the stored member function. If arguments are passed, they are are forwarded instead of the stored default arguments. | |
Public Member Functions inherited from Util::INonMovable | |
| INonMovable (const INonMovable &)=default | |
| INonMovable & | operator= (const INonMovable &)=default |
| INonMovable (INonMovable &&)=delete | |
| INonMovable & | operator= (INonMovable &&)=delete |
Private Types | |
| using | ArgumentTs = argument_of_t< CallableT > |
Private Member Functions | |
| template<size_t... Indices, typename... ArgTs> | |
| auto | Invoke (std::integer_sequence< size_t, Indices... >, ArgTs &&...Args) const |
Private Attributes | |
| ObjectT & | Object |
Instance of class Callable belongs to. Callable is invoked on this instance. | |
| const CallableT | Callable |
| Pointer to class member function to be invoked. | |
| const ArgumentTs | DefaultArgs |
Default arguments to be passed when invoking operator() with less arguments Callable expects. | |
Additional Inherited Members | |
Protected Member Functions inherited from Util::INonMovable | |
| constexpr | INonMovable ()=default |
| ~INonMovable ()=default | |
Wraps a member function of some object and stores its default arguments. Moving from CallableMemberWrapper does not work since this class holds const members and a reference to the object the member function is invoked on. Copy instead.
| ObjectT | Type of the object the member function belongs to |
| CallableT | The member function's function pointer type |
|
private |
|
inlineconstexprnoexcept |
Constructs a CallableMemberWrapper instance.
| Object | Instance the member function is invoked on |
| Callable | Pointer to a member function |
| DefaultArgs | Default arguments to be passed to the member function upon invocation without passing other arguments |
|
inlineprivate |
|
inline |
Invokes the stored member function. If arguments are passed, they are are forwarded instead of the stored default arguments.
| ...ArgTs | Types of the arguments expected by the wrapped member function |
| ...Args | Arguments to be forwarded to the wrapped member function |
|
private |
|
private |
|
private |