Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
Added missing ServerCall::Write*() overloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
benh committed Jul 16, 2020
1 parent 447982b commit 4933118
Showing 1 changed file with 58 additions and 10 deletions.
68 changes: 58 additions & 10 deletions stout/grpc/server-call.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ class ServerCall<Request, Stream<Response>> : public ServerCallBase
template <typename Callback>
ServerCallStatus Write(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions(),
Callback&& callback = std::function<void(bool)>())
const ::grpc::WriteOptions& options,
Callback&& callback)
{
return ServerCallBase::Write(
response,
Expand All @@ -191,14 +191,27 @@ class ServerCall<Request, Stream<Response>> : public ServerCallBase
const Response& response,
Callback&& callback)
{
return ServerCallBase::Write(response, std::forward<Callback>(callback));
return ServerCallBase::Write(
response,
::grpc::WriteOptions(),
std::forward<Callback>(callback));
}

ServerCallStatus Write(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions())
{
return ServerCallBase::Write(
response,
options,
std::function<void(bool)>());
}

template <typename Callback>
ServerCallStatus WriteLast(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions(),
Callback&& callback = std::function<void(bool)>())
const ::grpc::WriteOptions& options,
Callback&& callback)
{
return ServerCallBase::WriteLast(
response,
Expand All @@ -213,9 +226,20 @@ class ServerCall<Request, Stream<Response>> : public ServerCallBase
{
return ServerCallBase::WriteLast(
response,
::grpc::WriteOptions(),
std::forward<Callback>(callback));
}

ServerCallStatus WriteLast(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions())
{
return ServerCallBase::WriteLast(
response,
options,
std::function<void(bool)>());
}

template <typename Callback>
ServerCallStatus WriteAndFinish(
const Response& response,
Expand Down Expand Up @@ -288,8 +312,8 @@ class ServerCall<Stream<Request>, Stream<Response>> : public ServerCallBase
template <typename Callback>
ServerCallStatus Write(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions(),
Callback&& callback = std::function<void(bool)>())
const ::grpc::WriteOptions& options,
Callback&& callback)
{
return ServerCallBase::Write(
response,
Expand All @@ -302,14 +326,27 @@ class ServerCall<Stream<Request>, Stream<Response>> : public ServerCallBase
const Response& response,
Callback&& callback)
{
return ServerCallBase::Write(response, std::forward<Callback>(callback));
return ServerCallBase::Write(
response,
::grpc::WriteOptions(),
std::forward<Callback>(callback));
}

ServerCallStatus Write(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions())
{
return ServerCallBase::Write(
response,
options,
std::function<void(bool)>());
}

template <typename Callback>
ServerCallStatus WriteLast(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions(),
Callback&& callback = std::function<void(bool)>())
const ::grpc::WriteOptions& options,
Callback&& callback)
{
return ServerCallBase::WriteLast(
response,
Expand All @@ -324,9 +361,20 @@ class ServerCall<Stream<Request>, Stream<Response>> : public ServerCallBase
{
return ServerCallBase::WriteLast(
response,
::grpc::WriteOptions(),
std::forward<Callback>(callback));
}

ServerCallStatus WriteLast(
const Response& response,
const ::grpc::WriteOptions& options = ::grpc::WriteOptions())
{
return ServerCallBase::WriteLast(
response,
options,
std::function<void(bool)>());
}

template <typename Callback>
ServerCallStatus WriteAndFinish(
const Response& response,
Expand Down

0 comments on commit 4933118

Please sign in to comment.