// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: trading.proto

#include "trading.pb.h"
#include "trading.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 trading {

static const char* TradingService_method_names[] = {
  "/trading.TradingService/SendOrder",
  "/trading.TradingService/StreamMarketData",
};

std::unique_ptr< TradingService::Stub> TradingService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
  (void)options;
  std::unique_ptr< TradingService::Stub> stub(new TradingService::Stub(channel, options));
  return stub;
}

TradingService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
  : channel_(channel), rpcmethod_SendOrder_(TradingService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
  , rpcmethod_StreamMarketData_(TradingService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
  {}

::grpc::Status TradingService::Stub::SendOrder(::grpc::ClientContext* context, const ::trading::Order& request, ::trading::OrderAck* response) {
  return ::grpc::internal::BlockingUnaryCall< ::trading::Order, ::trading::OrderAck, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SendOrder_, context, request, response);
}

void TradingService::Stub::async::SendOrder(::grpc::ClientContext* context, const ::trading::Order* request, ::trading::OrderAck* response, std::function<void(::grpc::Status)> f) {
  ::grpc::internal::CallbackUnaryCall< ::trading::Order, ::trading::OrderAck, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SendOrder_, context, request, response, std::move(f));
}

void TradingService::Stub::async::SendOrder(::grpc::ClientContext* context, const ::trading::Order* request, ::trading::OrderAck* response, ::grpc::ClientUnaryReactor* reactor) {
  ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SendOrder_, context, request, response, reactor);
}

::grpc::ClientAsyncResponseReader< ::trading::OrderAck>* TradingService::Stub::PrepareAsyncSendOrderRaw(::grpc::ClientContext* context, const ::trading::Order& request, ::grpc::CompletionQueue* cq) {
  return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::trading::OrderAck, ::trading::Order, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SendOrder_, context, request);
}

::grpc::ClientAsyncResponseReader< ::trading::OrderAck>* TradingService::Stub::AsyncSendOrderRaw(::grpc::ClientContext* context, const ::trading::Order& request, ::grpc::CompletionQueue* cq) {
  auto* result =
    this->PrepareAsyncSendOrderRaw(context, request, cq);
  result->StartCall();
  return result;
}

::grpc::ClientReader< ::trading::MarketData>* TradingService::Stub::StreamMarketDataRaw(::grpc::ClientContext* context, const ::trading::MarketRequest& request) {
  return ::grpc::internal::ClientReaderFactory< ::trading::MarketData>::Create(channel_.get(), rpcmethod_StreamMarketData_, context, request);
}

void TradingService::Stub::async::StreamMarketData(::grpc::ClientContext* context, const ::trading::MarketRequest* request, ::grpc::ClientReadReactor< ::trading::MarketData>* reactor) {
  ::grpc::internal::ClientCallbackReaderFactory< ::trading::MarketData>::Create(stub_->channel_.get(), stub_->rpcmethod_StreamMarketData_, context, request, reactor);
}

::grpc::ClientAsyncReader< ::trading::MarketData>* TradingService::Stub::AsyncStreamMarketDataRaw(::grpc::ClientContext* context, const ::trading::MarketRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
  return ::grpc::internal::ClientAsyncReaderFactory< ::trading::MarketData>::Create(channel_.get(), cq, rpcmethod_StreamMarketData_, context, request, true, tag);
}

::grpc::ClientAsyncReader< ::trading::MarketData>* TradingService::Stub::PrepareAsyncStreamMarketDataRaw(::grpc::ClientContext* context, const ::trading::MarketRequest& request, ::grpc::CompletionQueue* cq) {
  return ::grpc::internal::ClientAsyncReaderFactory< ::trading::MarketData>::Create(channel_.get(), cq, rpcmethod_StreamMarketData_, context, request, false, nullptr);
}

TradingService::Service::Service() {
  AddMethod(new ::grpc::internal::RpcServiceMethod(
      TradingService_method_names[0],
      ::grpc::internal::RpcMethod::NORMAL_RPC,
      new ::grpc::internal::RpcMethodHandler< TradingService::Service, ::trading::Order, ::trading::OrderAck, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
          [](TradingService::Service* service,
             ::grpc::ServerContext* ctx,
             const ::trading::Order* req,
             ::trading::OrderAck* resp) {
               return service->SendOrder(ctx, req, resp);
             }, this)));
  AddMethod(new ::grpc::internal::RpcServiceMethod(
      TradingService_method_names[1],
      ::grpc::internal::RpcMethod::SERVER_STREAMING,
      new ::grpc::internal::ServerStreamingHandler< TradingService::Service, ::trading::MarketRequest, ::trading::MarketData>(
          [](TradingService::Service* service,
             ::grpc::ServerContext* ctx,
             const ::trading::MarketRequest* req,
             ::grpc::ServerWriter<::trading::MarketData>* writer) {
               return service->StreamMarketData(ctx, req, writer);
             }, this)));
}

TradingService::Service::~Service() {
}

::grpc::Status TradingService::Service::SendOrder(::grpc::ServerContext* context, const ::trading::Order* request, ::trading::OrderAck* response) {
  (void) context;
  (void) request;
  (void) response;
  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}

::grpc::Status TradingService::Service::StreamMarketData(::grpc::ServerContext* context, const ::trading::MarketRequest* request, ::grpc::ServerWriter< ::trading::MarketData>* writer) {
  (void) context;
  (void) request;
  (void) writer;
  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}


}  // namespace trading

