25 using QObject::QObject;
31 virtual void run () = 0;
78 template<
typename FireDestrPolicy>
80 ,
public FireDestrPolicy
83 using FunType_t = std::function<typename FireDestrPolicy::Signature_t>;
145 const std::initializer_list<const char*>&
signalsList,
161 FireDestrPolicy::Invoke (Func_,
this);
162 FireDestrPolicy::Fired (
this);
186 base->deleteLater ();
229 base->deleteLater ();
virtual ~BasicDeletePolicy()=default
void Invoke(const std::function< Signature_t > &f, SlotClosureBase *)
Delegates the SlotClosure deletion decision to the signal handler.
Delete
Whether the SlotClosure shall be deleted.
@ Yes
Delete SlotClosure after this invocation.
@ No
Do not delete SlotClosure after this invocation.
virtual ~ChoiceDeletePolicy()
static void Invoke(const std::function< Signature_t > &f, SlotClosureBase *base)
static void Fired(SlotClosureBase *)
Deletes a SlotClosure object after its signal has fired.
static void Fired(SlotClosureBase *base)
Does not delete a SlotClosure object.
static void Fired(SlotClosureBase *)
Base class for SlotClosure.
virtual void run()=0
Triggers the function.
virtual ~SlotClosureBase()=default
Executes a given functor upon a signal (or a list of signals).
std::function< typename FireDestrPolicy::Signature_t > FunType_t
void run() override
Triggers the function and invokes the destroy policy.
SlotClosure(const FunType_t &func, QObject *sender, const std::initializer_list< const char * > &signalsList, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject on the given signals...
SlotClosure(const FunType_t &func, QObject *sender, const char *signal, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject on the given signal.
SlotClosure(const FunType_t &func, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject.
Container< T > Filter(const Container< T > &c, F f)