threads and monitor
This commit is contained in:
@@ -81,6 +81,12 @@ public:
|
||||
|
||||
const std::string& GetInstanceName() const;
|
||||
void SetInstanceName(const std::string& name);
|
||||
|
||||
/** @brief Temporarily blocks all signal emissions from this object. Returns previous state. */
|
||||
bool blockSignals(bool block);
|
||||
|
||||
/** @brief Checks if signals are currently blocked. */
|
||||
bool signalsBlocked() const;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// PROPERTIES //
|
||||
@@ -138,24 +144,22 @@ public:
|
||||
|
||||
// Qt5 style connector //
|
||||
template <typename Func1, typename Func2>
|
||||
static bool
|
||||
static Connection
|
||||
connect(typename FunctionPointer<Func1>::Object *sender, Func1 sigf,
|
||||
typename FunctionPointer<Func2>::Object *receiver, Func2 slof) {
|
||||
SignalBase *sigb = sender->findOrAddSignal(sigf);
|
||||
ConnectSignal<typename FunctionPointer<Func1>::SignalSignature>(sigb, slof,
|
||||
return ConnectSignal<typename FunctionPointer<Func1>::SignalSignature>(sigb, slof,
|
||||
receiver);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Lambda/Function object connector //
|
||||
template <typename Func1, typename SlotT>
|
||||
static bool connect(typename FunctionPointer<Func1>::Object *sender,
|
||||
static Connection connect(typename FunctionPointer<Func1>::Object *sender,
|
||||
Func1 sigf, SlotT slof) {
|
||||
SignalBase *sigb = sender->findOrAddSignal(sigf);
|
||||
typedef typename FunctionPointer<Func1>::SignalSignature SigSignature;
|
||||
typedef typename Signal<SigSignature>::type SigT;
|
||||
reinterpret_cast<SigT *>(sigb)->connect(slof);
|
||||
return true;
|
||||
return reinterpret_cast<SigT *>(sigb)->connect(slof);
|
||||
}
|
||||
|
||||
template <typename Func1, typename Func2>
|
||||
@@ -167,10 +171,9 @@ public:
|
||||
}
|
||||
|
||||
template <typename FuncT>
|
||||
static inline bool connect(SignalBase *sigb, FuncT slof, Object *receiver) {
|
||||
ConnectSignal<typename FunctionPointer<FuncT>::SignalSignature>(sigb, slof,
|
||||
static inline Connection connect(SignalBase *sigb, FuncT slof, Object *receiver) {
|
||||
return ConnectSignal<typename FunctionPointer<FuncT>::SignalSignature>(sigb, slof,
|
||||
receiver);
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename FuncT>
|
||||
|
||||
Reference in New Issue
Block a user