Derecho  0.9
Distributed systems toolkit for RDMA
Macros
register_rpc_functions.hpp File Reference
#include "detail/rpc_utils.hpp"
#include <mutils/macro_utils.hpp>
#include <tuple>
Include dependency graph for register_rpc_functions.hpp:

Go to the source code of this file.

Macros

#define REGISTER_RPC_FUNCTIONS2(classname, a)
 This is an automatically-generated file that makes it easier for user-created Replicated Objects to register their RPC methods with Derecho by defining some macros. More...
 
#define REGISTER_RPC_FUNCTIONS3(classname, a, b)
 
#define REGISTER_RPC_FUNCTIONS4(classname, a, b, c)
 
#define REGISTER_RPC_FUNCTIONS5(classname, a, b, c, d)
 
#define REGISTER_RPC_FUNCTIONS6(classname, a, b, c, d, e)
 
#define REGISTER_RPC_FUNCTIONS7(classname, a, b, c, d, e, f)
 
#define REGISTER_RPC_FUNCTIONS8(classname, a, b, c, d, e, f, g)
 
#define REGISTER_RPC_FUNCTIONS9(classname, a, b, c, d, e, f, g, h)
 
#define REGISTER_RPC_FUNCTIONS10(classname, a, b, c, d, e, f, g, h, i)
 
#define REGISTER_RPC_FUNCTIONS11(classname, a, b, c, d, e, f, g, h, i, j)
 
#define REGISTER_RPC_FUNCTIONS12(classname, a, b, c, d, e, f, g, h, i, j, k)
 
#define REGISTER_RPC_FUNCTIONS13(classname, a, b, c, d, e, f, g, h, i, j, k, l)
 
#define REGISTER_RPC_FUNCTIONS14(classname, a, b, c, d, e, f, g, h, i, j, k, l, m)
 
#define REGISTER_RPC_FUNCTIONS15(classname, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
 
#define REGISTER_RPC_FUNCTIONS16(classname, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
 
#define REGISTER_RPC_FUNCTIONS_IMPL2(count, ...)   REGISTER_RPC_FUNCTIONS##count(__VA_ARGS__)
 
#define REGISTER_RPC_FUNCTIONS_IMPL(count, ...)   REGISTER_RPC_FUNCTIONS_IMPL2(count, __VA_ARGS__)
 
#define REGISTER_RPC_FUNCTIONS(...)   REGISTER_RPC_FUNCTIONS_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)
 This macro automatically generates a register_functions() method for a Derecho Replicated Object, given the name of the class and the names of each method that should be RPC-callable. More...
 
#define RPC_NAME(...)
 This macro generates the Derecho-registered name of an RPC function, for use in the template parameter of ordered_send (and other RPC callers), given the name of the corresponding Replicated Object method. More...
 

Macro Definition Documentation

◆ REGISTER_RPC_FUNCTIONS

#define REGISTER_RPC_FUNCTIONS (   ...)    REGISTER_RPC_FUNCTIONS_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)

This macro automatically generates a register_functions() method for a Derecho Replicated Object, given the name of the class and the names of each method that should be RPC-callable.

For example, if you have a class Thing with methods foo() and bar(), put this inside your class definition (in the public section):

REGISTER_RPC_FUNCTIONS(Thing, foo, bar);

Definition at line 192 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS10

#define REGISTER_RPC_FUNCTIONS10 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 74 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS11

#define REGISTER_RPC_FUNCTIONS11 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 86 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS12

#define REGISTER_RPC_FUNCTIONS12 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j), \
derecho::rpc::tag<CT_STRING(k)::hash()>(&classname::k)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 99 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS13

#define REGISTER_RPC_FUNCTIONS13 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j), \
derecho::rpc::tag<CT_STRING(k)::hash()>(&classname::k), \
derecho::rpc::tag<CT_STRING(l)::hash()>(&classname::l)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 113 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS14

#define REGISTER_RPC_FUNCTIONS14 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j), \
derecho::rpc::tag<CT_STRING(k)::hash()>(&classname::k), \
derecho::rpc::tag<CT_STRING(l)::hash()>(&classname::l), \
derecho::rpc::tag<CT_STRING(m)::hash()>(&classname::m)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 128 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS15

#define REGISTER_RPC_FUNCTIONS15 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
  m,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j), \
derecho::rpc::tag<CT_STRING(k)::hash()>(&classname::k), \
derecho::rpc::tag<CT_STRING(l)::hash()>(&classname::l), \
derecho::rpc::tag<CT_STRING(m)::hash()>(&classname::m), \
derecho::rpc::tag<CT_STRING(n)::hash()>(&classname::n)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 144 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS16

#define REGISTER_RPC_FUNCTIONS16 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
  m,
  n,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h), \
derecho::rpc::tag<CT_STRING(i)::hash()>(&classname::i), \
derecho::rpc::tag<CT_STRING(j)::hash()>(&classname::j), \
derecho::rpc::tag<CT_STRING(k)::hash()>(&classname::k), \
derecho::rpc::tag<CT_STRING(l)::hash()>(&classname::l), \
derecho::rpc::tag<CT_STRING(m)::hash()>(&classname::m), \
derecho::rpc::tag<CT_STRING(n)::hash()>(&classname::n), \
derecho::rpc::tag<CT_STRING(o)::hash()>(&classname::o)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 161 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS2

#define REGISTER_RPC_FUNCTIONS2 (   classname,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

This is an automatically-generated file that makes it easier for user-created Replicated Objects to register their RPC methods with Derecho by defining some macros.

Do not edit this file by hand; you should generate it with generate_register_functions.py The public interface is at the bottom of the file.

Definition at line 14 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS3

#define REGISTER_RPC_FUNCTIONS3 (   classname,
  a,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 18 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS4

#define REGISTER_RPC_FUNCTIONS4 (   classname,
  a,
  b,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 23 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS5

#define REGISTER_RPC_FUNCTIONS5 (   classname,
  a,
  b,
  c,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 29 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS6

#define REGISTER_RPC_FUNCTIONS6 (   classname,
  a,
  b,
  c,
  d,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 36 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS7

#define REGISTER_RPC_FUNCTIONS7 (   classname,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 44 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS8

#define REGISTER_RPC_FUNCTIONS8 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 53 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS9

#define REGISTER_RPC_FUNCTIONS9 (   classname,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
static auto register_functions() { \
return std::make_tuple(derecho::rpc::tag<CT_STRING(a)::hash()>(&classname::a), \
derecho::rpc::tag<CT_STRING(b)::hash()>(&classname::b), \
derecho::rpc::tag<CT_STRING(c)::hash()>(&classname::c), \
derecho::rpc::tag<CT_STRING(d)::hash()>(&classname::d), \
derecho::rpc::tag<CT_STRING(e)::hash()>(&classname::e), \
derecho::rpc::tag<CT_STRING(f)::hash()>(&classname::f), \
derecho::rpc::tag<CT_STRING(g)::hash()>(&classname::g), \
derecho::rpc::tag<CT_STRING(h)::hash()>(&classname::h)); \
}
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class&#39;s member func...
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

Definition at line 63 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS_IMPL

#define REGISTER_RPC_FUNCTIONS_IMPL (   count,
  ... 
)    REGISTER_RPC_FUNCTIONS_IMPL2(count, __VA_ARGS__)

Definition at line 181 of file register_rpc_functions.hpp.

◆ REGISTER_RPC_FUNCTIONS_IMPL2

#define REGISTER_RPC_FUNCTIONS_IMPL2 (   count,
  ... 
)    REGISTER_RPC_FUNCTIONS##count(__VA_ARGS__)

Definition at line 180 of file register_rpc_functions.hpp.

◆ RPC_NAME

#define RPC_NAME (   ...)
Value:
CT_STRING(__VA_ARGS__) \
::hash()
#define CT_STRING(...)
Definition: rpc_utils.hpp:595

This macro generates the Derecho-registered name of an RPC function, for use in the template parameter of ordered_send (and other RPC callers), given the name of the corresponding Replicated Object method.

For example, if you have a Replicated<Thing> reference named thing_handle, call its registered RPC method foo() like this:

thing_handle.ordered_send<RPC_NAME(foo)>(foo_args);

Definition at line 203 of file register_rpc_functions.hpp.