Derecho  0.9
Distributed systems toolkit for RDMA
Public Types | Public Member Functions | Public Attributes | List of all members
derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns > Class Template Reference

Transforms a class into a "replicated object" with methods that can be invoked by RPC, given a place to store RPC message handlers (which should be the "receivers map" of RPCManager). More...

#include <remote_invocable.hpp>

Inheritance diagram for derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >:
Inheritance graph
[legend]
Collaboration diagram for derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >:
Collaboration graph
[legend]

Public Types

using specialized_to = IdentifyingClass
 

Public Member Functions

 RemoteInvocableClass (node_id_t nid, uint32_t type_id, uint32_t instance_id, std::map< Opcode, receive_fun_t > &rvrs, const WrappedFuns &... fs)
 
template<FunctionTag Tag, typename... Args>
std::size_t get_size_for_ordered_send (Args &&... a)
 
template<FunctionTag Tag, typename... Args>
auto * getReturnType (Args &&... args)
 
template<FunctionTag Tag, typename... Args>
auto send (const std::function< char *(int)> &out_alloc, Args &&... args)
 Constructs a message that will remotely invoke a method of this class, supplying the specified arguments, using RPC. More...
 
RemoteInvocableClassfor_class (IdentifyingClass *)
 

Public Attributes

const node_id_t nid
 

Detailed Description

template<class IdentifyingClass, typename... WrappedFuns>
class derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >

Transforms a class into a "replicated object" with methods that can be invoked by RPC, given a place to store RPC message handlers (which should be the "receivers map" of RPCManager).

Each RPC-invokable method must be supplied as a template parameter, in order to associate it with a compile-time constant name (the tag).

Template Parameters
IdentifyingClassThe class to make into an RPC-invokable class
FsA list of "wrapped" function pointers to members of that class, each associated with a tag.

Definition at line 587 of file remote_invocable.hpp.

Member Typedef Documentation

◆ specialized_to

template<class IdentifyingClass , typename... WrappedFuns>
using derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::specialized_to = IdentifyingClass

Definition at line 678 of file remote_invocable.hpp.

Constructor & Destructor Documentation

◆ RemoteInvocableClass()

template<class IdentifyingClass , typename... WrappedFuns>
derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::RemoteInvocableClass ( node_id_t  nid,
uint32_t  type_id,
uint32_t  instance_id,
std::map< Opcode, receive_fun_t > &  rvrs,
const WrappedFuns &...  fs 
)
inline

Definition at line 591 of file remote_invocable.hpp.

Member Function Documentation

◆ for_class()

template<class IdentifyingClass , typename... WrappedFuns>
RemoteInvocableClass& derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::for_class ( IdentifyingClass *  )
inline

Definition at line 679 of file remote_invocable.hpp.

◆ get_size_for_ordered_send()

template<class IdentifyingClass , typename... WrappedFuns>
template<FunctionTag Tag, typename... Args>
std::size_t derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::get_size_for_ordered_send ( Args &&...  a)
inline

Definition at line 597 of file remote_invocable.hpp.

◆ getReturnType()

template<class IdentifyingClass , typename... WrappedFuns>
template<FunctionTag Tag, typename... Args>
auto* derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::getReturnType ( Args &&...  args)
inline

Definition at line 609 of file remote_invocable.hpp.

◆ send()

template<class IdentifyingClass , typename... WrappedFuns>
template<FunctionTag Tag, typename... Args>
auto derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::send ( const std::function< char *(int)> &  out_alloc,
Args &&...  args 
)
inline

Constructs a message that will remotely invoke a method of this class, supplying the specified arguments, using RPC.

Parameters
out_allocA function that can allocate a buffer for the message
argsThe arguments that should be given to the method when invoking it
Returns
A struct containing a set of futures for the remote-method results ("results"), and a set of corresponding promises for those results ("pending").

Definition at line 625 of file remote_invocable.hpp.

Member Data Documentation

◆ nid

template<class IdentifyingClass , typename... WrappedFuns>
const node_id_t derecho::rpc::RemoteInvocableClass< IdentifyingClass, WrappedFuns >::nid

Definition at line 589 of file remote_invocable.hpp.


The documentation for this class was generated from the following file: