Do a debug-check of API use

pull/22524/head
Vijay Pai 5 years ago committed by GitHub
parent 03fffe0fcb
commit 397b3ee72e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      include/grpcpp/impl/codegen/client_callback_impl.h

@ -269,7 +269,10 @@ class ClientBidiReactor {
/// calls plus the number of holds added by AddMultipleHolds.
/// The argument to AddMultipleHolds must be positive.
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) { stream_->AddHold(holds); }
void AddMultipleHolds(int holds) {
GPR_CODEGEN_DEBUG_ASSERT(holds > 0);
stream_->AddHold(holds);
}
void RemoveHold() { stream_->RemoveHold(); }
/// Notifies the application that all operations associated with this RPC
@ -332,7 +335,10 @@ class ClientReadReactor {
void StartRead(Response* resp) { reader_->Read(resp); }
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) { reader_->AddHold(holds); }
void AddMultipleHolds(int holds) {
GPR_CODEGEN_DEBUG_ASSERT(holds > 0);
reader_->AddHold(holds);
}
void RemoveHold() { reader_->RemoveHold(); }
virtual void OnDone(const ::grpc::Status& /*s*/) {}
@ -365,7 +371,10 @@ class ClientWriteReactor {
void StartWritesDone() { writer_->WritesDone(); }
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) { writer_->AddHold(holds); }
void AddMultipleHolds(int holds) {
GPR_CODEGEN_DEBUG_ASSERT(holds > 0);
writer_->AddHold(holds);
}
void RemoveHold() { writer_->RemoveHold(); }
virtual void OnDone(const ::grpc::Status& /*s*/) {}

Loading…
Cancel
Save