Skip to content

Commit

Permalink
style: Remove SenderImplementationType and simplify stop_function_arg…
Browse files Browse the repository at this point in the history
… in client rpc sender implementations
  • Loading branch information
Tradias committed Sep 16, 2024
1 parent 1d756d4 commit 730de58
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 103 deletions.
2 changes: 1 addition & 1 deletion src/agrpc/detail/alarm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ struct AlarmCancellationFunction
template <class Executor>
struct MoveAlarmSenderImplementation
{
static constexpr auto TYPE = detail::SenderImplementationType::GRPC_TAG;
static constexpr bool NEEDS_ON_COMPLETE = true;

using BaseType = detail::GrpcTagOperationBase;
using Alarm = agrpc::BasicAlarm<Executor>;
using Signature = void(bool, Alarm);
using StopFunction = detail::AlarmCancellationFunction;
Expand Down
1 change: 0 additions & 1 deletion src/agrpc/detail/asio_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void complete_immediately(CompletionHandler&& completion_handler, Function&& fun

struct UncancellableSlot
{
static constexpr bool is_connected() noexcept { return false; }
};

template <class Object>
Expand Down
16 changes: 8 additions & 8 deletions src/agrpc/detail/basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ struct BasicSenderAccess
};

template <class ImplementationT, class Receiver>
class BasicSenderRunningOperation : public detail::BaseForSenderImplementationTypeT<ImplementationT::TYPE>
class BasicSenderRunningOperation : public ImplementationT::BaseType
{
public:
using Implementation = ImplementationT;

private:
using Base = detail::BaseForSenderImplementationTypeT<Implementation::TYPE>;
using StopFunction = typename Implementation::StopFunction;
using Base = typename ImplementationT::BaseType;
using StopFunction = typename ImplementationT::StopFunction;
using StopToken = exec::stop_token_type_t<Receiver&>;
using StopCallback = detail::StopCallbackLifetime<StopToken, StopFunction>;

Expand Down Expand Up @@ -165,13 +165,13 @@ class BasicSenderRunningOperation : public detail::BaseForSenderImplementationTy

public:
template <class R>
BasicSenderRunningOperation(R&& receiver, Implementation&& implementation)
: Base(&do_complete), impl_(static_cast<R&&>(receiver), static_cast<Implementation&&>(implementation))
BasicSenderRunningOperation(R&& receiver, ImplementationT&& implementation)
: Base(&do_complete), impl_(static_cast<R&&>(receiver), static_cast<ImplementationT&&>(implementation))
{
}

template <class R>
BasicSenderRunningOperation(R&& receiver, const Implementation& implementation)
BasicSenderRunningOperation(R&& receiver, const ImplementationT& implementation)
: Base(&do_complete), impl_(static_cast<R&&>(receiver), implementation)
{
}
Expand All @@ -188,7 +188,7 @@ class BasicSenderRunningOperation : public detail::BaseForSenderImplementationTy

StopCallback& stop_callback() noexcept { return impl_.first().second(); }

Implementation& implementation() noexcept { return impl_.second(); }
ImplementationT& implementation() noexcept { return impl_.second(); }

Base* tag() noexcept { return this; }

Expand Down Expand Up @@ -221,7 +221,7 @@ class BasicSenderRunningOperation : public detail::BaseForSenderImplementationTy
void restore_scratch_space() noexcept { detail::OperationBaseAccess::set_on_complete(*this, &do_complete); }

private:
detail::CompressedPair<detail::CompressedPair<Receiver, StopCallback>, Implementation> impl_;
detail::CompressedPair<detail::CompressedPair<Receiver, StopCallback>, ImplementationT> impl_;
};

template <class Initiation, class Implementation, class Receiver>
Expand Down
65 changes: 22 additions & 43 deletions src/agrpc/detail/client_rpc_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ struct ClientContextCancellationFunction

struct StatusSenderImplementationBase
{
static constexpr auto TYPE = detail::SenderImplementationType::GRPC_TAG;
static constexpr bool NEEDS_ON_COMPLETE = true;

using BaseType = detail::GrpcTagOperationBase;
using Signature = void(grpc::Status);
using StopFunction = detail::ClientContextCancellationFunction;

Expand Down Expand Up @@ -222,6 +222,15 @@ struct ClientRPCGrpcSenderImplementation : detail::GrpcSenderImplementationBase
using StopFunction = detail::ClientContextCancellationFunction;
};

struct ClientRPCSenderInitiationBase
{
template <class Impl>
static auto& stop_function_arg(Impl& impl) noexcept
{
return impl.rpc_.context();
}
};

using ClientStreamingRequestSenderImplementation = ClientRPCGrpcSenderImplementation;

// Read initial metadata readable stream
Expand Down Expand Up @@ -287,12 +296,11 @@ struct ClientWriteSenderImplementation : ClientRPCGrpcSenderImplementation
};

template <class Request>
struct ClientWriteSenderInitiation
struct ClientWriteSenderInitiation : ClientRPCSenderInitiationBase
{
template <class Responder>
auto& stop_function_arg(ClientWriteSenderImplementation<Responder>& impl) const noexcept
ClientWriteSenderInitiation(const Request& request, grpc::WriteOptions options)
: request_(request), options_(options)
{
return impl.rpc_.context();
}

template <class Responder>
Expand All @@ -310,15 +318,8 @@ struct ClientWriteSenderInitiation
template <class Responder>
using ClientReadInitialMetadataWritableStreamSenderImplementation = ClientWriteSenderImplementation<Responder>;

struct ClientReadInitialMetadataWritableStreamSenderInitiation
struct ClientReadInitialMetadataWritableStreamSenderInitiation : ClientRPCSenderInitiationBase
{
template <class Responder>
static auto& stop_function_arg(
ClientReadInitialMetadataWritableStreamSenderImplementation<Responder>& impl) noexcept
{
return impl.rpc_.context();
}

template <class Responder>
static void initiate(const agrpc::GrpcContext&,
ClientReadInitialMetadataWritableStreamSenderImplementation<Responder>& impl, void* tag)
Expand All @@ -338,14 +339,8 @@ struct ClientWritesDoneSenderImplementation : ClientRPCGrpcSenderImplementation
detail::ClientRPCContextBase<Responder>& rpc_;
};

struct ClientWritesDoneSenderInitiation
struct ClientWritesDoneSenderInitiation : ClientRPCSenderInitiationBase
{
template <class Responder>
static auto& stop_function_arg(const ClientWritesDoneSenderImplementation<Responder>& impl) noexcept
{
return impl.rpc_.context();
}

template <class Responder>
static void initiate(const agrpc::GrpcContext&, const ClientWritesDoneSenderImplementation<Responder>& impl,
void* tag)
Expand All @@ -364,7 +359,7 @@ struct ClientFinishWritableStreamSenderImplementation : StatusSenderImplementati
void complete(OnComplete<0> on_complete, bool)
{
on_complete.grpc_context().work_started();
ClientRPCAccess::responder(rpc_).Finish(&status_, on_complete.template self<1>());
ClientRPCAccess::responder(rpc_).Finish(&status_, on_complete.template tag<1>());
}

template <template <int> class OnComplete>
Expand All @@ -377,24 +372,18 @@ struct ClientFinishWritableStreamSenderImplementation : StatusSenderImplementati
detail::ClientRPCContextBase<Responder>& rpc_;
};

struct ClientFinishWritableStreamSenderInitiation
struct ClientFinishWritableStreamSenderInitiation : ClientRPCSenderInitiationBase
{
template <class Responder>
static auto& stop_function_arg(const ClientFinishWritableStreamSenderImplementation<Responder>& impl) noexcept
{
return impl.rpc_.context();
}

template <class Init, class Responder>
static void initiate(Init init, ClientFinishWritableStreamSenderImplementation<Responder>& impl)
{
if (ClientRPCAccess::is_writes_done(impl.rpc_))
{
ClientRPCAccess::responder(impl.rpc_).Finish(&impl.status_, init.template self<1>());
ClientRPCAccess::responder(impl.rpc_).Finish(&impl.status_, init.template tag<1>());
}
else
{
ClientRPCAccess::responder(impl.rpc_).WritesDone(init.template self<0>());
ClientRPCAccess::responder(impl.rpc_).WritesDone(init.template tag<0>());
}
}
};
Expand Down Expand Up @@ -422,13 +411,9 @@ struct ClientFinishReadableStreamSenderImplementation<Responder<Response>> : Sta
};

template <class Response>
struct ClientFinishUnarySenderInitation
struct ClientFinishUnarySenderInitation : ClientRPCSenderInitiationBase
{
template <class Responder>
static auto& stop_function_arg(const ClientFinishReadableStreamSenderImplementation<Responder>& impl) noexcept
{
return impl.rpc_.context();
}
explicit ClientFinishUnarySenderInitation(Response& response) noexcept : response_(response) {}

template <class Responder>
void initiate(const agrpc::GrpcContext&, ClientFinishReadableStreamSenderImplementation<Responder>& impl,
Expand All @@ -440,14 +425,8 @@ struct ClientFinishUnarySenderInitation
Response& response_;
};

struct ClientFinishServerStreamingSenderInitation
struct ClientFinishServerStreamingSenderInitation : ClientRPCSenderInitiationBase
{
template <class Responder>
static auto& stop_function_arg(const ClientFinishReadableStreamSenderImplementation<Responder>& impl) noexcept
{
return impl.rpc_.context();
}

template <class Responder>
static void initiate(const agrpc::GrpcContext&, ClientFinishReadableStreamSenderImplementation<Responder>& impl,
void* tag)
Expand Down
2 changes: 1 addition & 1 deletion src/agrpc/detail/create_and_submit_no_arg_operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <agrpc/detail/allocate_operation.hpp>
#include <agrpc/detail/grpc_context_implementation.hpp>
#include <agrpc/detail/operation.hpp>
#include <agrpc/detail/no_arg_operation.hpp>
#include <agrpc/grpc_context.hpp>

#include <agrpc/detail/config.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/agrpc/detail/grpc_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace detail
{
struct GrpcSenderImplementationBase
{
static constexpr auto TYPE = detail::SenderImplementationType::GRPC_TAG;
static constexpr bool NEEDS_ON_COMPLETE = false;

using BaseType = detail::GrpcTagOperationBase;
using Signature = void(bool);
using StopFunction = detail::Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AGRPC_DETAIL_OPERATION_HPP
#define AGRPC_DETAIL_OPERATION_HPP
#ifndef AGRPC_DETAIL_NO_ARG_OPERATION_HPP
#define AGRPC_DETAIL_NO_ARG_OPERATION_HPP

#include <agrpc/detail/allocate.hpp>
#include <agrpc/detail/allocation_type.hpp>
Expand All @@ -28,10 +28,10 @@ AGRPC_NAMESPACE_BEGIN()
namespace detail
{
template <class Handler>
class NoArgOperation : public detail::QueueableOperationBase
class NoArgOperation : public detail::NoArgOperationBase
{
private:
using Base = detail::QueueableOperationBase;
using Base = detail::NoArgOperationBase;

template <bool UseLocalAllocator>
static void do_complete(detail::OperationBase* op, OperationResult result, agrpc::GrpcContext&)
Expand Down Expand Up @@ -71,4 +71,4 @@ class NoArgOperation : public detail::QueueableOperationBase

AGRPC_NAMESPACE_END

#endif // AGRPC_DETAIL_OPERATION_HPP
#endif // AGRPC_DETAIL_NO_ARG_OPERATION_HPP
3 changes: 3 additions & 0 deletions src/agrpc/detail/operation_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class QueueableOperationBase : public detail::OperationBase
QueueableOperationBase* next_;
};

using NoArgOperationBase = detail::QueueableOperationBase;
using GrpcTagOperationBase = detail::OperationBase;

struct OperationBaseAccess
{
static void set_on_complete(detail::OperationBase& operation, OperationOnComplete on_complete) noexcept
Expand Down
8 changes: 5 additions & 3 deletions src/agrpc/detail/operation_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ template <class Operation, detail::AllocationType AllocType>
struct BasicOperationHandle
{
template <int Id = 0>
struct Type
class Type
{
static constexpr auto ALLOCATION_TYPE = AllocType;
public:
Type(Operation& self, agrpc::GrpcContext& grpc_context) noexcept : self_(self), grpc_context_(grpc_context) {}

template <class... Args>
void operator()(Args&&... args)
Expand All @@ -42,7 +43,7 @@ struct BasicOperationHandle
void done() { self_.done(); }

template <int NextId = Id>
[[nodiscard]] auto* self() const noexcept
[[nodiscard]] auto* tag() const noexcept
{
if constexpr (NextId != Id)
{
Expand All @@ -53,6 +54,7 @@ struct BasicOperationHandle

[[nodiscard]] agrpc::GrpcContext& grpc_context() const noexcept { return grpc_context_; }

private:
Operation& self_;
agrpc::GrpcContext& grpc_context_;
};
Expand Down
3 changes: 1 addition & 2 deletions src/agrpc/detail/operation_implementation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ void complete(Operation& operation, [[maybe_unused]] detail::OperationResult res
operation.template complete<AllocType>(static_cast<decltype(args)&&>(args)...);
}
};
if constexpr (Implementation::TYPE == detail::SenderImplementationType::BOTH ||
Implementation::TYPE == detail::SenderImplementationType::GRPC_TAG)
if constexpr (std::is_same_v<detail::GrpcTagOperationBase, typename Operation::Base>)

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::s::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::s::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::s::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::s::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::b::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::b::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::b::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::b::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::u::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::s::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::s::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::s::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::s::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::b::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::b::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using NoArgOperationBase = class agrpc::b::detail::QueueableOperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Default

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::b::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/22.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::u::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/22.04/GCC

‘using Base = using BaseType = using GrpcTagOperationBase = class agrpc::e::detail::OperationBase’ is private within this context

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>, agrpc::detail::SubmitToFunctionReceiver<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<gpr_timespec>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, agrpc::detail::ProcessTag>::Wrap>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>, agrpc::detail::SubmitToFunctionReceiver<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<gpr_timespec>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, agrpc::detail::ProcessTag>::Wrap>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::Example::Stub::PrepareAsyncUnary>, unifex::_final::_receiver<agrpc::detail::BasicSender<agrpc::detail::ClientUnaryRequestSenderInitiation<example::v1::Response>, agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::Example::Stub::PrepareAsyncUnary>> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, grpc::Status>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::ExampleExt::Stub::PrepareAsyncSlowUnary>, unifex::_stop_when::_srcvr<agrpc::detail::BasicSender<agrpc::detail::ClientUnaryRequestSenderInitiation<google::protobuf::Empty>, agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::ExampleExt::Stub::PrepareAsyncSlowUnary>> &&, unifex::_then::_sender<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<std::chrono::time_point<std::chrono::system_clock>>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, (lambda at /Users/runner/work/asio-grpc/asio-grpc/example/unifex-client.cpp:156:86)>::type &&, unifex::_final::_receiver<unifex::_stop_when::_sndr<agrpc::detail::BasicSender<agrpc::detail::ClientUnaryRequestSenderInitiation<google::protobuf::Empty>, agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::ExampleExt::Stub::PrepareAsyncSlowUnary>>, unifex::_then::_sender<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<std::chrono::time_point<std::chrono::system_clock>>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, (lambda at /Users/runner/work/asio-grpc/asio-grpc/example/unifex-client.cpp:156:86)>::type>::type &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, grpc::Status>::type::_rec>::type>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>, unifex::_then::_receiver<unifex::_stop_when::_trcvr<agrpc::detail::BasicSender<agrpc::detail::ClientUnaryRequestSenderInitiation<google::protobuf::Empty>, agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::ExampleExt::Stub::PrepareAsyncSlowUnary>> &&, unifex::_then::_sender<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<std::chrono::time_point<std::chrono::system_clock>>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, (lambda at /Users/runner/work/asio-grpc/asio-grpc/example/unifex-client.cpp:156:86)>::type &&, unifex::_final::_receiver<unifex::_stop_when::_sndr<agrpc::detail::BasicSender<agrpc::detail::ClientUnaryRequestSenderInitiation<google::protobuf::Empty>, agrpc::detail::ClientUnaryRequestSenderImplementation<&example::v1::ExampleExt::Stub::PrepareAsyncSlowUnary>>, unifex::_then::_sender<agrpc::detail::BasicSender<agrpc::detail::MoveAlarmSenderInitiation<std::chrono::time_point<std::chrono::system_clock>>, agrpc::detail::SenderMoveAlarmSenderImplementation<agrpc::BasicGrpcExecutor<>>>, (lambda at /Users/runner/work/asio-grpc/asio-grpc/example/unifex-client.cpp:156:86)>::type>::type &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, grpc::Status>::type::_rec>::type>::type, (lambda at /Users/runner/work/asio-grpc/asio-grpc/example/unifex-client.cpp:156:86)>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::ServerRPCGrpcSenderImplementation, unifex::_final::_receiver<agrpc::detail::BasicSender<agrpc::detail::ServerWriteSenderInitiation<grpc::ServerAsyncWriter<example::v1::Response>>, agrpc::detail::ServerRPCGrpcSenderImplementation> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::ServerFinishSenderImplementation<grpc::ServerAsyncWriter<example::v1::Response>>, unifex::_final::_receiver<agrpc::detail::BasicSender<agrpc::detail::ServerFinishSenderInitation, agrpc::detail::ServerFinishSenderImplementation<grpc::ServerAsyncWriter<example::v1::Response>>> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::SenderAlarmSenderImplementation, unifex::_final::_receiver<agrpc::detail::BasicSender<agrpc::detail::GrpcSenderInitiation<agrpc::detail::AlarmInitFunction<std::chrono::time_point<std::chrono::system_clock>>>, agrpc::detail::SenderAlarmSenderImplementation> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, void>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / MacOSX/13/AppleClang

'Base' is a private member of 'agrpc::detail::BasicSenderRunningOperation<agrpc::detail::ServerFinishSenderImplementation<grpc::ServerAsyncResponseWriter<google::protobuf::Empty>>, unifex::_final::_receiver<agrpc::detail::BasicSender<agrpc::detail::ServerFinishWithMessageInitation<google::protobuf::Empty>, agrpc::detail::ServerFinishSenderImplementation<grpc::ServerAsyncResponseWriter<google::protobuf::Empty>>> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type>>::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::SenderMoveAlarmSenderImplementation<agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, agrpc::u::detail::SubmitToFunctionReceiver<agrpc::u::detail::BasicSender<agrpc::u::detail::MoveAlarmSenderInitiation<gpr_timespec>, agrpc::u::detail::SenderMoveAlarmSenderImplementation<agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> > >, agrpc::u::detail::ProcessTag>::Wrap>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerRPCGrpcSenderImplementation, unifex::_final::_receiver<agrpc::u::detail::BasicSender<agrpc::u::detail::ServerWriteSenderInitiation<grpc::ServerAsyncWriter<example::v1::Response> >, agrpc::u::detail::ServerRPCGrpcSenderImplementation> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<&unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type> >::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerFinishSenderImplementation<grpc::ServerAsyncWriter<example::v1::Response> >, unifex::_final::_receiver<agrpc::u::detail::BasicSender<agrpc::u::detail::ServerFinishSenderInitation, agrpc::u::detail::ServerFinishSenderImplementation<grpc::ServerAsyncWriter<example::v1::Response> > > &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<&unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type> >::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::SenderAlarmSenderImplementation, unifex::_final::_receiver<agrpc::u::detail::BasicSender<agrpc::u::detail::GrpcSenderInitiation<agrpc::u::detail::AlarmInitFunction<std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > > > >, agrpc::u::detail::SenderAlarmSenderImplementation> &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<&unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type> >::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, void>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerFinishSenderImplementation<grpc::ServerAsyncResponseWriter<google::protobuf::Empty> >, unifex::_final::_receiver<agrpc::u::detail::BasicSender<agrpc::u::detail::ServerFinishWithMessageInitation<google::protobuf::Empty>, agrpc::u::detail::ServerFinishSenderImplementation<grpc::ServerAsyncResponseWriter<google::protobuf::Empty> > > &&, unifex::_unstoppable::_sender<unifex::_sf::sender_for<&unifex::schedule, unifex::_any_sched::_with<>::any_scheduler::_sender, unifex::_sf::_ctx<unifex::_kv::_kv<unifex::_get_scheduler::_fn, unifex::_any_sched::_with<>::any_scheduler>::type>::type> >::type, unifex::_await_tfx::_awaitable_base<unifex::_task::_promise<void, false>::type, bool>::type::_rec>::type>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::SenderMoveAlarmSenderImplementation<agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, agrpc::u::detail::SubmitToFunctionReceiver<agrpc::u::detail::BasicSender<agrpc::u::detail::MoveAlarmSenderInitiation<gpr_timespec>, agrpc::u::detail::SenderMoveAlarmSenderImplementation<agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> > >, agrpc::u::detail::ProcessTag>::Wrap>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerRequestSenderImplementation<grpc::ServerAsyncResponseWriter<example::v1::Response>, false>, agrpc::u::detail::RPCHandlerOperation<agrpc::u::ServerRPC<&example::v1::Example::WithAsyncMethod_Unary<example::v1::Example::Service>::RequestUnary, agrpc::u::DefaultServerRPCTraits, agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, (lambda at /home/runner/work/asio-grpc/asio-grpc/example/unifex-server.cpp:52:57), unifex::inplace_stop_token, std::__1::allocator<std::byte> >::StartReceiver>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerFinishSenderImplementation<grpc::ServerAsyncResponseWriter<example::v1::Response> >, agrpc::u::detail::RPCHandlerOperation<agrpc::u::ServerRPC<&example::v1::Example::WithAsyncMethod_Unary<example::v1::Example::Service>::RequestUnary, agrpc::u::DefaultServerRPCTraits, agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, (lambda at /home/runner/work/asio-grpc/asio-grpc/example/unifex-server.cpp:52:57), unifex::inplace_stop_token, std::__1::allocator<std::byte> >::Receiver<agrpc::u::detail::RPCHandlerOperationFinish> >'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerRequestSenderImplementation<grpc::ServerAsyncWriter<example::v1::Response>, false>, agrpc::u::detail::RPCHandlerOperation<agrpc::u::ServerRPC<&example::v1::Example::WithAsyncMethod_ServerStreaming<example::v1::Example::WithAsyncMethod_ClientStreaming<example::v1::Example::WithAsyncMethod_BidirectionalStreaming<example::v1::Example::WithAsyncMethod_Unary<example::v1::Example::Service> > > >::RequestServerStreaming, agrpc::u::DefaultServerRPCTraits, agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, (lambda at /home/runner/work/asio-grpc/asio-grpc/example/unifex-server.cpp:78:9), unifex::inplace_stop_token, std::__1::allocator<std::byte> >::StartReceiver>'

Check failure on line 48 in src/agrpc/detail/operation_implementation.hpp

View workflow job for this annotation

GitHub Actions / Ubuntu/20.04/Clang

'Base' is a private member of 'agrpc::u::detail::BasicSenderRunningOperation<agrpc::u::detail::ServerRequestSenderImplementation<grpc::ServerAsyncResponseWriter<google::protobuf::Empty>, false>, agrpc::u::detail::RPCHandlerOperation<agrpc::u::ServerRPC<&example::v1::ExampleExt::WithAsyncMethod_SlowUnary<example::v1::ExampleExt::WithAsyncMethod_Shutdown<example::v1::ExampleExt::WithAsyncMethod_SendFile<example::v1::ExampleExt::Service> > >::RequestSlowUnary, agrpc::u::DefaultServerRPCTraits, agrpc::u::BasicGrpcExecutor<std::__1::allocator<void>, 1> >, (lambda at /home/runner/work/asio-grpc/asio-grpc/example/unifex-server.cpp:104:9), unifex::inplace_stop_token, std::__1::allocator<std::byte> >::StartReceiver>'
{
impl(detail::is_ok(result));
}
Expand Down
2 changes: 1 addition & 1 deletion src/agrpc/detail/schedule_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace detail
{
struct ScheduleSenderImplementation
{
static constexpr auto TYPE = detail::SenderImplementationType::NO_ARG;
static constexpr bool NEEDS_ON_COMPLETE = false;

using BaseType = detail::NoArgOperationBase;
using Signature = void();
using StopFunction = detail::Empty;

Expand Down
30 changes: 4 additions & 26 deletions src/agrpc/detail/sender_implementation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,16 @@ AGRPC_NAMESPACE_BEGIN()

namespace detail
{
enum class SenderImplementationType
{
NO_ARG,
GRPC_TAG,
BOTH
};

template <detail::SenderImplementationType>
struct BaseForSenderImplementationType
{
using Type = detail::QueueableOperationBase;
};

template <>
struct BaseForSenderImplementationType<detail::SenderImplementationType::GRPC_TAG>
{
using Type = detail::OperationBase;
};

template <detail::SenderImplementationType ImplementationType>
using BaseForSenderImplementationTypeT = typename detail::BaseForSenderImplementationType<ImplementationType>::Type;

template <class Initiation, class Implementation>
auto get_stop_function_arg(const Initiation& initiation, Implementation& implementation)
-> decltype(initiation.stop_function_arg(implementation))
auto get_stop_function_arg(const Initiation& initiation,
Implementation& implementation) -> decltype(initiation.stop_function_arg(implementation))
{
return initiation.stop_function_arg(implementation);
}

template <class Initiation, class Implementation>
auto get_stop_function_arg(const Initiation& initiation, const Implementation&)
-> decltype(initiation.stop_function_arg())
auto get_stop_function_arg(const Initiation& initiation,
const Implementation&) -> decltype(initiation.stop_function_arg())
{
return initiation.stop_function_arg();
}
Expand Down
Loading

0 comments on commit 730de58

Please sign in to comment.