Add more grpc - Asyncstuff
[src/agl-compositor.git] / clients / grpc-sync.h
1 #pragma once
2
3 #include <memory>
4
5 #include <grpc/grpc.h>
6 #include <grpcpp/grpcpp.h>
7 #include <grpcpp/server.h>
8 #include <grpcpp/server_builder.h>
9 #include <grpcpp/server_context.h>
10
11 #include <grpcpp/ext/proto_server_reflection_plugin.h>
12 #include <grpcpp/health_check_service_interface.h>
13
14 #include "shell.h"
15 #include "agl_shell.grpc.pb.h"
16
17 namespace {
18        const char kDefaultGrpcServiceAddress[] = "127.0.0.1:14005";
19 }
20
21
22 class GrpcServiceImpl final : public agl_shell_ipc::AglShellManagerService::CallbackService {
23 public:
24         GrpcServiceImpl(Shell *aglShell) : m_aglShell(aglShell) {}
25
26         grpc::ServerUnaryReactor *ActivateApp(grpc::CallbackServerContext *context,
27                         const ::agl_shell_ipc::ActivateRequest* request,
28                         google::protobuf::Empty* /*response*/);
29
30         grpc::ServerUnaryReactor *DeactivateApp(grpc::CallbackServerContext *context,
31                         const ::agl_shell_ipc::DeactivateRequest* request,
32                         google::protobuf::Empty* /*response*/);
33
34         grpc::ServerUnaryReactor *SetAppSplit(grpc::CallbackServerContext *context,
35                         const ::agl_shell_ipc::SplitRequest* request,
36                         google::protobuf::Empty* /*response*/);
37
38         grpc::ServerUnaryReactor *SetAppFloat(grpc::CallbackServerContext *context,
39                         const ::agl_shell_ipc::FloatRequest* request,
40                         google::protobuf::Empty* /*response*/);
41         grpc::ServerUnaryReactor *AppStatusState(grpc::CallbackServerContext *context,
42                         google::protobuf::Empty *empty,
43                         ::grpc::ServerWriter<::agl_shell_ipc::AppState>* writer);
44 private:
45        Shell *m_aglShell;
46 };