Pothos  0.4.3-gabce2ce6
The Pothos dataflow programming software suite
CallRegistryImpl.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 template <typename... ArgsType, typename ReturnType, typename ClassType, typename InstanceType>
20 void CallRegistry::registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)(ArgsType...))
21 {
22  Callable call(method);
23  call.bind(std::ref(*static_cast<ClassType *>(instance)), 0);
24  this->registerCallable(name, call);
25 }
26 
27 template <typename... ArgsType, typename ReturnType, typename ClassType, typename InstanceType>
28 void CallRegistry::registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)(ArgsType...) const)
29 {
30  Callable call(method);
31  call.bind(std::ref(*static_cast<ClassType *>(instance)), 0);
32  this->registerCallable(name, call);
33 }
34 
35 } //namespace Pothos
Callable & bind(ValueType &&val, const size_t argNo)
Definition: CallableImpl.hpp:35
Definition: Callable.hpp:30
Definition: CallInterface.hpp:15
virtual void registerCallable(const std::string &name, const Callable &call)=0
void registerCall(InstanceType *instance, const std::string &name, ReturnType(ClassType::*method)(ArgsType...))
Definition: CallRegistryImpl.hpp:20