129 lines
7.4 KiB
C++
129 lines
7.4 KiB
C++
// Generated by the gRPC C++ plugin.
|
|
// If you make any local change, they will be lost.
|
|
// source: market_data.proto
|
|
|
|
#include "market_data.pb.h"
|
|
#include "market_data.grpc.pb.h"
|
|
|
|
#include <functional>
|
|
#include <grpcpp/support/async_stream.h>
|
|
#include <grpcpp/support/async_unary_call.h>
|
|
#include <grpcpp/impl/channel_interface.h>
|
|
#include <grpcpp/impl/client_unary_call.h>
|
|
#include <grpcpp/support/client_callback.h>
|
|
#include <grpcpp/support/message_allocator.h>
|
|
#include <grpcpp/support/method_handler.h>
|
|
#include <grpcpp/impl/rpc_service_method.h>
|
|
#include <grpcpp/support/server_callback.h>
|
|
#include <grpcpp/impl/server_callback_handlers.h>
|
|
#include <grpcpp/server_context.h>
|
|
#include <grpcpp/impl/service_type.h>
|
|
#include <grpcpp/support/sync_stream.h>
|
|
namespace market_data {
|
|
|
|
static const char* TestService_method_names[] = {
|
|
"/market_data.TestService/GetData1",
|
|
"/market_data.TestService/GetData2",
|
|
};
|
|
|
|
std::unique_ptr< TestService::Stub> TestService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
|
|
(void)options;
|
|
std::unique_ptr< TestService::Stub> stub(new TestService::Stub(channel, options));
|
|
return stub;
|
|
}
|
|
|
|
TestService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
|
|
: channel_(channel), rpcmethod_GetData1_(TestService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
|
, rpcmethod_GetData2_(TestService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
|
{}
|
|
|
|
::grpc::Status TestService::Stub::GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::market_data::MsgReply* response) {
|
|
return ::grpc::internal::BlockingUnaryCall< ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetData1_, context, request, response);
|
|
}
|
|
|
|
void TestService::Stub::async::GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)> f) {
|
|
::grpc::internal::CallbackUnaryCall< ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetData1_, context, request, response, std::move(f));
|
|
}
|
|
|
|
void TestService::Stub::async::GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) {
|
|
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetData1_, context, request, response, reactor);
|
|
}
|
|
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* TestService::Stub::PrepareAsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::market_data::MsgReply, ::market_data::CThostFtdcDepthMarketDataField, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetData1_, context, request);
|
|
}
|
|
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* TestService::Stub::AsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
auto* result =
|
|
this->PrepareAsyncGetData1Raw(context, request, cq);
|
|
result->StartCall();
|
|
return result;
|
|
}
|
|
|
|
::grpc::Status TestService::Stub::GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::market_data::MsgReply* response) {
|
|
return ::grpc::internal::BlockingUnaryCall< ::market_data::ResMsg, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetData2_, context, request, response);
|
|
}
|
|
|
|
void TestService::Stub::async::GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)> f) {
|
|
::grpc::internal::CallbackUnaryCall< ::market_data::ResMsg, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetData2_, context, request, response, std::move(f));
|
|
}
|
|
|
|
void TestService::Stub::async::GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) {
|
|
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetData2_, context, request, response, reactor);
|
|
}
|
|
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* TestService::Stub::PrepareAsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::market_data::MsgReply, ::market_data::ResMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetData2_, context, request);
|
|
}
|
|
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* TestService::Stub::AsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
auto* result =
|
|
this->PrepareAsyncGetData2Raw(context, request, cq);
|
|
result->StartCall();
|
|
return result;
|
|
}
|
|
|
|
TestService::Service::Service() {
|
|
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
|
TestService_method_names[0],
|
|
::grpc::internal::RpcMethod::NORMAL_RPC,
|
|
new ::grpc::internal::RpcMethodHandler< TestService::Service, ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
|
[](TestService::Service* service,
|
|
::grpc::ServerContext* ctx,
|
|
const ::market_data::CThostFtdcDepthMarketDataField* req,
|
|
::market_data::MsgReply* resp) {
|
|
return service->GetData1(ctx, req, resp);
|
|
}, this)));
|
|
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
|
TestService_method_names[1],
|
|
::grpc::internal::RpcMethod::NORMAL_RPC,
|
|
new ::grpc::internal::RpcMethodHandler< TestService::Service, ::market_data::ResMsg, ::market_data::MsgReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
|
[](TestService::Service* service,
|
|
::grpc::ServerContext* ctx,
|
|
const ::market_data::ResMsg* req,
|
|
::market_data::MsgReply* resp) {
|
|
return service->GetData2(ctx, req, resp);
|
|
}, this)));
|
|
}
|
|
|
|
TestService::Service::~Service() {
|
|
}
|
|
|
|
::grpc::Status TestService::Service::GetData1(::grpc::ServerContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response) {
|
|
(void) context;
|
|
(void) request;
|
|
(void) response;
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
|
|
::grpc::Status TestService::Service::GetData2(::grpc::ServerContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response) {
|
|
(void) context;
|
|
(void) request;
|
|
(void) response;
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
|
|
|
|
} // namespace market_data
|
|
|