Provides functions to implement handling RPC calls to a single function, identified by its compile-time "tag" or opcode. More...
#include <remote_invocable.hpp>
Public Types | |
using | remote_function_type = std::function< Ret(Args...)> |
Public Member Functions | |
RemoteInvocable & | get_handler (std::integral_constant< FunctionTag, Tag > const *const, const Args &...) |
recv_ret | receive_call (std::false_type const *const, mutils::DeserializationManager *dsm, const node_id_t &caller, const char *_recv_buf, const std::function< char *(int)> &out_alloc) |
Specialization of receive_call for non-void functions. More... | |
recv_ret | receive_call (std::true_type const *const, mutils::DeserializationManager *dsm, const node_id_t &, const char *_recv_buf, const std::function< char *(int)> &) |
Specialization of receive_call for void functions, which do not need to send a response. More... | |
recv_ret | receive_call (mutils::RemoteDeserialization_v *rdv, const node_id_t &who, const char *recv_buf, const std::function< char *(int)> &out_alloc) |
Entry point for handling an RPC function call to this RemoteInvocable function. More... | |
RemoteInvocable (uint32_t class_id, uint32_t instance_id, std::map< Opcode, receive_fun_t > &receivers, std::function< Ret(Args...)> f) | |
Constructs a RemoteInvocable that provides RPC call handling for a specific function, and registers the RPC-handling functions in the given "receivers" map. More... | |
Public Attributes | |
const remote_function_type | remote_invocable_function |
const Opcode | invoke_opcode |
const Opcode | reply_opcode |
Provides functions to implement handling RPC calls to a single function, identified by its compile-time "tag" or opcode.
Many versions of this class will be extended by a single RemoteInvocableClass; each specific instance of this class provides a mechanism for handling RPC requests for one particular function.
tag | The compile-time value associated with this function |
Ret | The function's return type |
Args | The function's argument types |
Definition at line 267 of file remote_invocable.hpp.
using derecho::rpc::RemoteInvocable< Tag, std::function< Ret(Args...)> >::remote_function_type = std::function<Ret(Args...)> |
Definition at line 268 of file remote_invocable.hpp.
|
inline |
Constructs a RemoteInvocable that provides RPC call handling for a specific function, and registers the RPC-handling functions in the given "receivers" map.
receivers | A map from RPC message opcodes to handler functions, which this RemoteInvocable should add its functions to. |
f | The actual function that should be called when an RPC call arrives. |
Definition at line 356 of file remote_invocable.hpp.
|
inline |
Definition at line 276 of file remote_invocable.hpp.
|
inline |
Specialization of receive_call for non-void functions.
After calling the function locally, it constructs a message containing the return value to send as a response, and puts it in a buffer allocated by out_alloc. If the function throws an exception, it catches the exception and puts that in the response message instead.
Definition at line 289 of file remote_invocable.hpp.
|
inline |
Specialization of receive_call for void functions, which do not need to send a response.
Simply calls the function and returns a trivial result.
Definition at line 317 of file remote_invocable.hpp.
|
inline |
Entry point for handling an RPC function call to this RemoteInvocable function.
Called when a message is received that contains a request to call this function.
dsm | |
who | The node that sent the message |
recv_buf | The buffer containing the received message |
out_alloc | A function that can allocate a buffer for the response message |
Definition at line 337 of file remote_invocable.hpp.
const Opcode derecho::rpc::RemoteInvocable< Tag, std::function< Ret(Args...)> >::invoke_opcode |
Definition at line 270 of file remote_invocable.hpp.
const remote_function_type derecho::rpc::RemoteInvocable< Tag, std::function< Ret(Args...)> >::remote_invocable_function |
Definition at line 269 of file remote_invocable.hpp.
const Opcode derecho::rpc::RemoteInvocable< Tag, std::function< Ret(Args...)> >::reply_opcode |
Definition at line 271 of file remote_invocable.hpp.