#4429 Implement return values from the gRPC Command execution

This commit is contained in:
Gaute Lindkvist
2019-05-23 16:46:50 +02:00
parent 650af20e06
commit cc031e7895
10 changed files with 185 additions and 43 deletions

View File

@@ -24,14 +24,10 @@
#include <grpcpp/grpcpp.h>
#include <vector>
namespace rips
{
class Empty;
}
namespace caf
{
class PdmValueField;
class PdmObject;
}
namespace google
@@ -48,11 +44,15 @@ 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;
grpc::Status Execute(grpc::ServerContext* context, const rips::CommandParams* request, rips::CommandReply* reply) override;
std::vector<RiaAbstractGrpcCallback*> createCallbacks() override;
private:
void assignFieldValue(caf::PdmValueField* pdmValueField,
const google::protobuf::Message& params,
const google::protobuf::FieldDescriptor* paramDescriptor);
void assignPdmFieldValue(caf::PdmValueField* pdmValueField,
const google::protobuf::Message& params,
const google::protobuf::FieldDescriptor* paramDescriptor);
void assignGrpcFieldValue(google::protobuf::Message* reply,
const google::protobuf::FieldDescriptor* fieldDescriptor,
const caf::PdmValueField* pdmValueField);
void assignResultToReply(const caf::PdmObject* result, rips::CommandReply* reply);
};