2019-05-20 06:21:02 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 <grpcpp/grpcpp.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2019-05-27 00:29:20 -05:00
|
|
|
class RiaGrpcCallbackInterface;
|
2019-05-20 06:21:02 -05:00
|
|
|
|
2019-06-10 13:42:20 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
2020-01-17 03:35:42 -06:00
|
|
|
class PdmChildArrayFieldHandle;
|
|
|
|
class PdmChildFieldHandle;
|
2020-03-10 08:11:22 -05:00
|
|
|
class PdmFieldHandle;
|
2019-06-10 13:42:20 -05:00
|
|
|
class PdmObject;
|
2020-01-17 03:35:42 -06:00
|
|
|
class PdmObjectHandle;
|
2021-10-24 03:21:17 -05:00
|
|
|
class PdmScriptIOMessages;
|
2019-09-06 03:40:57 -05:00
|
|
|
} // namespace caf
|
2019-06-10 13:42:20 -05:00
|
|
|
|
|
|
|
namespace rips
|
|
|
|
{
|
|
|
|
class PdmObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
class QString;
|
2020-01-21 04:08:09 -06:00
|
|
|
class QVariant;
|
2019-06-10 13:42:20 -05:00
|
|
|
|
2019-05-20 06:21:02 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
// gRPC-service interface which all gRPC-services has to implement
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RiaGrpcServiceInterface
|
|
|
|
{
|
|
|
|
public:
|
2019-05-27 00:29:20 -05:00
|
|
|
virtual std::vector<RiaGrpcCallbackInterface*> createCallbacks() = 0;
|
2019-09-06 03:40:57 -05:00
|
|
|
virtual ~RiaGrpcServiceInterface() = default;
|
2019-06-10 13:42:20 -05:00
|
|
|
|
2024-01-29 01:46:45 -06:00
|
|
|
protected:
|
2020-01-17 03:35:42 -06:00
|
|
|
static void copyPdmObjectFromCafToRips( const caf::PdmObjectHandle* source, rips::PdmObject* destination );
|
|
|
|
static void copyPdmObjectFromRipsToCaf( const rips::PdmObject* source, caf::PdmObjectHandle* destination );
|
2019-06-10 13:42:20 -05:00
|
|
|
|
2021-06-25 07:18:36 -05:00
|
|
|
static caf::PdmObjectHandle*
|
|
|
|
emplaceChildField( caf::PdmObject* parent, const QString& fieldKeyword, const QString& keywordForClassToCreate );
|
2020-01-17 03:35:42 -06:00
|
|
|
|
2021-06-25 07:18:36 -05:00
|
|
|
static caf::PdmObjectHandle* emplaceChildField( caf::PdmChildFieldHandle* childField,
|
|
|
|
const QString& keywordForClassToCreate );
|
|
|
|
static caf::PdmObjectHandle* emplaceChildArrayField( caf::PdmChildArrayFieldHandle* childArrayField,
|
|
|
|
const QString& keywordForClassToCreate );
|
2024-01-29 01:46:45 -06:00
|
|
|
|
|
|
|
static bool assignFieldValue( const QString& stringValue,
|
|
|
|
caf::PdmFieldHandle* field,
|
|
|
|
QVariant* oldValue,
|
|
|
|
QVariant* newValue,
|
|
|
|
caf::PdmScriptIOMessages* messages );
|
2019-05-20 06:21:02 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#include "cafFactory.h"
|
2024-01-29 01:46:45 -06:00
|
|
|
using RiaGrpcServiceFactory = caf::Factory<RiaGrpcServiceInterface, size_t>;
|