Cleanup generic server contexts

pull/24190/head
Vijay Pai 4 years ago
parent f05d6ed3b9
commit 346a00eb31
  1. 21
      include/grpcpp/impl/codegen/async_generic_service.h

@ -36,20 +36,13 @@ typedef ServerAsyncResponseWriter<ByteBuffer> GenericServerAsyncResponseWriter;
typedef ServerAsyncReader<ByteBuffer, ByteBuffer> GenericServerAsyncReader; typedef ServerAsyncReader<ByteBuffer, ByteBuffer> GenericServerAsyncReader;
typedef ServerAsyncWriter<ByteBuffer> GenericServerAsyncWriter; typedef ServerAsyncWriter<ByteBuffer> GenericServerAsyncWriter;
class GenericServerContext final : public ::grpc::ServerContext { class GenericServerContext final : public ServerContext {
public: public:
const std::string& method() const { return method_; } const std::string& method() const { return method_; }
const std::string& host() const { return host_; } const std::string& host() const { return host_; }
private: private:
friend class grpc::Server; friend class ServerInterface;
friend class grpc::ServerInterface;
void Clear() {
method_.clear();
host_.clear();
::grpc::ServerContext::Clear();
}
std::string method_; std::string method_;
std::string host_; std::string host_;
@ -95,21 +88,13 @@ namespace experimental {
/// ByteBuffer arguments. /// ByteBuffer arguments.
using ServerGenericBidiReactor = ServerBidiReactor<ByteBuffer, ByteBuffer>; using ServerGenericBidiReactor = ServerBidiReactor<ByteBuffer, ByteBuffer>;
class GenericCallbackServerContext final class GenericCallbackServerContext final : public grpc::CallbackServerContext {
: public ::grpc::CallbackServerContext {
public: public:
const std::string& method() const { return method_; } const std::string& method() const { return method_; }
const std::string& host() const { return host_; } const std::string& host() const { return host_; }
private: private:
friend class ::grpc::Server; friend class ::grpc::Server;
friend class ::grpc::ServerInterface;
void Clear() {
method_.clear();
host_.clear();
::grpc::CallbackServerContext::Clear();
}
std::string method_; std::string method_;
std::string host_; std::string host_;

Loading…
Cancel
Save