DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Derive from this class to implement a single remote procedure call handled by this gRPC server gRPCModule
.
More...
#include <gRPCModule.h>
Static Public Member Functions | |
static void | MakeCall (const gRPCModule *const OwningModule, DynExp::ModuleInstance &Instance) |
Creates a new remote procedure call of this type which awaits requests from the client. | |
Private Types | |
using | ResponseWriterType = grpc::ServerAsyncResponseWriter< ResponseMessageType > |
Alias for the gRPC response writer which sends a message of type ResponseMessageType back to the client after the remote procedure call is handled. | |
using | RequestFuncType = std::function< void(typename gRPCService::AsyncService *, grpc::ServerContext *, RequestMessageType *, ResponseWriterType *, grpc::CompletionQueue *, grpc::ServerCompletionQueue *, void *)> |
Alias for the remote procedure call function implemented by this class as part of an asynchronous gRPC service. Refer to gRPC documentation. | |
Private Member Functions | |
TypedCallDataBase (const gRPCModule *const OwningModule, const RequestFuncType RequestFunc) noexcept | |
Constructs a TypedCallDataBase instance. | |
virtual | ~TypedCallDataBase ()=default |
void | InitChild (DynExp::ModuleInstance &Instance) override final |
Tells gRPC that this CallDataBase instance is ready to handle a respective (as determined by TypedCallDataBase ) remote procedure call. | |
void | ProcessChild (DynExp::ModuleInstance &Instance) override final |
Creates a new TypedCallDataBase instance of the same type to handle a further remote procedure call, handles this call by invoking TypedCallDataBase::ProcessChildImpl(), and sends the server's response back to the client. | |
Override | |
Override by derived classes. | |
virtual void | ProcessChildImpl (DynExp::ModuleInstance &Instance)=0 |
Override to implement the server's action to handle this remote procedure call. Particularly, populate gRPCModule::ResponseMessage with the server's responses. | |
Private Attributes | |
friend | DerivedType |
const RequestFuncType | RequestFunc |
Request function to register the remote procedure call derived from TypedCallDataBase with gRPC. | |
RequestMessageType | RequestMessage |
Client's message sent along with its invocation of this remote procedure call. | |
ResponseMessageType | ResponseMessage |
Response the server sends back to the client by finishing the remote procedure call. | |
ResponseWriterType | ResponseWriter |
gRPC response writer to send gRPCModule::ResponseMessage back to the client. Refer to gRPC documentation. | |
Additional Inherited Members | |
![]() | |
virtual | ~CallDataBase () |
auto | GetOwningModule () const noexcept |
Getter for the gRPC server this remote procedure call belongs to. | |
void | Proceed (DynExp::ModuleInstance &Instance) |
Calls the state function of the current state of CallDataBase::StateMachine by a call to Util::StateMachine::Invoke(). This function is called by gRPCModule::ModuleMainLoop() after the state of the remote procedure call as contained in gRPCModule::ServerQueue has changed. | |
![]() | |
CallDataBase (const gRPCModule *const OwningModule) noexcept | |
Constructs a CallDataBase instance. | |
auto * | GetServerContext () noexcept |
Getter for the gRPC server context. | |
Derive from this class to implement a single remote procedure call handled by this gRPC server gRPCModule
.
DerivedType | Type of the derived class (Curiously Recurring Template Pattern) |
gRPCService | Type of a service implemented by this gRPC server gRPCModule for which this class implements a remote procedure call |
RequestMessageType | Type of the gRPC message the client sends to this server |
ResponseMessageType | Type of the gRPC message this server sends back to the client |
enable_if_t | Ensures that gRPCService is contained in the gRPCServices template parameter of the class gRPCModule this TypedCallDataBase class belongs to. |
Definition at line 328 of file gRPCModule.h.
|
private |
Alias for the remote procedure call function implemented by this class as part of an asynchronous gRPC service. Refer to gRPC documentation.
Definition at line 353 of file gRPCModule.h.
|
private |
Alias for the gRPC response writer which sends a message of type ResponseMessageType
back to the client after the remote procedure call is handled.
Definition at line 347 of file gRPCModule.h.
|
inlineprivatenoexcept |
Constructs a TypedCallDataBase
instance.
OwningModule | gRPC server this remote procedure call belongs to |
RequestFunc | Remote procedure call function implemented by this class. This function is usually part of the < ServiceType > :: AsyncService gRPC namespace. |
Definition at line 362 of file gRPCModule.h.
|
privatevirtualdefault |
|
inlinefinaloverrideprivatevirtual |
Tells gRPC that this CallDataBase
instance is ready to handle a respective (as determined by TypedCallDataBase
) remote procedure call.
Instance | Handle to the server module thread's data |
Implements DynExpModule::gRPCModule< gRPCServices >::CallDataBase.
Definition at line 370 of file gRPCModule.h.
|
inlinestatic |
Creates a new remote procedure call of this type which awaits requests from the client.
OwningModule | gRPC server this remote procedure call belongs to |
Instance | Handle to the server module thread's data |
Definition at line 337 of file gRPCModule.h.
|
inlinefinaloverrideprivatevirtual |
Creates a new TypedCallDataBase
instance of the same type to handle a further remote procedure call, handles this call by invoking TypedCallDataBase::ProcessChildImpl(), and sends the server's response back to the client.
Instance | Handle to the server module thread's data |
Implements DynExpModule::gRPCModule< gRPCServices >::CallDataBase.
Definition at line 380 of file gRPCModule.h.
|
privatepure virtual |
Override to implement the server's action to handle this remote procedure call. Particularly, populate gRPCModule::ResponseMessage with the server's responses.
Instance | Handle to the server module thread's data |
|
private |
Definition at line 340 of file gRPCModule.h.
|
private |
Request function to register the remote procedure call derived from TypedCallDataBase
with gRPC.
Definition at line 401 of file gRPCModule.h.
|
private |
Client's message sent along with its invocation of this remote procedure call.
Definition at line 402 of file gRPCModule.h.
|
private |
Response the server sends back to the client by finishing the remote procedure call.
Definition at line 403 of file gRPCModule.h.
|
private |
gRPC response writer to send gRPCModule::ResponseMessage back to the client. Refer to gRPC documentation.
Definition at line 404 of file gRPCModule.h.