diff options
author | Yang Gao <yangg@google.com> | 2015-03-11 22:17:13 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-11 22:17:13 -0700 |
commit | 005eb88c45a849ed73d02e9cfbdce939ea34540e (patch) | |
tree | 410f33850cf1f0b7e4b7a2684dde77d60c254f9a /src/cpp | |
parent | 2fe6ecebee7937c96a76a16cf7449d8aa5b334bb (diff) |
Rename anonymous to generic globally
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/server/generic_service.cc (renamed from src/cpp/server/anonymous_service.cc) | 10 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 28 | ||||
-rw-r--r-- | src/cpp/server/server_builder.cc | 14 |
3 files changed, 26 insertions, 26 deletions
diff --git a/src/cpp/server/anonymous_service.cc b/src/cpp/server/generic_service.cc index ef20cade34..8ced775a67 100644 --- a/src/cpp/server/anonymous_service.cc +++ b/src/cpp/server/generic_service.cc @@ -31,16 +31,16 @@ * */ -#include <grpc++/anonymous_service.h> +#include <grpc++/generic_service.h> #include <grpc++/server.h> namespace grpc { -void AnonymousService::RequestCall(AnonymousServerContext* ctx, - GenericServerReaderWriter* reader_writer, - CompletionQueue* cq, void* tag) { - server_->RequestAsyncAnonymousCall(ctx, reader_writer, cq, tag); +void GenericService::RequestCall(GenericServerContext* ctx, + GenericServerReaderWriter* reader_writer, + CompletionQueue* cq, void* tag) { + server_->RequestGenericCall(ctx, reader_writer, cq, tag); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4328b2c075..44c8a768d2 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -37,8 +37,8 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> #include <grpc/support/log.h> -#include <grpc++/anonymous_service.h> #include <grpc++/completion_queue.h> +#include <grpc++/generic_service.h> #include <grpc++/impl/rpc_service_method.h> #include <grpc++/impl/service_type.h> #include <grpc++/server_context.h> @@ -227,9 +227,9 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { return true; } -void Server::RegisterAnonymousService(AnonymousService* service) { +void Server::RegisterGenericService(GenericService* service) { GPR_ASSERT(service->server_ == nullptr && - "Can only register an anonymous service against one server."); + "Can only register an generic service against one server."); service->server_ = this; } @@ -296,7 +296,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { stream_(stream), cq_(cq), ctx_(ctx), - anonymous_ctx_(nullptr), + generic_ctx_(nullptr), server_(server), call_(nullptr), payload_(nullptr) { @@ -307,7 +307,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { &array_, request ? &payload_ : nullptr, cq->cq(), this); } - AsyncRequest(Server* server, AnonymousServerContext* ctx, + AsyncRequest(Server* server, GenericServerContext* ctx, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) : tag_(tag), @@ -315,7 +315,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { stream_(stream), cq_(cq), ctx_(nullptr), - anonymous_ctx_(ctx), + generic_ctx_(ctx), server_(server), call_(nullptr), payload_(nullptr) { @@ -343,7 +343,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { *status = false; } } - ServerContext* ctx = ctx_ ? ctx_ : anonymous_ctx_; + ServerContext* ctx = ctx_ ? ctx_ : generic_ctx_; GPR_ASSERT(ctx); if (*status) { ctx->deadline_ = Timespec2Timepoint(call_details_.deadline); @@ -354,9 +354,9 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { array_.metadata[i].value, array_.metadata[i].value + array_.metadata[i].value_length))); } - if (anonymous_ctx_) { - anonymous_ctx_->method_ = call_details_.method; - anonymous_ctx_->host_ = call_details_.host; + if (generic_ctx_) { + generic_ctx_->method_ = call_details_.method; + generic_ctx_->host_ = call_details_.host; } } ctx->call_ = call_; @@ -376,7 +376,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { ServerAsyncStreamingInterface* const stream_; CompletionQueue* const cq_; ServerContext* const ctx_; - AnonymousServerContext* const anonymous_ctx_; + GenericServerContext* const generic_ctx_; Server* const server_; grpc_call* call_; grpc_call_details call_details_; @@ -391,9 +391,9 @@ void Server::RequestAsyncCall(void* registered_method, ServerContext* context, new AsyncRequest(this, registered_method, context, request, stream, cq, tag); } -void Server::RequestAsyncAnonymousCall(AnonymousServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag) { +void Server::RequestGenericCall(GenericServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag) { new AsyncRequest(this, context, stream, cq, tag); } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index e3b9cdfd7f..083509e797 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -42,7 +42,7 @@ namespace grpc { ServerBuilder::ServerBuilder() - : anonymous_service_(nullptr), thread_pool_(nullptr) {} + : generic_service_(nullptr), thread_pool_(nullptr) {} void ServerBuilder::RegisterService(SynchronousService* service) { services_.push_back(service->service()); @@ -52,14 +52,14 @@ void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { async_services_.push_back(service); } -void ServerBuilder::RegisterAnonymousService(AnonymousService* service) { - if (anonymous_service_) { +void ServerBuilder::RegisterGenericService(GenericService* service) { + if (generic_service_) { gpr_log(GPR_ERROR, - "Adding multiple AnonymousService is unsupported for now. " + "Adding multiple GenericService is unsupported for now. " "Dropping the service %p", service); return; } - anonymous_service_ = service; + generic_service_ = service; } void ServerBuilder::AddPort(const grpc::string& addr, @@ -95,8 +95,8 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() { return nullptr; } } - if (anonymous_service_) { - server->RegisterAnonymousService(anonymous_service_); + if (generic_service_) { + server->RegisterGenericService(generic_service_); } for (auto& port : ports_) { int r = server->AddPort(port.addr, port.creds.get()); |