DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Base class for all TypedCallDataBase
classes. Instances of this class manage the state of a single remote procedure call.
More...
Public Member Functions | |
virtual | ~CallDataBase () |
auto | GetOwningModule () const noexcept |
Getter for the gRPC server this remote procedure call belongs to. More... | |
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. More... | |
Protected Member Functions | |
CallDataBase (const gRPCModule *const OwningModule) noexcept | |
Constructs a CallDataBase instance. More... | |
auto * | GetServerContext () noexcept |
Getter for the gRPC server context. More... | |
Private Types | |
enum class | StateType { Init , Process , Exit } |
Type defining the possible states of remote procedure calls as used by CallDataBase::StateMachine. More... | |
using | StateMachineStateType = Util::StateMachineState< StateType(CallDataBase::*)(DynExp::ModuleInstance &)> |
Alias for the state machine state type managed by CallDataBase::StateMachine. More... | |
Private Member Functions | |
StateType | InitStateFunc (DynExp::ModuleInstance &Instance) |
State function for the CallDataBase::InitState state. Calls InitChild() . More... | |
StateType | ProcessStateFunc (DynExp::ModuleInstance &Instance) |
State function for the CallDataBase::ProcessState state. Calls ProcessChild() . More... | |
StateType | ExitStateFunc (DynExp::ModuleInstance &Instance) |
State function for the CallDataBase::ExitState state. Deletes this instance. More... | |
Override | |
Overridden by | |
virtual void | InitChild (DynExp::ModuleInstance &Instance)=0 |
Tells gRPC that this CallDataBase instance is ready to handle a respective (as determined by TypedCallDataBase ) remote procedure call. More... | |
virtual void | ProcessChild (DynExp::ModuleInstance &Instance)=0 |
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. More... | |
Private Attributes | |
const gRPCModule *const | OwningModule |
gRPC server this remote procedure call belongs to More... | |
Util::StateMachine< StateMachineStateType > | StateMachine |
State machine based on the states listed in StateType to manage this remote procedure call's state. More... | |
grpc::ServerContext | ServerContext |
Information about the remote procedure call. Refer to gRPC documentation. More... | |
Static Private Attributes | |
static constexpr auto | InitState = Util::StateMachineState(StateType::Init, &CallDataBase::InitStateFunc) |
State machine state for the StateType::Init state. More... | |
static constexpr auto | ProcessState = Util::StateMachineState(StateType::Process, &CallDataBase::ProcessStateFunc) |
State machine state for the StateType::Process state. More... | |
static constexpr auto | ExitState = Util::StateMachineState(StateType::Exit, &CallDataBase::ExitStateFunc, "", true) |
State machine state for the StateType::Exit state. More... | |
Base class for all TypedCallDataBase
classes. Instances of this class manage the state of a single remote procedure call.
Definition at line 187 of file gRPCModule.h.
|
private |
Alias for the state machine state type managed by CallDataBase::StateMachine.
Definition at line 202 of file gRPCModule.h.
|
strongprivate |
Type defining the possible states of remote procedure calls as used by CallDataBase::StateMachine.
Definition at line 193 of file gRPCModule.h.
|
inlineprotectednoexcept |
Constructs a CallDataBase
instance.
OwningModule | gRPC server this remote procedure call belongs to |
Definition at line 209 of file gRPCModule.h.
|
inlinevirtual |
Definition at line 213 of file gRPCModule.h.
|
inlineprivate |
State function for the CallDataBase::ExitState state. Deletes this instance.
Instance | Handle to the server module thread's data |
Definition at line 288 of file gRPCModule.h.
|
inlinenoexcept |
Getter for the gRPC server this remote procedure call belongs to.
Definition at line 219 of file gRPCModule.h.
|
inlineprotectednoexcept |
Getter for the gRPC server context.
Definition at line 234 of file gRPCModule.h.
|
privatepure virtual |
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 |
Implemented in DynExpModule::gRPCModule< gRPCServices >::TypedCallDataBase< DerivedType, gRPCService, RequestMessageType, ResponseMessageType,... >.
|
inlineprivate |
State function for the CallDataBase::InitState state. Calls InitChild()
.
Instance | Handle to the server module thread's data |
Definition at line 263 of file gRPCModule.h.
|
inline |
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.
Instance | Handle to the server module thread's data |
Definition at line 227 of file gRPCModule.h.
|
privatepure virtual |
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 |
Implemented in DynExpModule::gRPCModule< gRPCServices >::TypedCallDataBase< DerivedType, gRPCService, RequestMessageType, ResponseMessageType,... >.
|
inlineprivate |
State function for the CallDataBase::ProcessState state. Calls ProcessChild()
.
Instance | Handle to the server module thread's data |
Definition at line 275 of file gRPCModule.h.
|
staticconstexprprivate |
State machine state for the StateType::Exit state.
Definition at line 308 of file gRPCModule.h.
|
staticconstexprprivate |
State machine state for the StateType::Init state.
Definition at line 298 of file gRPCModule.h.
|
private |
gRPC server this remote procedure call belongs to
Definition at line 310 of file gRPCModule.h.
|
staticconstexprprivate |
State machine state for the StateType::Process state.
Definition at line 303 of file gRPCModule.h.
|
private |
Information about the remote procedure call. Refer to gRPC documentation.
Definition at line 312 of file gRPCModule.h.
|
private |
State machine based on the states listed in StateType
to manage this remote procedure call's state.
Definition at line 311 of file gRPCModule.h.