From 39e5ecb3085cdd8f2c4ae88ae23f11faf4915df6 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 25 Aug 2023 09:43:28 +0200 Subject: [PATCH] ioc: accommodate USE_TYPED_DBEVENT --- ioc/subscriptionctx.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ioc/subscriptionctx.h b/ioc/subscriptionctx.h index 1ba4c59..05e8f84 100644 --- a/ioc/subscriptionctx.h +++ b/ioc/subscriptionctx.h @@ -12,6 +12,7 @@ #include #include +#include #include @@ -22,21 +23,21 @@ namespace pvxs { namespace ioc { class Subscription { - std::shared_ptr sub; // holds void* returned by db_add_event() + std::shared_ptr::type> sub; // holds void* returned by db_add_event() public: /* Add a subscription event by calling db_add_event using the given subscriptionCtx * and selecting the correct elements based on the given type of event being added. * You need to specify the correct options that correspond to the event type. * Adds a deleter to clean up the subscription by calling db_cancel_event. */ - void subscribe(void* context, + void subscribe(dbEventCtx context, const Channel& pChan, EVENTFUNC *user_sub, void *user_arg, unsigned select) { auto chan(pChan); // bind by value sub.reset(db_add_event(context, chan, user_sub, user_arg, select), - [chan](void* sub) mutable + [chan](dbEventSubscription sub) mutable { db_cancel_event(sub); chan = Channel(); // dbChannel* must outlive subscription