From abb991be25095dba3b77e7d7922e4a7d8faca917 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 25 Mar 2019 11:45:33 -0700 Subject: [PATCH] Further clarify some APIs by removing their comments from internal:: --- include/grpcpp/impl/codegen/server_callback.h | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/include/grpcpp/impl/codegen/server_callback.h b/include/grpcpp/impl/codegen/server_callback.h index 7421acc45bf..335d5709db6 100644 --- a/include/grpcpp/impl/codegen/server_callback.h +++ b/include/grpcpp/impl/codegen/server_callback.h @@ -40,13 +40,8 @@ namespace internal { class ServerReactor { public: virtual ~ServerReactor() = default; - - /// Notifies the application that all operations associated with this RPC - /// have completed. - virtual void OnDone() {} - - /// Notifies the application that this RPC has been cancelled. - virtual void OnCancel() {} + virtual void OnDone() = 0; + virtual void OnCancel() = 0; }; } // namespace internal @@ -276,6 +271,16 @@ class ServerBidiReactor : public internal::ServerReactor { /// will succeed. virtual void OnWriteDone(bool ok) {} + /// Notifies the application that all operations associated with this RPC + /// have completed. This is an override (from the internal base class) but not + /// final, so derived classes should override it if they want to take action. + void OnDone() override {} + + /// Notifies the application that this RPC has been cancelled. This is an + /// override (from the internal base class) but not final, so derived classes + /// should override it if they want to take action. + void OnCancel() override {} + private: friend class ServerCallbackReaderWriter; void BindStream(ServerCallbackReaderWriter* stream) { @@ -307,6 +312,8 @@ class ServerReadReactor : public internal::ServerReactor { /// The following notifications are exactly like ServerBidiReactor. virtual void OnSendInitialMetadataDone(bool ok) {} virtual void OnReadDone(bool ok) {} + void OnDone() override {} + void OnCancel() override {} private: friend class ServerCallbackReader; @@ -346,6 +353,8 @@ class ServerWriteReactor : public internal::ServerReactor { /// The following notifications are exactly like ServerBidiReactor. virtual void OnSendInitialMetadataDone(bool ok) {} virtual void OnWriteDone(bool ok) {} + void OnDone() override {} + void OnCancel() override {} private: friend class ServerCallbackWriter;