2 #include <grpcpp/grpcpp.h>
3 #include <grpcpp/server.h>
4 #include <grpcpp/server_builder.h>
5 #include <grpcpp/server_context.h>
7 #include <grpcpp/ext/proto_server_reflection_plugin.h>
8 #include <grpcpp/health_check_service_interface.h>
10 #include "agl_shell.grpc.pb.h"
11 #include "agl-shell-client-protocol.h"
14 const char kDefaultGrpcServiceAddress[] = "127.0.0.1:14005";
18 class GrpcServiceImpl final : public agl_shell_ipc::AglShellManagerService::CallbackService {
20 grpc::ServerUnaryReactor *ActivateApp(grpc::CallbackServerContext *context,
21 const ::agl_shell_ipc::ActivateRequest* request,
22 google::protobuf::Empty* /*response*/);
24 grpc::ServerUnaryReactor *DeactivateApp(grpc::CallbackServerContext *context,
25 const ::agl_shell_ipc::DeactivateRequest* request,
26 google::protobuf::Empty* /*response*/);
28 grpc::ServerUnaryReactor *SetAppSplit(grpc::CallbackServerContext *context,
29 const ::agl_shell_ipc::SplitRequest* request,
30 google::protobuf::Empty* /*response*/);
32 grpc::ServerUnaryReactor *SetAppFloat(grpc::CallbackServerContext *context,
33 const ::agl_shell_ipc::FloatRequest* request,
34 google::protobuf::Empty* /*response*/);
40 std::shared_ptr<struct agl_shell> m_shell;
41 Shell(std::shared_ptr<struct agl_shell> shell) : m_shell(shell) { }
42 void ActivateApp(const std::string &app_id, const std::string &output_name);
43 void DeactivateApp(const std::string &app_id);
44 void SetAppSplit(const std::string &app_id, uint32_t orientation);
45 void SetAppFloat(const std::string &app_id);