aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/impl/codegen/completion_queue.h
diff options
context:
space:
mode:
authorGravatar makdharma <>2018-02-23 14:51:46 -0800
committerGravatar makdharma <>2018-02-23 14:51:46 -0800
commit8065000697a6225d76ebbcc8b7eca9f01a9be474 (patch)
tree631957652131f23d1fe5c8397bad376d7394df02 /include/grpcpp/impl/codegen/completion_queue.h
parent5699cfcd4537df3a4358034fcfefed1ccc5a66a2 (diff)
Remove "final" keyword and make methods protected.
This adds extensibility to the API and makes custom implementation of the server possible.
Diffstat (limited to 'include/grpcpp/impl/codegen/completion_queue.h')
-rw-r--r--include/grpcpp/impl/codegen/completion_queue.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/grpcpp/impl/codegen/completion_queue.h b/include/grpcpp/impl/codegen/completion_queue.h
index 80c7c41982..5ba70e2e66 100644
--- a/include/grpcpp/impl/codegen/completion_queue.h
+++ b/include/grpcpp/impl/codegen/completion_queue.h
@@ -165,7 +165,7 @@ class CompletionQueue : private GrpcLibraryCodegen {
///
/// \return true if got an event, false if the queue is fully drained and
/// shut down.
- bool Next(void** tag, bool* ok) {
+ virtual bool Next(void** tag, bool* ok) {
return (AsyncNextInternal(tag, ok,
g_core_codegen_interface->gpr_inf_future(
GPR_CLOCK_REALTIME)) != SHUTDOWN);
@@ -365,9 +365,7 @@ class ServerCompletionQueue : public CompletionQueue {
public:
bool IsFrequentlyPolled() { return polling_type_ != GRPC_CQ_NON_LISTENING; }
- private:
- grpc_cq_polling_type polling_type_;
- friend class ServerBuilder;
+ protected:
/// \param is_frequently_polled Informs the GRPC library about whether the
/// server completion queue would be actively polled (by calling Next() or
/// AsyncNext()). By default all server completion queues are assumed to be
@@ -376,6 +374,10 @@ class ServerCompletionQueue : public CompletionQueue {
: CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, polling_type}),
polling_type_(polling_type) {}
+
+ private:
+ grpc_cq_polling_type polling_type_;
+ friend class ServerBuilder;
};
} // namespace grpc