Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 1 | // Generated by the gRPC C++ plugin. |
| 2 | // If you make any local change, they will be lost. |
| 3 | // source: dmi/hw_metrics_mgmt_service.proto |
| 4 | #ifndef GRPC_dmi_2fhw_5fmetrics_5fmgmt_5fservice_2eproto__INCLUDED |
| 5 | #define GRPC_dmi_2fhw_5fmetrics_5fmgmt_5fservice_2eproto__INCLUDED |
| 6 | |
| 7 | #include "dmi/hw_metrics_mgmt_service.pb.h" |
| 8 | |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 9 | #include <functional> |
| 10 | #include <grpc/impl/codegen/port_platform.h> |
| 11 | #include <grpcpp/impl/codegen/async_generic_service.h> |
| 12 | #include <grpcpp/impl/codegen/async_stream.h> |
| 13 | #include <grpcpp/impl/codegen/async_unary_call.h> |
| 14 | #include <grpcpp/impl/codegen/client_callback.h> |
| 15 | #include <grpcpp/impl/codegen/client_context.h> |
| 16 | #include <grpcpp/impl/codegen/completion_queue.h> |
| 17 | #include <grpcpp/impl/codegen/message_allocator.h> |
| 18 | #include <grpcpp/impl/codegen/method_handler.h> |
| 19 | #include <grpcpp/impl/codegen/proto_utils.h> |
| 20 | #include <grpcpp/impl/codegen/rpc_method.h> |
| 21 | #include <grpcpp/impl/codegen/server_callback.h> |
| 22 | #include <grpcpp/impl/codegen/server_callback_handlers.h> |
| 23 | #include <grpcpp/impl/codegen/server_context.h> |
| 24 | #include <grpcpp/impl/codegen/service_type.h> |
| 25 | #include <grpcpp/impl/codegen/status.h> |
| 26 | #include <grpcpp/impl/codegen/stub_options.h> |
| 27 | #include <grpcpp/impl/codegen/sync_stream.h> |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 28 | |
| 29 | namespace dmi { |
| 30 | |
| 31 | class NativeMetricsManagementService final { |
| 32 | public: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 33 | static constexpr char const* service_full_name() { |
| 34 | return "dmi.NativeMetricsManagementService"; |
| 35 | } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 36 | class StubInterface { |
| 37 | public: |
| 38 | virtual ~StubInterface() {} |
| 39 | // List the supported metrics for the passed device.
|
| 40 | // This would be the first call that you make to know about the metrics that a particular device supports and
|
| 41 | // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 42 | virtual ::grpc::Status ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::dmi::ListMetricsResponse* response) = 0; |
| 43 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>> AsyncListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) { |
| 44 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>>(AsyncListMetricsRaw(context, request, cq)); |
| 45 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 46 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>> PrepareAsyncListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) { |
| 47 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>>(PrepareAsyncListMetricsRaw(context, request, cq)); |
| 48 | } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 49 | // Updates the configuration of the list of metrics in the request
|
| 50 | // Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 51 | // by changing its configuration.
|
| 52 | //
|
| 53 | // This configuration is persisted across restart of the device or the device manager
|
| 54 | virtual ::grpc::Status UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::dmi::MetricsConfigurationResponse* response) = 0; |
| 55 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>> AsyncUpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) { |
| 56 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>>(AsyncUpdateMetricsConfigurationRaw(context, request, cq)); |
| 57 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 58 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>> PrepareAsyncUpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) { |
| 59 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>>(PrepareAsyncUpdateMetricsConfigurationRaw(context, request, cq)); |
| 60 | } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 61 | // Get the instantenous value of a metric
|
| 62 | virtual ::grpc::Status GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::dmi::GetMetricResponse* response) = 0; |
| 63 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>> AsyncGetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) { |
| 64 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>>(AsyncGetMetricRaw(context, request, cq)); |
| 65 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 66 | std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>> PrepareAsyncGetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) { |
| 67 | return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>>(PrepareAsyncGetMetricRaw(context, request, cq)); |
| 68 | } |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 69 | // Initiate the server streaming of the metrics
|
| 70 | std::unique_ptr< ::grpc::ClientReaderInterface< ::dmi::Metric>> StreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request) { |
| 71 | return std::unique_ptr< ::grpc::ClientReaderInterface< ::dmi::Metric>>(StreamMetricsRaw(context, request)); |
| 72 | } |
| 73 | std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>> AsyncStreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq, void* tag) { |
| 74 | return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>>(AsyncStreamMetricsRaw(context, request, cq, tag)); |
| 75 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 76 | std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>> PrepareAsyncStreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { |
| 77 | return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>>(PrepareAsyncStreamMetricsRaw(context, request, cq)); |
| 78 | } |
| 79 | class experimental_async_interface { |
| 80 | public: |
| 81 | virtual ~experimental_async_interface() {} |
| 82 | // List the supported metrics for the passed device.
|
| 83 | // This would be the first call that you make to know about the metrics that a particular device supports and
|
| 84 | // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 85 | virtual void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 86 | virtual void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 87 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 88 | virtual void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 89 | #else |
| 90 | virtual void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 91 | #endif |
| 92 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 93 | virtual void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 94 | #else |
| 95 | virtual void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 96 | #endif |
| 97 | // Updates the configuration of the list of metrics in the request
|
| 98 | // Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 99 | // by changing its configuration.
|
| 100 | //
|
| 101 | // This configuration is persisted across restart of the device or the device manager
|
| 102 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 103 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 104 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 105 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 106 | #else |
| 107 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 108 | #endif |
| 109 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 110 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 111 | #else |
| 112 | virtual void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 113 | #endif |
| 114 | // Get the instantenous value of a metric
|
| 115 | virtual void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 116 | virtual void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, std::function<void(::grpc::Status)>) = 0; |
| 117 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 118 | virtual void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 119 | #else |
| 120 | virtual void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 121 | #endif |
| 122 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 123 | virtual void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
| 124 | #else |
| 125 | virtual void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
| 126 | #endif |
| 127 | // Initiate the server streaming of the metrics
|
| 128 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 129 | virtual void StreamMetrics(::grpc::ClientContext* context, ::google::protobuf::Empty* request, ::grpc::ClientReadReactor< ::dmi::Metric>* reactor) = 0; |
| 130 | #else |
| 131 | virtual void StreamMetrics(::grpc::ClientContext* context, ::google::protobuf::Empty* request, ::grpc::experimental::ClientReadReactor< ::dmi::Metric>* reactor) = 0; |
| 132 | #endif |
| 133 | }; |
| 134 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 135 | typedef class experimental_async_interface async_interface; |
| 136 | #endif |
| 137 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 138 | async_interface* async() { return experimental_async(); } |
| 139 | #endif |
| 140 | virtual class experimental_async_interface* experimental_async() { return nullptr; } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 141 | private: |
| 142 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>* AsyncListMetricsRaw(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 143 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::ListMetricsResponse>* PrepareAsyncListMetricsRaw(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 144 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>* AsyncUpdateMetricsConfigurationRaw(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 145 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::MetricsConfigurationResponse>* PrepareAsyncUpdateMetricsConfigurationRaw(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 146 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>* AsyncGetMetricRaw(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 147 | virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::GetMetricResponse>* PrepareAsyncGetMetricRaw(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) = 0; |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 148 | virtual ::grpc::ClientReaderInterface< ::dmi::Metric>* StreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request) = 0; |
| 149 | virtual ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>* AsyncStreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq, void* tag) = 0; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 150 | virtual ::grpc::ClientAsyncReaderInterface< ::dmi::Metric>* PrepareAsyncStreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 151 | }; |
| 152 | class Stub final : public StubInterface { |
| 153 | public: |
| 154 | Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); |
| 155 | ::grpc::Status ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::dmi::ListMetricsResponse* response) override; |
| 156 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>> AsyncListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) { |
| 157 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>>(AsyncListMetricsRaw(context, request, cq)); |
| 158 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 159 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>> PrepareAsyncListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) { |
| 160 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>>(PrepareAsyncListMetricsRaw(context, request, cq)); |
| 161 | } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 162 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::dmi::MetricsConfigurationResponse* response) override; |
| 163 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>> AsyncUpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) { |
| 164 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>>(AsyncUpdateMetricsConfigurationRaw(context, request, cq)); |
| 165 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 166 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>> PrepareAsyncUpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) { |
| 167 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>>(PrepareAsyncUpdateMetricsConfigurationRaw(context, request, cq)); |
| 168 | } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 169 | ::grpc::Status GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::dmi::GetMetricResponse* response) override; |
| 170 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>> AsyncGetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) { |
| 171 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>>(AsyncGetMetricRaw(context, request, cq)); |
| 172 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 173 | std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>> PrepareAsyncGetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) { |
| 174 | return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>>(PrepareAsyncGetMetricRaw(context, request, cq)); |
| 175 | } |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 176 | std::unique_ptr< ::grpc::ClientReader< ::dmi::Metric>> StreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request) { |
| 177 | return std::unique_ptr< ::grpc::ClientReader< ::dmi::Metric>>(StreamMetricsRaw(context, request)); |
| 178 | } |
| 179 | std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::Metric>> AsyncStreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq, void* tag) { |
| 180 | return std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::Metric>>(AsyncStreamMetricsRaw(context, request, cq, tag)); |
| 181 | } |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 182 | std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::Metric>> PrepareAsyncStreamMetrics(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { |
| 183 | return std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::Metric>>(PrepareAsyncStreamMetricsRaw(context, request, cq)); |
| 184 | } |
| 185 | class experimental_async final : |
| 186 | public StubInterface::experimental_async_interface { |
| 187 | public: |
| 188 | void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, std::function<void(::grpc::Status)>) override; |
| 189 | void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, std::function<void(::grpc::Status)>) override; |
| 190 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 191 | void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 192 | #else |
| 193 | void ListMetrics(::grpc::ClientContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 194 | #endif |
| 195 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 196 | void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 197 | #else |
| 198 | void ListMetrics(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::ListMetricsResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 199 | #endif |
| 200 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, std::function<void(::grpc::Status)>) override; |
| 201 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, std::function<void(::grpc::Status)>) override; |
| 202 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 203 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 204 | #else |
| 205 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 206 | #endif |
| 207 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 208 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 209 | #else |
| 210 | void UpdateMetricsConfiguration(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::MetricsConfigurationResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 211 | #endif |
| 212 | void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, std::function<void(::grpc::Status)>) override; |
| 213 | void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, std::function<void(::grpc::Status)>) override; |
| 214 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 215 | void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 216 | #else |
| 217 | void GetMetric(::grpc::ClientContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 218 | #endif |
| 219 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 220 | void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, ::grpc::ClientUnaryReactor* reactor) override; |
| 221 | #else |
| 222 | void GetMetric(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::GetMetricResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
| 223 | #endif |
| 224 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 225 | void StreamMetrics(::grpc::ClientContext* context, ::google::protobuf::Empty* request, ::grpc::ClientReadReactor< ::dmi::Metric>* reactor) override; |
| 226 | #else |
| 227 | void StreamMetrics(::grpc::ClientContext* context, ::google::protobuf::Empty* request, ::grpc::experimental::ClientReadReactor< ::dmi::Metric>* reactor) override; |
| 228 | #endif |
| 229 | private: |
| 230 | friend class Stub; |
| 231 | explicit experimental_async(Stub* stub): stub_(stub) { } |
| 232 | Stub* stub() { return stub_; } |
| 233 | Stub* stub_; |
| 234 | }; |
| 235 | class experimental_async_interface* experimental_async() override { return &async_stub_; } |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 236 | |
| 237 | private: |
| 238 | std::shared_ptr< ::grpc::ChannelInterface> channel_; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 239 | class experimental_async async_stub_{this}; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 240 | ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>* AsyncListMetricsRaw(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) override; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 241 | ::grpc::ClientAsyncResponseReader< ::dmi::ListMetricsResponse>* PrepareAsyncListMetricsRaw(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::grpc::CompletionQueue* cq) override; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 242 | ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>* AsyncUpdateMetricsConfigurationRaw(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) override; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 243 | ::grpc::ClientAsyncResponseReader< ::dmi::MetricsConfigurationResponse>* PrepareAsyncUpdateMetricsConfigurationRaw(::grpc::ClientContext* context, const ::dmi::MetricsConfigurationRequest& request, ::grpc::CompletionQueue* cq) override; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 244 | ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>* AsyncGetMetricRaw(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) override; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 245 | ::grpc::ClientAsyncResponseReader< ::dmi::GetMetricResponse>* PrepareAsyncGetMetricRaw(::grpc::ClientContext* context, const ::dmi::GetMetricRequest& request, ::grpc::CompletionQueue* cq) override; |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 246 | ::grpc::ClientReader< ::dmi::Metric>* StreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request) override; |
| 247 | ::grpc::ClientAsyncReader< ::dmi::Metric>* AsyncStreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq, void* tag) override; |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 248 | ::grpc::ClientAsyncReader< ::dmi::Metric>* PrepareAsyncStreamMetricsRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override; |
| 249 | const ::grpc::internal::RpcMethod rpcmethod_ListMetrics_; |
| 250 | const ::grpc::internal::RpcMethod rpcmethod_UpdateMetricsConfiguration_; |
| 251 | const ::grpc::internal::RpcMethod rpcmethod_GetMetric_; |
| 252 | const ::grpc::internal::RpcMethod rpcmethod_StreamMetrics_; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 253 | }; |
| 254 | static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); |
| 255 | |
| 256 | class Service : public ::grpc::Service { |
| 257 | public: |
| 258 | Service(); |
| 259 | virtual ~Service(); |
| 260 | // List the supported metrics for the passed device.
|
| 261 | // This would be the first call that you make to know about the metrics that a particular device supports and
|
| 262 | // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 263 | virtual ::grpc::Status ListMetrics(::grpc::ServerContext* context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response); |
| 264 | // Updates the configuration of the list of metrics in the request
|
| 265 | // Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 266 | // by changing its configuration.
|
| 267 | //
|
| 268 | // This configuration is persisted across restart of the device or the device manager
|
| 269 | virtual ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response); |
| 270 | // Get the instantenous value of a metric
|
| 271 | virtual ::grpc::Status GetMetric(::grpc::ServerContext* context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response); |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 272 | // Initiate the server streaming of the metrics
|
| 273 | virtual ::grpc::Status StreamMetrics(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::grpc::ServerWriter< ::dmi::Metric>* writer); |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 274 | }; |
| 275 | template <class BaseClass> |
| 276 | class WithAsyncMethod_ListMetrics : public BaseClass { |
| 277 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 278 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 279 | public: |
| 280 | WithAsyncMethod_ListMetrics() { |
| 281 | ::grpc::Service::MarkMethodAsync(0); |
| 282 | } |
| 283 | ~WithAsyncMethod_ListMetrics() override { |
| 284 | BaseClassMustBeDerivedFromService(this); |
| 285 | } |
| 286 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 287 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 288 | abort(); |
| 289 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 290 | } |
| 291 | void RequestListMetrics(::grpc::ServerContext* context, ::dmi::HardwareID* request, ::grpc::ServerAsyncResponseWriter< ::dmi::ListMetricsResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 292 | ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); |
| 293 | } |
| 294 | }; |
| 295 | template <class BaseClass> |
| 296 | class WithAsyncMethod_UpdateMetricsConfiguration : public BaseClass { |
| 297 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 298 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 299 | public: |
| 300 | WithAsyncMethod_UpdateMetricsConfiguration() { |
| 301 | ::grpc::Service::MarkMethodAsync(1); |
| 302 | } |
| 303 | ~WithAsyncMethod_UpdateMetricsConfiguration() override { |
| 304 | BaseClassMustBeDerivedFromService(this); |
| 305 | } |
| 306 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 307 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 308 | abort(); |
| 309 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 310 | } |
| 311 | void RequestUpdateMetricsConfiguration(::grpc::ServerContext* context, ::dmi::MetricsConfigurationRequest* request, ::grpc::ServerAsyncResponseWriter< ::dmi::MetricsConfigurationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 312 | ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); |
| 313 | } |
| 314 | }; |
| 315 | template <class BaseClass> |
| 316 | class WithAsyncMethod_GetMetric : public BaseClass { |
| 317 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 318 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 319 | public: |
| 320 | WithAsyncMethod_GetMetric() { |
| 321 | ::grpc::Service::MarkMethodAsync(2); |
| 322 | } |
| 323 | ~WithAsyncMethod_GetMetric() override { |
| 324 | BaseClassMustBeDerivedFromService(this); |
| 325 | } |
| 326 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 327 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 328 | abort(); |
| 329 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 330 | } |
| 331 | void RequestGetMetric(::grpc::ServerContext* context, ::dmi::GetMetricRequest* request, ::grpc::ServerAsyncResponseWriter< ::dmi::GetMetricResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 332 | ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); |
| 333 | } |
| 334 | }; |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 335 | template <class BaseClass> |
| 336 | class WithAsyncMethod_StreamMetrics : public BaseClass { |
| 337 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 338 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 339 | public: |
| 340 | WithAsyncMethod_StreamMetrics() { |
| 341 | ::grpc::Service::MarkMethodAsync(3); |
| 342 | } |
| 343 | ~WithAsyncMethod_StreamMetrics() override { |
| 344 | BaseClassMustBeDerivedFromService(this); |
| 345 | } |
| 346 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 347 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 348 | abort(); |
| 349 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 350 | } |
| 351 | void RequestStreamMetrics(::grpc::ServerContext* context, ::google::protobuf::Empty* request, ::grpc::ServerAsyncWriter< ::dmi::Metric>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 352 | ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); |
| 353 | } |
| 354 | }; |
| 355 | typedef WithAsyncMethod_ListMetrics<WithAsyncMethod_UpdateMetricsConfiguration<WithAsyncMethod_GetMetric<WithAsyncMethod_StreamMetrics<Service > > > > AsyncService; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 356 | template <class BaseClass> |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 357 | class ExperimentalWithCallbackMethod_ListMetrics : public BaseClass { |
| 358 | private: |
| 359 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 360 | public: |
| 361 | ExperimentalWithCallbackMethod_ListMetrics() { |
| 362 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 363 | ::grpc::Service:: |
| 364 | #else |
| 365 | ::grpc::Service::experimental(). |
| 366 | #endif |
| 367 | MarkMethodCallback(0, |
| 368 | new ::grpc_impl::internal::CallbackUnaryHandler< ::dmi::HardwareID, ::dmi::ListMetricsResponse>( |
| 369 | [this]( |
| 370 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 371 | ::grpc::CallbackServerContext* |
| 372 | #else |
| 373 | ::grpc::experimental::CallbackServerContext* |
| 374 | #endif |
| 375 | context, const ::dmi::HardwareID* request, ::dmi::ListMetricsResponse* response) { return this->ListMetrics(context, request, response); }));} |
| 376 | void SetMessageAllocatorFor_ListMetrics( |
| 377 | ::grpc::experimental::MessageAllocator< ::dmi::HardwareID, ::dmi::ListMetricsResponse>* allocator) { |
| 378 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 379 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); |
| 380 | #else |
| 381 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); |
| 382 | #endif |
| 383 | static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::dmi::HardwareID, ::dmi::ListMetricsResponse>*>(handler) |
| 384 | ->SetMessageAllocator(allocator); |
| 385 | } |
| 386 | ~ExperimentalWithCallbackMethod_ListMetrics() override { |
| 387 | BaseClassMustBeDerivedFromService(this); |
| 388 | } |
| 389 | // disable synchronous version of this method |
| 390 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
| 391 | abort(); |
| 392 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 393 | } |
| 394 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 395 | virtual ::grpc::ServerUnaryReactor* ListMetrics( |
| 396 | ::grpc::CallbackServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) |
| 397 | #else |
| 398 | virtual ::grpc::experimental::ServerUnaryReactor* ListMetrics( |
| 399 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) |
| 400 | #endif |
| 401 | { return nullptr; } |
| 402 | }; |
| 403 | template <class BaseClass> |
| 404 | class ExperimentalWithCallbackMethod_UpdateMetricsConfiguration : public BaseClass { |
| 405 | private: |
| 406 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 407 | public: |
| 408 | ExperimentalWithCallbackMethod_UpdateMetricsConfiguration() { |
| 409 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 410 | ::grpc::Service:: |
| 411 | #else |
| 412 | ::grpc::Service::experimental(). |
| 413 | #endif |
| 414 | MarkMethodCallback(1, |
| 415 | new ::grpc_impl::internal::CallbackUnaryHandler< ::dmi::MetricsConfigurationRequest, ::dmi::MetricsConfigurationResponse>( |
| 416 | [this]( |
| 417 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 418 | ::grpc::CallbackServerContext* |
| 419 | #else |
| 420 | ::grpc::experimental::CallbackServerContext* |
| 421 | #endif |
| 422 | context, const ::dmi::MetricsConfigurationRequest* request, ::dmi::MetricsConfigurationResponse* response) { return this->UpdateMetricsConfiguration(context, request, response); }));} |
| 423 | void SetMessageAllocatorFor_UpdateMetricsConfiguration( |
| 424 | ::grpc::experimental::MessageAllocator< ::dmi::MetricsConfigurationRequest, ::dmi::MetricsConfigurationResponse>* allocator) { |
| 425 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 426 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); |
| 427 | #else |
| 428 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(1); |
| 429 | #endif |
| 430 | static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::dmi::MetricsConfigurationRequest, ::dmi::MetricsConfigurationResponse>*>(handler) |
| 431 | ->SetMessageAllocator(allocator); |
| 432 | } |
| 433 | ~ExperimentalWithCallbackMethod_UpdateMetricsConfiguration() override { |
| 434 | BaseClassMustBeDerivedFromService(this); |
| 435 | } |
| 436 | // disable synchronous version of this method |
| 437 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
| 438 | abort(); |
| 439 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 440 | } |
| 441 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 442 | virtual ::grpc::ServerUnaryReactor* UpdateMetricsConfiguration( |
| 443 | ::grpc::CallbackServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) |
| 444 | #else |
| 445 | virtual ::grpc::experimental::ServerUnaryReactor* UpdateMetricsConfiguration( |
| 446 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) |
| 447 | #endif |
| 448 | { return nullptr; } |
| 449 | }; |
| 450 | template <class BaseClass> |
| 451 | class ExperimentalWithCallbackMethod_GetMetric : public BaseClass { |
| 452 | private: |
| 453 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 454 | public: |
| 455 | ExperimentalWithCallbackMethod_GetMetric() { |
| 456 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 457 | ::grpc::Service:: |
| 458 | #else |
| 459 | ::grpc::Service::experimental(). |
| 460 | #endif |
| 461 | MarkMethodCallback(2, |
| 462 | new ::grpc_impl::internal::CallbackUnaryHandler< ::dmi::GetMetricRequest, ::dmi::GetMetricResponse>( |
| 463 | [this]( |
| 464 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 465 | ::grpc::CallbackServerContext* |
| 466 | #else |
| 467 | ::grpc::experimental::CallbackServerContext* |
| 468 | #endif |
| 469 | context, const ::dmi::GetMetricRequest* request, ::dmi::GetMetricResponse* response) { return this->GetMetric(context, request, response); }));} |
| 470 | void SetMessageAllocatorFor_GetMetric( |
| 471 | ::grpc::experimental::MessageAllocator< ::dmi::GetMetricRequest, ::dmi::GetMetricResponse>* allocator) { |
| 472 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 473 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); |
| 474 | #else |
| 475 | ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(2); |
| 476 | #endif |
| 477 | static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::dmi::GetMetricRequest, ::dmi::GetMetricResponse>*>(handler) |
| 478 | ->SetMessageAllocator(allocator); |
| 479 | } |
| 480 | ~ExperimentalWithCallbackMethod_GetMetric() override { |
| 481 | BaseClassMustBeDerivedFromService(this); |
| 482 | } |
| 483 | // disable synchronous version of this method |
| 484 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
| 485 | abort(); |
| 486 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 487 | } |
| 488 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 489 | virtual ::grpc::ServerUnaryReactor* GetMetric( |
| 490 | ::grpc::CallbackServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) |
| 491 | #else |
| 492 | virtual ::grpc::experimental::ServerUnaryReactor* GetMetric( |
| 493 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) |
| 494 | #endif |
| 495 | { return nullptr; } |
| 496 | }; |
| 497 | template <class BaseClass> |
| 498 | class ExperimentalWithCallbackMethod_StreamMetrics : public BaseClass { |
| 499 | private: |
| 500 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 501 | public: |
| 502 | ExperimentalWithCallbackMethod_StreamMetrics() { |
| 503 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 504 | ::grpc::Service:: |
| 505 | #else |
| 506 | ::grpc::Service::experimental(). |
| 507 | #endif |
| 508 | MarkMethodCallback(3, |
| 509 | new ::grpc_impl::internal::CallbackServerStreamingHandler< ::google::protobuf::Empty, ::dmi::Metric>( |
| 510 | [this]( |
| 511 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 512 | ::grpc::CallbackServerContext* |
| 513 | #else |
| 514 | ::grpc::experimental::CallbackServerContext* |
| 515 | #endif |
| 516 | context, const ::google::protobuf::Empty* request) { return this->StreamMetrics(context, request); })); |
| 517 | } |
| 518 | ~ExperimentalWithCallbackMethod_StreamMetrics() override { |
| 519 | BaseClassMustBeDerivedFromService(this); |
| 520 | } |
| 521 | // disable synchronous version of this method |
| 522 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
| 523 | abort(); |
| 524 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 525 | } |
| 526 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 527 | virtual ::grpc::ServerWriteReactor< ::dmi::Metric>* StreamMetrics( |
| 528 | ::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/) |
| 529 | #else |
| 530 | virtual ::grpc::experimental::ServerWriteReactor< ::dmi::Metric>* StreamMetrics( |
| 531 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/) |
| 532 | #endif |
| 533 | { return nullptr; } |
| 534 | }; |
| 535 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 536 | typedef ExperimentalWithCallbackMethod_ListMetrics<ExperimentalWithCallbackMethod_UpdateMetricsConfiguration<ExperimentalWithCallbackMethod_GetMetric<ExperimentalWithCallbackMethod_StreamMetrics<Service > > > > CallbackService; |
| 537 | #endif |
| 538 | |
| 539 | typedef ExperimentalWithCallbackMethod_ListMetrics<ExperimentalWithCallbackMethod_UpdateMetricsConfiguration<ExperimentalWithCallbackMethod_GetMetric<ExperimentalWithCallbackMethod_StreamMetrics<Service > > > > ExperimentalCallbackService; |
| 540 | template <class BaseClass> |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 541 | class WithGenericMethod_ListMetrics : public BaseClass { |
| 542 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 543 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 544 | public: |
| 545 | WithGenericMethod_ListMetrics() { |
| 546 | ::grpc::Service::MarkMethodGeneric(0); |
| 547 | } |
| 548 | ~WithGenericMethod_ListMetrics() override { |
| 549 | BaseClassMustBeDerivedFromService(this); |
| 550 | } |
| 551 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 552 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 553 | abort(); |
| 554 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 555 | } |
| 556 | }; |
| 557 | template <class BaseClass> |
| 558 | class WithGenericMethod_UpdateMetricsConfiguration : public BaseClass { |
| 559 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 560 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 561 | public: |
| 562 | WithGenericMethod_UpdateMetricsConfiguration() { |
| 563 | ::grpc::Service::MarkMethodGeneric(1); |
| 564 | } |
| 565 | ~WithGenericMethod_UpdateMetricsConfiguration() override { |
| 566 | BaseClassMustBeDerivedFromService(this); |
| 567 | } |
| 568 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 569 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 570 | abort(); |
| 571 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 572 | } |
| 573 | }; |
| 574 | template <class BaseClass> |
| 575 | class WithGenericMethod_GetMetric : public BaseClass { |
| 576 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 577 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 578 | public: |
| 579 | WithGenericMethod_GetMetric() { |
| 580 | ::grpc::Service::MarkMethodGeneric(2); |
| 581 | } |
| 582 | ~WithGenericMethod_GetMetric() override { |
| 583 | BaseClassMustBeDerivedFromService(this); |
| 584 | } |
| 585 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 586 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 587 | abort(); |
| 588 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 589 | } |
| 590 | }; |
| 591 | template <class BaseClass> |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 592 | class WithGenericMethod_StreamMetrics : public BaseClass { |
| 593 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 594 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 595 | public: |
| 596 | WithGenericMethod_StreamMetrics() { |
| 597 | ::grpc::Service::MarkMethodGeneric(3); |
| 598 | } |
| 599 | ~WithGenericMethod_StreamMetrics() override { |
| 600 | BaseClassMustBeDerivedFromService(this); |
| 601 | } |
| 602 | // disable synchronous version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 603 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 604 | abort(); |
| 605 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 606 | } |
| 607 | }; |
| 608 | template <class BaseClass> |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 609 | class WithRawMethod_ListMetrics : public BaseClass { |
| 610 | private: |
| 611 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 612 | public: |
| 613 | WithRawMethod_ListMetrics() { |
| 614 | ::grpc::Service::MarkMethodRaw(0); |
| 615 | } |
| 616 | ~WithRawMethod_ListMetrics() override { |
| 617 | BaseClassMustBeDerivedFromService(this); |
| 618 | } |
| 619 | // disable synchronous version of this method |
| 620 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
| 621 | abort(); |
| 622 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 623 | } |
| 624 | void RequestListMetrics(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 625 | ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); |
| 626 | } |
| 627 | }; |
| 628 | template <class BaseClass> |
| 629 | class WithRawMethod_UpdateMetricsConfiguration : public BaseClass { |
| 630 | private: |
| 631 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 632 | public: |
| 633 | WithRawMethod_UpdateMetricsConfiguration() { |
| 634 | ::grpc::Service::MarkMethodRaw(1); |
| 635 | } |
| 636 | ~WithRawMethod_UpdateMetricsConfiguration() override { |
| 637 | BaseClassMustBeDerivedFromService(this); |
| 638 | } |
| 639 | // disable synchronous version of this method |
| 640 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
| 641 | abort(); |
| 642 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 643 | } |
| 644 | void RequestUpdateMetricsConfiguration(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 645 | ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); |
| 646 | } |
| 647 | }; |
| 648 | template <class BaseClass> |
| 649 | class WithRawMethod_GetMetric : public BaseClass { |
| 650 | private: |
| 651 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 652 | public: |
| 653 | WithRawMethod_GetMetric() { |
| 654 | ::grpc::Service::MarkMethodRaw(2); |
| 655 | } |
| 656 | ~WithRawMethod_GetMetric() override { |
| 657 | BaseClassMustBeDerivedFromService(this); |
| 658 | } |
| 659 | // disable synchronous version of this method |
| 660 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
| 661 | abort(); |
| 662 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 663 | } |
| 664 | void RequestGetMetric(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 665 | ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); |
| 666 | } |
| 667 | }; |
| 668 | template <class BaseClass> |
| 669 | class WithRawMethod_StreamMetrics : public BaseClass { |
| 670 | private: |
| 671 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 672 | public: |
| 673 | WithRawMethod_StreamMetrics() { |
| 674 | ::grpc::Service::MarkMethodRaw(3); |
| 675 | } |
| 676 | ~WithRawMethod_StreamMetrics() override { |
| 677 | BaseClassMustBeDerivedFromService(this); |
| 678 | } |
| 679 | // disable synchronous version of this method |
| 680 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
| 681 | abort(); |
| 682 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 683 | } |
| 684 | void RequestStreamMetrics(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
| 685 | ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); |
| 686 | } |
| 687 | }; |
| 688 | template <class BaseClass> |
| 689 | class ExperimentalWithRawCallbackMethod_ListMetrics : public BaseClass { |
| 690 | private: |
| 691 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 692 | public: |
| 693 | ExperimentalWithRawCallbackMethod_ListMetrics() { |
| 694 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 695 | ::grpc::Service:: |
| 696 | #else |
| 697 | ::grpc::Service::experimental(). |
| 698 | #endif |
| 699 | MarkMethodRawCallback(0, |
| 700 | new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
| 701 | [this]( |
| 702 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 703 | ::grpc::CallbackServerContext* |
| 704 | #else |
| 705 | ::grpc::experimental::CallbackServerContext* |
| 706 | #endif |
| 707 | context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ListMetrics(context, request, response); })); |
| 708 | } |
| 709 | ~ExperimentalWithRawCallbackMethod_ListMetrics() override { |
| 710 | BaseClassMustBeDerivedFromService(this); |
| 711 | } |
| 712 | // disable synchronous version of this method |
| 713 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
| 714 | abort(); |
| 715 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 716 | } |
| 717 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 718 | virtual ::grpc::ServerUnaryReactor* ListMetrics( |
| 719 | ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 720 | #else |
| 721 | virtual ::grpc::experimental::ServerUnaryReactor* ListMetrics( |
| 722 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 723 | #endif |
| 724 | { return nullptr; } |
| 725 | }; |
| 726 | template <class BaseClass> |
| 727 | class ExperimentalWithRawCallbackMethod_UpdateMetricsConfiguration : public BaseClass { |
| 728 | private: |
| 729 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 730 | public: |
| 731 | ExperimentalWithRawCallbackMethod_UpdateMetricsConfiguration() { |
| 732 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 733 | ::grpc::Service:: |
| 734 | #else |
| 735 | ::grpc::Service::experimental(). |
| 736 | #endif |
| 737 | MarkMethodRawCallback(1, |
| 738 | new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
| 739 | [this]( |
| 740 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 741 | ::grpc::CallbackServerContext* |
| 742 | #else |
| 743 | ::grpc::experimental::CallbackServerContext* |
| 744 | #endif |
| 745 | context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->UpdateMetricsConfiguration(context, request, response); })); |
| 746 | } |
| 747 | ~ExperimentalWithRawCallbackMethod_UpdateMetricsConfiguration() override { |
| 748 | BaseClassMustBeDerivedFromService(this); |
| 749 | } |
| 750 | // disable synchronous version of this method |
| 751 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
| 752 | abort(); |
| 753 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 754 | } |
| 755 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 756 | virtual ::grpc::ServerUnaryReactor* UpdateMetricsConfiguration( |
| 757 | ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 758 | #else |
| 759 | virtual ::grpc::experimental::ServerUnaryReactor* UpdateMetricsConfiguration( |
| 760 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 761 | #endif |
| 762 | { return nullptr; } |
| 763 | }; |
| 764 | template <class BaseClass> |
| 765 | class ExperimentalWithRawCallbackMethod_GetMetric : public BaseClass { |
| 766 | private: |
| 767 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 768 | public: |
| 769 | ExperimentalWithRawCallbackMethod_GetMetric() { |
| 770 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 771 | ::grpc::Service:: |
| 772 | #else |
| 773 | ::grpc::Service::experimental(). |
| 774 | #endif |
| 775 | MarkMethodRawCallback(2, |
| 776 | new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
| 777 | [this]( |
| 778 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 779 | ::grpc::CallbackServerContext* |
| 780 | #else |
| 781 | ::grpc::experimental::CallbackServerContext* |
| 782 | #endif |
| 783 | context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetMetric(context, request, response); })); |
| 784 | } |
| 785 | ~ExperimentalWithRawCallbackMethod_GetMetric() override { |
| 786 | BaseClassMustBeDerivedFromService(this); |
| 787 | } |
| 788 | // disable synchronous version of this method |
| 789 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
| 790 | abort(); |
| 791 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 792 | } |
| 793 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 794 | virtual ::grpc::ServerUnaryReactor* GetMetric( |
| 795 | ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 796 | #else |
| 797 | virtual ::grpc::experimental::ServerUnaryReactor* GetMetric( |
| 798 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
| 799 | #endif |
| 800 | { return nullptr; } |
| 801 | }; |
| 802 | template <class BaseClass> |
| 803 | class ExperimentalWithRawCallbackMethod_StreamMetrics : public BaseClass { |
| 804 | private: |
| 805 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
| 806 | public: |
| 807 | ExperimentalWithRawCallbackMethod_StreamMetrics() { |
| 808 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 809 | ::grpc::Service:: |
| 810 | #else |
| 811 | ::grpc::Service::experimental(). |
| 812 | #endif |
| 813 | MarkMethodRawCallback(3, |
| 814 | new ::grpc_impl::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
| 815 | [this]( |
| 816 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 817 | ::grpc::CallbackServerContext* |
| 818 | #else |
| 819 | ::grpc::experimental::CallbackServerContext* |
| 820 | #endif |
| 821 | context, const::grpc::ByteBuffer* request) { return this->StreamMetrics(context, request); })); |
| 822 | } |
| 823 | ~ExperimentalWithRawCallbackMethod_StreamMetrics() override { |
| 824 | BaseClassMustBeDerivedFromService(this); |
| 825 | } |
| 826 | // disable synchronous version of this method |
| 827 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
| 828 | abort(); |
| 829 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 830 | } |
| 831 | #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
| 832 | virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* StreamMetrics( |
| 833 | ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) |
| 834 | #else |
| 835 | virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* StreamMetrics( |
| 836 | ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) |
| 837 | #endif |
| 838 | { return nullptr; } |
| 839 | }; |
| 840 | template <class BaseClass> |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 841 | class WithStreamedUnaryMethod_ListMetrics : public BaseClass { |
| 842 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 843 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 844 | public: |
| 845 | WithStreamedUnaryMethod_ListMetrics() { |
| 846 | ::grpc::Service::MarkMethodStreamed(0, |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 847 | new ::grpc::internal::StreamedUnaryHandler< |
| 848 | ::dmi::HardwareID, ::dmi::ListMetricsResponse>( |
| 849 | [this](::grpc_impl::ServerContext* context, |
| 850 | ::grpc_impl::ServerUnaryStreamer< |
| 851 | ::dmi::HardwareID, ::dmi::ListMetricsResponse>* streamer) { |
| 852 | return this->StreamedListMetrics(context, |
| 853 | streamer); |
| 854 | })); |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 855 | } |
| 856 | ~WithStreamedUnaryMethod_ListMetrics() override { |
| 857 | BaseClassMustBeDerivedFromService(this); |
| 858 | } |
| 859 | // disable regular version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 860 | ::grpc::Status ListMetrics(::grpc::ServerContext* /*context*/, const ::dmi::HardwareID* /*request*/, ::dmi::ListMetricsResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 861 | abort(); |
| 862 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 863 | } |
| 864 | // replace default version of method with streamed unary |
| 865 | virtual ::grpc::Status StreamedListMetrics(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::dmi::HardwareID,::dmi::ListMetricsResponse>* server_unary_streamer) = 0; |
| 866 | }; |
| 867 | template <class BaseClass> |
| 868 | class WithStreamedUnaryMethod_UpdateMetricsConfiguration : public BaseClass { |
| 869 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 870 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 871 | public: |
| 872 | WithStreamedUnaryMethod_UpdateMetricsConfiguration() { |
| 873 | ::grpc::Service::MarkMethodStreamed(1, |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 874 | new ::grpc::internal::StreamedUnaryHandler< |
| 875 | ::dmi::MetricsConfigurationRequest, ::dmi::MetricsConfigurationResponse>( |
| 876 | [this](::grpc_impl::ServerContext* context, |
| 877 | ::grpc_impl::ServerUnaryStreamer< |
| 878 | ::dmi::MetricsConfigurationRequest, ::dmi::MetricsConfigurationResponse>* streamer) { |
| 879 | return this->StreamedUpdateMetricsConfiguration(context, |
| 880 | streamer); |
| 881 | })); |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 882 | } |
| 883 | ~WithStreamedUnaryMethod_UpdateMetricsConfiguration() override { |
| 884 | BaseClassMustBeDerivedFromService(this); |
| 885 | } |
| 886 | // disable regular version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 887 | ::grpc::Status UpdateMetricsConfiguration(::grpc::ServerContext* /*context*/, const ::dmi::MetricsConfigurationRequest* /*request*/, ::dmi::MetricsConfigurationResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 888 | abort(); |
| 889 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 890 | } |
| 891 | // replace default version of method with streamed unary |
| 892 | virtual ::grpc::Status StreamedUpdateMetricsConfiguration(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::dmi::MetricsConfigurationRequest,::dmi::MetricsConfigurationResponse>* server_unary_streamer) = 0; |
| 893 | }; |
| 894 | template <class BaseClass> |
| 895 | class WithStreamedUnaryMethod_GetMetric : public BaseClass { |
| 896 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 897 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 898 | public: |
| 899 | WithStreamedUnaryMethod_GetMetric() { |
| 900 | ::grpc::Service::MarkMethodStreamed(2, |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 901 | new ::grpc::internal::StreamedUnaryHandler< |
| 902 | ::dmi::GetMetricRequest, ::dmi::GetMetricResponse>( |
| 903 | [this](::grpc_impl::ServerContext* context, |
| 904 | ::grpc_impl::ServerUnaryStreamer< |
| 905 | ::dmi::GetMetricRequest, ::dmi::GetMetricResponse>* streamer) { |
| 906 | return this->StreamedGetMetric(context, |
| 907 | streamer); |
| 908 | })); |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 909 | } |
| 910 | ~WithStreamedUnaryMethod_GetMetric() override { |
| 911 | BaseClassMustBeDerivedFromService(this); |
| 912 | } |
| 913 | // disable regular version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 914 | ::grpc::Status GetMetric(::grpc::ServerContext* /*context*/, const ::dmi::GetMetricRequest* /*request*/, ::dmi::GetMetricResponse* /*response*/) override { |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 915 | abort(); |
| 916 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 917 | } |
| 918 | // replace default version of method with streamed unary |
| 919 | virtual ::grpc::Status StreamedGetMetric(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::dmi::GetMetricRequest,::dmi::GetMetricResponse>* server_unary_streamer) = 0; |
| 920 | }; |
| 921 | typedef WithStreamedUnaryMethod_ListMetrics<WithStreamedUnaryMethod_UpdateMetricsConfiguration<WithStreamedUnaryMethod_GetMetric<Service > > > StreamedUnaryService; |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 922 | template <class BaseClass> |
| 923 | class WithSplitStreamingMethod_StreamMetrics : public BaseClass { |
| 924 | private: |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 925 | void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 926 | public: |
| 927 | WithSplitStreamingMethod_StreamMetrics() { |
| 928 | ::grpc::Service::MarkMethodStreamed(3, |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 929 | new ::grpc::internal::SplitServerStreamingHandler< |
| 930 | ::google::protobuf::Empty, ::dmi::Metric>( |
| 931 | [this](::grpc_impl::ServerContext* context, |
| 932 | ::grpc_impl::ServerSplitStreamer< |
| 933 | ::google::protobuf::Empty, ::dmi::Metric>* streamer) { |
| 934 | return this->StreamedStreamMetrics(context, |
| 935 | streamer); |
| 936 | })); |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 937 | } |
| 938 | ~WithSplitStreamingMethod_StreamMetrics() override { |
| 939 | BaseClassMustBeDerivedFromService(this); |
| 940 | } |
| 941 | // disable regular version of this method |
Andrea Campanella | 03d4e7a | 2021-04-28 15:34:46 +0200 | [diff] [blame] | 942 | ::grpc::Status StreamMetrics(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::grpc::ServerWriter< ::dmi::Metric>* /*writer*/) override { |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 943 | abort(); |
| 944 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
| 945 | } |
| 946 | // replace default version of method with split streamed |
| 947 | virtual ::grpc::Status StreamedStreamMetrics(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::google::protobuf::Empty,::dmi::Metric>* server_split_streamer) = 0; |
| 948 | }; |
| 949 | typedef WithSplitStreamingMethod_StreamMetrics<Service > SplitStreamedService; |
| 950 | typedef WithStreamedUnaryMethod_ListMetrics<WithStreamedUnaryMethod_UpdateMetricsConfiguration<WithStreamedUnaryMethod_GetMetric<WithSplitStreamingMethod_StreamMetrics<Service > > > > StreamedService; |
Andrea Campanella | c795b7d | 2021-04-14 13:24:44 +0200 | [diff] [blame] | 951 | }; |
| 952 | |
| 953 | } // namespace dmi |
| 954 | |
| 955 | |
| 956 | #endif // GRPC_dmi_2fhw_5fmetrics_5fmgmt_5fservice_2eproto__INCLUDED |