ResInsight/ApplicationCode/GrpcInterface/RiaGrpcCommandService.h
Gaute Lindkvist 922386c673
#4416 First implementation of gRPC-based Python interface
First implementation with Asynchronous gRPC server, a few services and some client python code.
2019-05-20 13:21:02 +02:00

59 lines
1.6 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
//////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaGrpcServiceInterface.h"
#include "Commands.grpc.pb.h"
#include <grpcpp/grpcpp.h>
#include <vector>
namespace rips
{
class Empty;
}
namespace caf
{
class PdmValueField;
}
namespace google
{
namespace protobuf
{
class FieldDescriptor;
class Message;
} // namespace protobuf
} // namespace google
class RiaAbstractGrpcCallback;
class RiaGrpcCommandService : public rips::Commands::AsyncService, public RiaGrpcServiceInterface
{
public:
grpc::Status Execute(grpc::ServerContext* context, const rips::CommandParams* request, rips::Empty* reply) override;
std::vector<RiaAbstractGrpcCallback*> createCallbacks() override;
private:
void assignFieldValue(caf::PdmValueField* pdmValueField,
const google::protobuf::Message& params,
const google::protobuf::FieldDescriptor* paramDescriptor);
};