398 lines
23 KiB
C++
398 lines
23 KiB
C++
// Generated by the gRPC C++ plugin.
|
|
// If you make any local change, they will be lost.
|
|
// source: market_data.proto
|
|
#ifndef GRPC_market_5fdata_2eproto__INCLUDED
|
|
#define GRPC_market_5fdata_2eproto__INCLUDED
|
|
|
|
#include "market_data.pb.h"
|
|
|
|
#include <functional>
|
|
#include <grpcpp/generic/async_generic_service.h>
|
|
#include <grpcpp/support/async_stream.h>
|
|
#include <grpcpp/support/async_unary_call.h>
|
|
#include <grpcpp/support/client_callback.h>
|
|
#include <grpcpp/client_context.h>
|
|
#include <grpcpp/completion_queue.h>
|
|
#include <grpcpp/support/message_allocator.h>
|
|
#include <grpcpp/support/method_handler.h>
|
|
#include <grpcpp/impl/proto_utils.h>
|
|
#include <grpcpp/impl/rpc_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/status.h>
|
|
#include <grpcpp/support/stub_options.h>
|
|
#include <grpcpp/support/sync_stream.h>
|
|
|
|
namespace market_data {
|
|
|
|
class TestService final {
|
|
public:
|
|
static constexpr char const* service_full_name() {
|
|
return "market_data.TestService";
|
|
}
|
|
class StubInterface {
|
|
public:
|
|
virtual ~StubInterface() {}
|
|
virtual ::grpc::Status GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::market_data::MsgReply* response) = 0;
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>> AsyncGetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>>(AsyncGetData1Raw(context, request, cq));
|
|
}
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>> PrepareAsyncGetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>>(PrepareAsyncGetData1Raw(context, request, cq));
|
|
}
|
|
virtual ::grpc::Status GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::market_data::MsgReply* response) = 0;
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>> AsyncGetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>>(AsyncGetData2Raw(context, request, cq));
|
|
}
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>> PrepareAsyncGetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>>(PrepareAsyncGetData2Raw(context, request, cq));
|
|
}
|
|
class async_interface {
|
|
public:
|
|
virtual ~async_interface() {}
|
|
virtual void GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)>) = 0;
|
|
virtual void GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
|
|
virtual void GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)>) = 0;
|
|
virtual void GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
|
|
};
|
|
typedef class async_interface experimental_async_interface;
|
|
virtual class async_interface* async() { return nullptr; }
|
|
class async_interface* experimental_async() { return async(); }
|
|
private:
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>* AsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) = 0;
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>* PrepareAsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) = 0;
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>* AsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) = 0;
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::market_data::MsgReply>* PrepareAsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) = 0;
|
|
};
|
|
class Stub final : public StubInterface {
|
|
public:
|
|
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
|
|
::grpc::Status GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::market_data::MsgReply* response) override;
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>> AsyncGetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>>(AsyncGetData1Raw(context, request, cq));
|
|
}
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>> PrepareAsyncGetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>>(PrepareAsyncGetData1Raw(context, request, cq));
|
|
}
|
|
::grpc::Status GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::market_data::MsgReply* response) override;
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>> AsyncGetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>>(AsyncGetData2Raw(context, request, cq));
|
|
}
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>> PrepareAsyncGetData2(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) {
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>>(PrepareAsyncGetData2Raw(context, request, cq));
|
|
}
|
|
class async final :
|
|
public StubInterface::async_interface {
|
|
public:
|
|
void GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)>) override;
|
|
void GetData1(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) override;
|
|
void GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, std::function<void(::grpc::Status)>) override;
|
|
void GetData2(::grpc::ClientContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response, ::grpc::ClientUnaryReactor* reactor) override;
|
|
private:
|
|
friend class Stub;
|
|
explicit async(Stub* stub): stub_(stub) { }
|
|
Stub* stub() { return stub_; }
|
|
Stub* stub_;
|
|
};
|
|
class async* async() override { return &async_stub_; }
|
|
|
|
private:
|
|
std::shared_ptr< ::grpc::ChannelInterface> channel_;
|
|
class async async_stub_{this};
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* AsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) override;
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* PrepareAsyncGetData1Raw(::grpc::ClientContext* context, const ::market_data::CThostFtdcDepthMarketDataField& request, ::grpc::CompletionQueue* cq) override;
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* AsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) override;
|
|
::grpc::ClientAsyncResponseReader< ::market_data::MsgReply>* PrepareAsyncGetData2Raw(::grpc::ClientContext* context, const ::market_data::ResMsg& request, ::grpc::CompletionQueue* cq) override;
|
|
const ::grpc::internal::RpcMethod rpcmethod_GetData1_;
|
|
const ::grpc::internal::RpcMethod rpcmethod_GetData2_;
|
|
};
|
|
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
|
|
|
|
class Service : public ::grpc::Service {
|
|
public:
|
|
Service();
|
|
virtual ~Service();
|
|
virtual ::grpc::Status GetData1(::grpc::ServerContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response);
|
|
virtual ::grpc::Status GetData2(::grpc::ServerContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response);
|
|
};
|
|
template <class BaseClass>
|
|
class WithAsyncMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithAsyncMethod_GetData1() {
|
|
::grpc::Service::MarkMethodAsync(0);
|
|
}
|
|
~WithAsyncMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
void RequestGetData1(::grpc::ServerContext* context, ::market_data::CThostFtdcDepthMarketDataField* request, ::grpc::ServerAsyncResponseWriter< ::market_data::MsgReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
|
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
|
|
}
|
|
};
|
|
template <class BaseClass>
|
|
class WithAsyncMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithAsyncMethod_GetData2() {
|
|
::grpc::Service::MarkMethodAsync(1);
|
|
}
|
|
~WithAsyncMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
void RequestGetData2(::grpc::ServerContext* context, ::market_data::ResMsg* request, ::grpc::ServerAsyncResponseWriter< ::market_data::MsgReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
|
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
|
|
}
|
|
};
|
|
typedef WithAsyncMethod_GetData1<WithAsyncMethod_GetData2<Service > > AsyncService;
|
|
template <class BaseClass>
|
|
class WithCallbackMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithCallbackMethod_GetData1() {
|
|
::grpc::Service::MarkMethodCallback(0,
|
|
new ::grpc::internal::CallbackUnaryHandler< ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply>(
|
|
[this](
|
|
::grpc::CallbackServerContext* context, const ::market_data::CThostFtdcDepthMarketDataField* request, ::market_data::MsgReply* response) { return this->GetData1(context, request, response); }));}
|
|
void SetMessageAllocatorFor_GetData1(
|
|
::grpc::MessageAllocator< ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply>* allocator) {
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0);
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply>*>(handler)
|
|
->SetMessageAllocator(allocator);
|
|
}
|
|
~WithCallbackMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
virtual ::grpc::ServerUnaryReactor* GetData1(
|
|
::grpc::CallbackServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) { return nullptr; }
|
|
};
|
|
template <class BaseClass>
|
|
class WithCallbackMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithCallbackMethod_GetData2() {
|
|
::grpc::Service::MarkMethodCallback(1,
|
|
new ::grpc::internal::CallbackUnaryHandler< ::market_data::ResMsg, ::market_data::MsgReply>(
|
|
[this](
|
|
::grpc::CallbackServerContext* context, const ::market_data::ResMsg* request, ::market_data::MsgReply* response) { return this->GetData2(context, request, response); }));}
|
|
void SetMessageAllocatorFor_GetData2(
|
|
::grpc::MessageAllocator< ::market_data::ResMsg, ::market_data::MsgReply>* allocator) {
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1);
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::market_data::ResMsg, ::market_data::MsgReply>*>(handler)
|
|
->SetMessageAllocator(allocator);
|
|
}
|
|
~WithCallbackMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
virtual ::grpc::ServerUnaryReactor* GetData2(
|
|
::grpc::CallbackServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) { return nullptr; }
|
|
};
|
|
typedef WithCallbackMethod_GetData1<WithCallbackMethod_GetData2<Service > > CallbackService;
|
|
typedef CallbackService ExperimentalCallbackService;
|
|
template <class BaseClass>
|
|
class WithGenericMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithGenericMethod_GetData1() {
|
|
::grpc::Service::MarkMethodGeneric(0);
|
|
}
|
|
~WithGenericMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
};
|
|
template <class BaseClass>
|
|
class WithGenericMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithGenericMethod_GetData2() {
|
|
::grpc::Service::MarkMethodGeneric(1);
|
|
}
|
|
~WithGenericMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
};
|
|
template <class BaseClass>
|
|
class WithRawMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithRawMethod_GetData1() {
|
|
::grpc::Service::MarkMethodRaw(0);
|
|
}
|
|
~WithRawMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
void RequestGetData1(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
|
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
|
|
}
|
|
};
|
|
template <class BaseClass>
|
|
class WithRawMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithRawMethod_GetData2() {
|
|
::grpc::Service::MarkMethodRaw(1);
|
|
}
|
|
~WithRawMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
void RequestGetData2(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
|
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
|
|
}
|
|
};
|
|
template <class BaseClass>
|
|
class WithRawCallbackMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithRawCallbackMethod_GetData1() {
|
|
::grpc::Service::MarkMethodRawCallback(0,
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
|
|
[this](
|
|
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetData1(context, request, response); }));
|
|
}
|
|
~WithRawCallbackMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
virtual ::grpc::ServerUnaryReactor* GetData1(
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
|
|
};
|
|
template <class BaseClass>
|
|
class WithRawCallbackMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithRawCallbackMethod_GetData2() {
|
|
::grpc::Service::MarkMethodRawCallback(1,
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
|
|
[this](
|
|
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetData2(context, request, response); }));
|
|
}
|
|
~WithRawCallbackMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable synchronous version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
virtual ::grpc::ServerUnaryReactor* GetData2(
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
|
|
};
|
|
template <class BaseClass>
|
|
class WithStreamedUnaryMethod_GetData1 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithStreamedUnaryMethod_GetData1() {
|
|
::grpc::Service::MarkMethodStreamed(0,
|
|
new ::grpc::internal::StreamedUnaryHandler<
|
|
::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply>(
|
|
[this](::grpc::ServerContext* context,
|
|
::grpc::ServerUnaryStreamer<
|
|
::market_data::CThostFtdcDepthMarketDataField, ::market_data::MsgReply>* streamer) {
|
|
return this->StreamedGetData1(context,
|
|
streamer);
|
|
}));
|
|
}
|
|
~WithStreamedUnaryMethod_GetData1() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable regular version of this method
|
|
::grpc::Status GetData1(::grpc::ServerContext* /*context*/, const ::market_data::CThostFtdcDepthMarketDataField* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
// replace default version of method with streamed unary
|
|
virtual ::grpc::Status StreamedGetData1(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::market_data::CThostFtdcDepthMarketDataField,::market_data::MsgReply>* server_unary_streamer) = 0;
|
|
};
|
|
template <class BaseClass>
|
|
class WithStreamedUnaryMethod_GetData2 : public BaseClass {
|
|
private:
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
|
|
public:
|
|
WithStreamedUnaryMethod_GetData2() {
|
|
::grpc::Service::MarkMethodStreamed(1,
|
|
new ::grpc::internal::StreamedUnaryHandler<
|
|
::market_data::ResMsg, ::market_data::MsgReply>(
|
|
[this](::grpc::ServerContext* context,
|
|
::grpc::ServerUnaryStreamer<
|
|
::market_data::ResMsg, ::market_data::MsgReply>* streamer) {
|
|
return this->StreamedGetData2(context,
|
|
streamer);
|
|
}));
|
|
}
|
|
~WithStreamedUnaryMethod_GetData2() override {
|
|
BaseClassMustBeDerivedFromService(this);
|
|
}
|
|
// disable regular version of this method
|
|
::grpc::Status GetData2(::grpc::ServerContext* /*context*/, const ::market_data::ResMsg* /*request*/, ::market_data::MsgReply* /*response*/) override {
|
|
abort();
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
|
}
|
|
// replace default version of method with streamed unary
|
|
virtual ::grpc::Status StreamedGetData2(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::market_data::ResMsg,::market_data::MsgReply>* server_unary_streamer) = 0;
|
|
};
|
|
typedef WithStreamedUnaryMethod_GetData1<WithStreamedUnaryMethod_GetData2<Service > > StreamedUnaryService;
|
|
typedef Service SplitStreamedService;
|
|
typedef WithStreamedUnaryMethod_GetData1<WithStreamedUnaryMethod_GetData2<Service > > StreamedService;
|
|
};
|
|
|
|
} // namespace market_data
|
|
|
|
|
|
#endif // GRPC_market_5fdata_2eproto__INCLUDED
|