ImFusion SDK 4.3
SignalConnection Class Reference

#include <ImFusion/Core/Signal.h>

Structure for describing/identifying individual connections between signals and slots. More...

+ Inheritance diagram for SignalConnection:

Detailed Description

Structure for describing/identifying individual connections between signals and slots.

Instances of this class can only be instantiated by the corresponding signal and allow for safely disconnecting from a signal without explicitly knowing about the lifetime of signal and receiver.

See also
Signals and Slots

Public Member Functions

bool isActive () const
 Returns true if the connections is currently active (i.e. both connected and not temporarily blocked).
 
bool disconnect ()
 Disconnect the connection from the signal.
 
bool isConnected () const
 Returns true if the connection is still connected.
 
bool setBlocked (bool block)
 Set the flag whether to block notifications to the observer sent via this connection.
 
bool isBlocked () const
 Returns whether the connection has been temporarily blocked so that the receiver is not notified.
 
 SignalConnection (private_cookie, const SignalBase &signal, const SignalReceiver *receiver)
 Constructor for a connection between the given signal and slot.
 

Constructor & Destructor Documentation

◆ SignalConnection()

SignalConnection ( private_cookie ,
const SignalBase & signal,
const SignalReceiver * receiver )

Constructor for a connection between the given signal and slot.

Parameters
signalReference to the signal
receiverPointer to the receiver, may be 0 in the case that the receiver is a free function.

Member Function Documentation

◆ disconnect()

bool disconnect ( )

Disconnect the connection from the signal.

Returns false if the connection was no longer active.

◆ setBlocked()

bool setBlocked ( bool block)

Set the flag whether to block notifications to the observer sent via this connection.

If block is true, any notification from the source signal will not be sent to the target slot, however other slots connected to the same signal may still be notified if their connection is active. The caller is responsible to reset the blocked state to its original value when appropriate.

Returns
Previous value of isBlocked().
See also
SignalBlocker for a more convenient and exception-safe interface to temporarily block a signal.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close