diff options
Diffstat (limited to 'clients/grpc-sync.h')
-rw-r--r-- | clients/grpc-sync.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/clients/grpc-sync.h b/clients/grpc-sync.h new file mode 100644 index 0000000..caaee54 --- /dev/null +++ b/clients/grpc-sync.h @@ -0,0 +1,46 @@ +#pragma once + +#include <memory> + +#include <grpc/grpc.h> +#include <grpcpp/grpcpp.h> +#include <grpcpp/server.h> +#include <grpcpp/server_builder.h> +#include <grpcpp/server_context.h> + +#include <grpcpp/ext/proto_server_reflection_plugin.h> +#include <grpcpp/health_check_service_interface.h> + +#include "shell.h" +#include "agl_shell.grpc.pb.h" + +namespace { + const char kDefaultGrpcServiceAddress[] = "127.0.0.1:14005"; +} + + +class GrpcServiceImpl final : public agl_shell_ipc::AglShellManagerService::CallbackService { +public: + GrpcServiceImpl(Shell *aglShell) : m_aglShell(aglShell) {} + + grpc::ServerUnaryReactor *ActivateApp(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::ActivateRequest* request, + google::protobuf::Empty* /*response*/); + + grpc::ServerUnaryReactor *DeactivateApp(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::DeactivateRequest* request, + google::protobuf::Empty* /*response*/); + + grpc::ServerUnaryReactor *SetAppSplit(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::SplitRequest* request, + google::protobuf::Empty* /*response*/); + + grpc::ServerUnaryReactor *SetAppFloat(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::FloatRequest* request, + google::protobuf::Empty* /*response*/); + grpc::ServerUnaryReactor *AppStatusState(grpc::CallbackServerContext *context, + google::protobuf::Empty *empty, + ::grpc::ServerWriter<::agl_shell_ipc::AppState>* writer); +private: + Shell *m_aglShell; +}; |