[Orc][RPC] Add a class-method version of addHandler to MultiThreadedRPCEndpoint.

This brings MultiThreadedRPCEndpoint's addHandler API in-line with
SingleThreadedRPCEndpoint's.

This will be tested in an up-coming unit-test for MultiThreadedRPCEndpoint.

llvm-svn: 291376
This commit is contained in:
Lang Hames 2017-01-08 00:18:51 +00:00
parent 8fa6d8db9c
commit 184d5d720b
1 changed files with 9 additions and 0 deletions

View File

@ -1062,6 +1062,15 @@ public:
std::move(Launch));
}
/// Add a class-method as a handler.
template <typename Func, typename ClassT, typename RetT, typename... ArgTs>
void addHandler(ClassT &Object, RetT (ClassT::*Method)(ArgTs...),
LaunchPolicy Launch = LaunchPolicy()) {
addHandler<Func>(
detail::MemberFnWrapper<ClassT, RetT, ArgTs...>(Object, Method),
Launch);
}
/// Negotiate a function id for Func with the other end of the channel.
template <typename Func> Error negotiateFunction() {
using OrcRPCNegotiate = typename BaseClass::OrcRPCNegotiate;