asio-grpc v1.4.0
Asynchronous gRPC with Asio/unified executors
agrpc::detail::GetCompletionQueueFn Struct Reference

Function object to get CompletionQueue from objects. More...

#include <agrpc/getCompletionQueue.hpp>

Public Member Functions

template<class Allocator , std::uint32_t Options>
grpc::CompletionQueue * operator() (const agrpc::BasicGrpcExecutor< Allocator, Options > &executor) const noexcept
 Get grpc::CompletionQueue* from a BasicGrpcExecutor. More...
 
grpc::CompletionQueue * operator() (agrpc::GrpcContext &grpc_context) const noexcept
 Get grpc::CompletionQueue* from a GrpcContext. More...
 
grpc::CompletionQueue * operator() (const asio::any_io_executor &executor) const noexcept
 Get grpc::CompletionQueue* from an asio::any_io_executor More...
 
template<class Object >
grpc::CompletionQueue * operator() (const Object &object) const noexcept
 Get grpc::CompletionQueue* from an object's associated executor. More...
 
template<class Executor = asio::any_io_executor>
auto operator() (asio::use_awaitable_t< Executor >={}) const -> typename asio::async_result< asio::use_awaitable_t< Executor >, void(grpc::CompletionQueue *)>::return_type
 Get grpc::CompletionQueue* from the current awaitable. More...
 

Detailed Description

Function object to get CompletionQueue from objects.

Member Function Documentation

◆ operator()() [1/5]

grpc::CompletionQueue * agrpc::detail::GetCompletionQueueFn::operator() ( agrpc::GrpcContext grpc_context) const
inlinenoexcept

Get grpc::CompletionQueue* from a GrpcContext.

Equivalent to grpc_context.get_completion_queue()

◆ operator()() [2/5]

template<class Executor = asio::any_io_executor>
auto agrpc::detail::GetCompletionQueueFn::operator() ( asio::use_awaitable_t< Executor >  = {}) const -> typename asio::async_result<asio::use_awaitable_t<Executor>, void(grpc::CompletionQueue*)>::return_type
inline

Get grpc::CompletionQueue* from the current awaitable.

First awaits asio::this_coro::executor and then returns agrpc::get_completion_queue(executor).

Attention
The awaitable's executor must refer to a GrpcContext

◆ operator()() [3/5]

template<class Allocator , std::uint32_t Options>
grpc::CompletionQueue * agrpc::detail::GetCompletionQueueFn::operator() ( const agrpc::BasicGrpcExecutor< Allocator, Options > &  executor) const
inlinenoexcept

Get grpc::CompletionQueue* from a BasicGrpcExecutor.

Equivalent to executor.context().get_completion_queue()

◆ operator()() [4/5]

grpc::CompletionQueue * agrpc::detail::GetCompletionQueueFn::operator() ( const asio::any_io_executor &  executor) const
inlinenoexcept

Get grpc::CompletionQueue* from an asio::any_io_executor

Attention
executor must have been created from a GrpcExecutor

◆ operator()() [5/5]

template<class Object >
grpc::CompletionQueue * agrpc::detail::GetCompletionQueueFn::operator() ( const Object &  object) const
inlinenoexcept

Get grpc::CompletionQueue* from an object's associated executor.

First obtains the object's associated executor and then returns agrpc::get_completion_queue(executor).

Attention
The associated executor must refer to a GrpcContext