Pothos  0.3.3-g32d3017c
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
CallRegistryImpl.tmpl.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
15 #include <functional> //std::ref
16 
17 namespace Pothos {
18 
19 #for $NARGS in range($MAX_ARGS)
20 template <$expand('typename A%d', $NARGS), typename ReturnType, typename ClassType, typename InstanceType>
21 void CallRegistry::registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)($expand('A%d', $NARGS)))
22 {
23  Callable call(method);
24  call.bind(std::ref(*static_cast<ClassType *>(instance)), 0);
25  this->registerCallable(name, call);
26 }
27 
28 template <$expand('typename A%d', $NARGS), typename ReturnType, typename ClassType, typename InstanceType>
29 void CallRegistry::registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)($expand('A%d', $NARGS)) const)
30 {
31  Callable call(method);
32  call.bind(std::ref(*static_cast<ClassType *>(instance)), 0);
33  this->registerCallable(name, call);
34 }
35 
36 #end for
37 
38 } //namespace Pothos
Callable & bind(ValueType &&val, const size_t argNo)
Definition: CallableImpl.tmpl.hpp:35
Definition: Callable.tmpl.hpp:30
void registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)($expand('A%d', $NARGS)))
Definition: CallRegistryImpl.tmpl.hpp:21
virtual void registerCallable(const std::string &name, const Callable &call)=0