Blocks a Signal/Slot Connection. More...
#include <shared_connection_block.hpp>
Public Member Functions | |
Shared_connection_block (Connection const &conn=Connection{}, bool initially_block=true) | |
Create a Shared_connection_block from a Connection and a boolean. More... | |
Shared_connection_block (Shared_connection_block const &x) | |
Creates a copy of x , increasing the block count on the. More... | |
auto | operator= (Shared_connection_block const &x) -> Shared_connection_block & |
Reset *this' Connection to point to x's Connection. More... | |
~Shared_connection_block () | |
Releases this block from the Connection. More... | |
void | unblock () |
Releases the Connection block. No-op if not currently blocking. | |
void | block () |
Reasserts a block on a Connection. No-op if currently blocking. | |
auto | blocking () const -> bool |
auto | connection () const -> Connection |
Blocks a Signal/Slot Connection.
Any number of Shared_connection_blocks can be built on a single connection, when the last block goes out of scope, the connection is unblocked.
|
inlineexplicit |
Create a Shared_connection_block from a Connection and a boolean.
Default constructs to blocking an empty Connection.
conn | The Connection to be blocked by *this. |
initially_block | If true, *this blocks the Connection, otherwise *this only holds a reference to the Connection and can block the Connection at some other time by calling block(). |
|
inline |
Creates a copy of x
, increasing the block count on the.
Connection if x
is blocking.
|
inline |
Releases this block from the Connection.
Connection may be blocked by other Shared_connection_block objects.
|
inline |
|
inline |
|
inline |
Reset *this' Connection to point to x's
Connection.
If *this was blocking, then the block count is decremented on the original Connection. If x
is blocking, then x's
Connection gets an additional block.