diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index 282f9b58..9c212f1e 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -38,6 +38,11 @@ public: { } + R returnValue() + { + return ret_; + } + std::tuple...> args_; R ret_; }; @@ -51,6 +56,10 @@ public: { } + void returnValue() + { + } + std::tuple...> args_; }; @@ -160,7 +169,7 @@ public: auto pack = std::make_shared(args...); bool sync = BoundMethodBase::activatePack(pack, deleteMethod); - return sync ? pack->ret_ : R(); + return sync ? pack->returnValue() : R(); } R invoke(Args... args) override @@ -173,41 +182,6 @@ private: R (T::*func_)(Args...); }; -template -class BoundMethodMember : public BoundMethodArgs -{ -public: - using PackType = typename BoundMethodArgs::PackType; - - BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...), - ConnectionType type = ConnectionTypeAuto) - : BoundMethodArgs(obj, object, type), func_(func) - { - } - - bool match(void (T::*func)(Args...)) const { return func == func_; } - - void activate(Args... args, bool deleteMethod = false) override - { - if (!this->object_) { - T *obj = static_cast(this->obj_); - return (obj->*func_)(args...); - } - - auto pack = std::make_shared(args...); - BoundMethodBase::activatePack(pack, deleteMethod); - } - - void invoke(Args... args) override - { - T *obj = static_cast(this->obj_); - return (obj->*func_)(args...); - } - -private: - void (T::*func_)(Args...); -}; - template class BoundMethodStatic : public BoundMethodArgs {