aboutsummaryrefslogtreecommitdiffstats
path: root/fnet/src/vespa/fnet/frt/invokable.h
blob: 7afa0aba6a0ad4ff2e7bb7a987cc6d36f42b1d56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

class FRT_RPCRequest;

class FRT_Invokable
{
public:
    virtual ~FRT_Invokable() = default;
};

typedef void (FRT_Invokable::*FRT_METHOD_PT)(FRT_RPCRequest *);

namespace fnet::internal {

template <class T>
using frt_method_precast_pt = void (T::*)(FRT_RPCRequest *);

template <class T>
FRT_METHOD_PT
frt_method_pt_cast(frt_method_precast_pt<T> pt)
{
  return (FRT_METHOD_PT) pt;
}

}

#define FRT_METHOD(pt) (fnet::internal::frt_method_pt_cast(&pt))