X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=blobdiff_plain;f=include%2Fafb%2Fc%2B%2B%2Fbinding-wrap.hpp;h=8eddc58b86607d9f9a717471ae029dad32edccc1;hp=0a5a5e2572d0ba472a9da7a8486609f6716cb560;hb=3abc75dfa35fa36c0f5f55cd4aed4d443620b3a9;hpb=e9a9f95aab36dd73037024e5450d2ecd6da959af diff --git a/include/afb/c++/binding-wrap.hpp b/include/afb/c++/binding-wrap.hpp index 0a5a5e25..8eddc58b 100644 --- a/include/afb/c++/binding-wrap.hpp +++ b/include/afb/c++/binding-wrap.hpp @@ -571,6 +571,40 @@ constexpr afb_verb_t verb( return r; } +#if AFB_BINDING_VERSION >= 3 +void __afb__verb__cb__for__global__(afb_req_t r) +{ + void *vcbdata; + void (*callback)(req); + + vcbdata = afb_req_get_vcbdata(r); + callback = reinterpret_cast(vcbdata); + callback(req(r)); +} + +constexpr afb_verb_t verb( + const char *name, + void (&callback)(req), + const char *info = nullptr, + uint16_t session = 0, + const afb_auth *auth = nullptr + , + bool glob = false, + void *vcbdata = nullptr +) +{ + return verb( + name, + __afb__verb__cb__for__global__, + info, + session, + auth, + glob, + reinterpret_cast(&callback) + ); +} +#endif + constexpr afb_verb_t verbend() { afb_verb_t r = verb(nullptr, nullptr);