diff options
author | Yang Gao <yangg@google.com> | 2015-03-19 07:23:08 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-19 07:23:08 -0700 |
commit | 1fc046902c9885e33b0044496d1e2b80838340f9 (patch) | |
tree | 89bcfee60b0c5195378c76e7c6c7bdd6ea276a95 /include/grpc++/completion_queue.h | |
parent | 757afaeb3072a3f3d30d2054ce1a53af168c48ce (diff) | |
parent | 99f1c1ee7efcceae76bf3dce17417ce5dc0ca0d7 (diff) |
sync to head and run clang-format again
Diffstat (limited to 'include/grpc++/completion_queue.h')
-rw-r--r-- | include/grpc++/completion_queue.h | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index d98a8bbd5f..cb4ce50e93 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -89,46 +89,50 @@ class CompletionQueue { bool Next(void** tag, bool* ok) { return (AsyncNext(tag, ok, std::chrono::system_clock::time_point::max()) != SHUTDOWN); - } - - // Shutdown has to be called, and the CompletionQueue can only be - // destructed when false is returned from Next(). - void Shutdown(); - - grpc_completion_queue* cq() { return cq_; } - - private: - // Friend synchronous wrappers so that they can access Pluck(), which is - // a semi-private API geared towards the synchronous implementation. - template <class R> - friend class ::grpc::ClientReader; - template <class W> - friend class ::grpc::ClientWriter; - template <class R, class W> - friend class ::grpc::ClientReaderWriter; - template <class R> - friend class ::grpc::ServerReader; - template <class W> - friend class ::grpc::ServerWriter; - template <class R, class W> - friend class ::grpc::ServerReaderWriter; - friend class ::grpc::Server; - friend class ::grpc::ServerContext; - friend Status BlockingUnaryCall(ChannelInterface* channel, - const RpcMethod& method, - ClientContext* context, - const grpc::protobuf::Message& request, - grpc::protobuf::Message* result); - - // Wraps grpc_completion_queue_pluck. - // Cannot be mixed with calls to Next(). - bool Pluck(CompletionQueueTag* tag); - - // Does a single polling pluck on tag - void TryPluck(CompletionQueueTag* tag); - - grpc_completion_queue* cq_; // owned -}; + + bool Next(void** tag, bool* ok) { + return ( + AsyncNext(tag, ok, (std::chrono::system_clock::time_point::max)()) != + SHUTDOWN); + } + + // Shutdown has to be called, and the CompletionQueue can only be + // destructed when false is returned from Next(). + void Shutdown(); + + grpc_completion_queue* cq() { return cq_; } + + private: + // Friend synchronous wrappers so that they can access Pluck(), which is + // a semi-private API geared towards the synchronous implementation. + template <class R> + friend class ::grpc::ClientReader; + template <class W> + friend class ::grpc::ClientWriter; + template <class R, class W> + friend class ::grpc::ClientReaderWriter; + template <class R> + friend class ::grpc::ServerReader; + template <class W> + friend class ::grpc::ServerWriter; + template <class R, class W> + friend class ::grpc::ServerReaderWriter; + friend class ::grpc::Server; + friend class ::grpc::ServerContext; + friend Status BlockingUnaryCall( + ChannelInterface * channel, const RpcMethod& method, + ClientContext* context, const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); + + // Wraps grpc_completion_queue_pluck. + // Cannot be mixed with calls to Next(). + bool Pluck(CompletionQueueTag * tag); + + // Does a single polling pluck on tag + void TryPluck(CompletionQueueTag * tag); + + grpc_completion_queue* cq_; // owned + }; } // namespace grpc |