19 #ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
20 #define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
38 template <
class Func,
class... Args>
40 #if GRPC_ALLOW_EXCEPTIONS
42 func(std::forward<Args>(args)...);
47 func(std::forward<Args>(args)...);
51 template <
class Reactor,
class Func,
class... Args>
53 #if GRPC_ALLOW_EXCEPTIONS
55 return func(std::forward<Args>(args)...);
61 return func(std::forward<Args>(args)...);
72 static void operator delete(
void* , std::size_t size) {
85 : call_(call), func_(
std::move(f)), ops_(ops) {
100 status_ = std::move(s);
106 std::function<void(
Status)> func_;
114 void* ignored = ops_;
123 auto func = std::move(func_);
124 auto status = std::move(status_);
138 static void operator delete(
void* , std::size_t size) {
167 func_ = std::move(f);
174 if (call_ !=
nullptr) {
191 operator bool()
const {
return call_ !=
nullptr; }
195 std::function<void(
bool)> func_;
202 void* ignored = ops_;
virtual void grpc_call_unref(grpc_call *call)=0
virtual void grpc_call_ref(grpc_call *call)=0
Did it work? If it didn't, why?
Definition: status.h:31
Definition: callback_common.h:69
CallbackWithStatusTag(grpc_call *call, std::function< void(Status)> f, CompletionQueueTag *ops)
Definition: callback_common.h:83
~CallbackWithStatusTag()
Definition: callback_common.h:93
void force_run(Status s)
Definition: callback_common.h:99
Status * status_ptr()
Definition: callback_common.h:94
CallbackWithSuccessTag can be reused multiple times, and will be used in this fashion for streaming o...
Definition: callback_common.h:135
CallbackWithSuccessTag & operator=(const CallbackWithSuccessTag &)=delete
void Set(grpc_call *call, std::function< void(bool)> f, CompletionQueueTag *ops, bool can_inline)
Definition: callback_common.h:162
void force_run(bool ok)
Definition: callback_common.h:187
~CallbackWithSuccessTag()
Definition: callback_common.h:154
CallbackWithSuccessTag(const CallbackWithSuccessTag &)=delete
CallbackWithSuccessTag()
Definition: callback_common.h:149
void Clear()
Definition: callback_common.h:173
CompletionQueueTag * ops()
Definition: callback_common.h:182
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
virtual bool FinalizeResult(void **tag, bool *status)=0
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
#define GPR_CODEGEN_DEBUG_ASSERT(x)
Codegen specific version of GPR_DEBUG_ASSERT.
Definition: core_codegen_interface.h:155
void CatchingCallback(Func &&func, Args &&... args)
An exception-safe way of invoking a user-specified callback function.
Definition: callback_common.h:39
Reactor * CatchingReactorGetter(Func &&func, Args &&... args)
Definition: callback_common.h:52
::google::protobuf::util::Status Status
Definition: config_protobuf.h:91
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
CoreCodegenInterface * g_core_codegen_interface
Null-initializes the global gRPC variables for the codegen library.
Definition: completion_queue.h:96
Definition: async_unary_call.h:398
Specifies an interface class to be used as a tag for callback-based completion queues.
Definition: grpc_types.h:757
int inlineable
The inlineable member specifies whether this functor can be run inline.
Definition: grpc_types.h:766
void(* functor_run)(struct grpc_completion_queue_functor *, int)
The run member specifies a function that will be called when this tag is extracted from the completio...
Definition: grpc_types.h:762