![]() |
Blue Brain BioExplorer
|
#include <ActionInterface.h>
Public Member Functions | |
virtual | ~ActionInterface ()=default |
virtual void | registerNotification (const RpcDescription &desc, const std::function< void()> &action)=0 |
virtual void | registerNotification (const RpcParameterDescription &desc, const PropertyMap &input, const std::function< void(PropertyMap)> &action)=0 |
virtual void | registerRequest (const RpcParameterDescription &desc, const PropertyMap &input, const PropertyMap &output, const std::function< PropertyMap(PropertyMap)> &action)=0 |
virtual void | registerRequest (const RpcDescription &desc, const PropertyMap &output, const std::function< PropertyMap()> &action)=0 |
void | registerNotification (const std::string &name, const std::function< void()> &action) |
template<typename Params > | |
void | registerNotification (const std::string &name, const std::function< void(Params)> &action) |
template<typename Params , typename RetVal > | |
void | registerRequest (const std::string &name, const std::function< RetVal(Params)> &action) |
template<typename RetVal > | |
void | registerRequest (const std::string &name, const std::function< RetVal()> &action) |
Protected Types | |
using | RetParamFunc = std::function< std::string(std::string)> |
using | RetFunc = std::function< std::string()> |
using | ParamFunc = std::function< void(std::string)> |
using | VoidFunc = std::function< void()> |
Interface for registering actions, namely notifications which have no return values with an optional parameter, and requests which return a value after processing.
The encoding of the parameter and return value is restricted to JSON.
The parameters object must be deserializable by a free function:
The return type must be serializable by a free function:
Definition at line 48 of file ActionInterface.h.
|
protected |
Definition at line 137 of file ActionInterface.h.
|
protected |
Definition at line 136 of file ActionInterface.h.
|
protected |
Definition at line 135 of file ActionInterface.h.
|
protected |
Definition at line 138 of file ActionInterface.h.
|
virtualdefault |
|
pure virtual |
Register an action with no parameter and no return value.
desc | description of the action/RPC |
action | the action to perform on an incoming notification |
Implemented in core::RocketsPlugin::Impl.
|
pure virtual |
Register an action with a property map as the parameter and no return value.
desc | description of the action/RPC |
input | the acceptable property map as the parameter for the RPC |
action | the action to perform on an incoming notification |
Implemented in core::RocketsPlugin::Impl.
|
inline |
Register an action with no parameter and no return value.
Definition at line 98 of file ActionInterface.h.
|
inline |
Register an action with a parameter and no return value.
Definition at line 105 of file ActionInterface.h.
|
pure virtual |
Register an action with no parameter and a property map as the return value.
desc | description of the action/RPC |
output | the property map layout that is returned on a successful request |
action | the action to perform on an incoming request |
Implemented in core::RocketsPlugin::Impl.
|
pure virtual |
Register an action with a property map as the parameter and a property map as the return value.
desc | description of the action/RPC |
input | the acceptable property map as the parameter for the RPC |
output | the property map layout that is returned on a successful request |
action | the action to perform on an incoming request |
Implemented in core::RocketsPlugin::Impl.
|
inline |
Register an action with no parameter and a return value.
Definition at line 129 of file ActionInterface.h.
|
inline |
Register an action with a parameter and a return value.
Definition at line 117 of file ActionInterface.h.