libsigc++
2.99.6
|
Convinience class for safe disconnection. More...
#include <sigc++/connection.h>
Public Member Functions | |
connection () noexcept | |
Constructs an empty connection object. More... | |
connection (const connection& c) | |
Constructs a connection object copying an existing one. More... | |
connection (slot_base&slot) | |
Constructs a connection object from a slot object. More... | |
~connection () | |
bool | block (bool should_block=true) noexcept |
Sets or unsets the blocking state of this connection. More... | |
bool | blocked () const noexcept |
Returns whether the connection is blocked. More... | |
bool | connected () const noexcept |
Returns whether the connection is still active. More... | |
void | disconnect () |
Disconnects the referred slot. More... | |
bool | empty () const noexcept |
Returns whether the connection is still active. More... | |
operator bool () const noexcept | |
Returns whether the connection is still active. More... | |
connection& | operator= (const connection& src) |
Overrides this connection object copying another one. More... | |
bool | unblock () noexcept |
Unsets the blocking state of this connection. More... | |
Additional Inherited Members | |
![]() | |
using | func_destroy_notify = internal::func_destroy_notify |
Convinience class for safe disconnection.
Iterators must not be used beyond the lifetime of the list they work on. A connection object can be created from a slot list iterator and may safely be used to disconnect the referred slot at any time (disconnect()). If the slot has already been destroyed, disconnect() does nothing. empty() or operator bool() can be used to test whether the connection is still active. The connection can be blocked (block(), unblock()).
This is possible because the connection object gets notified when the referred slot dies (notify()).
|
noexcept |
Constructs an empty connection object.
sigc::connection::connection | ( | const connection& | c | ) |
Constructs a connection object copying an existing one.
c | The connection object to make a copy from. |
|
explicit |
Constructs a connection object from a slot object.
sl | The slot to operate on. |
sigc::connection::~connection | ( | ) |
|
noexcept |
Sets or unsets the blocking state of this connection.
See slot_base::block() for details.
should_block | Indicates whether the blocking state should be set or unset. |
true
if the connection has been in blocking state before.
|
noexcept |
Returns whether the connection is blocked.
true
if the connection is blocked.
|
noexcept |
Returns whether the connection is still active.
true
if the connection is still active. void sigc::connection::disconnect | ( | ) |
Disconnects the referred slot.
|
noexcept |
Returns whether the connection is still active.
false
if the connection is still active.
|
explicitnoexcept |
Returns whether the connection is still active.
true
if the connection is still active. connection& sigc::connection::operator= | ( | const connection& | src | ) |
Overrides this connection object copying another one.
c | The connection object to make a copy from. |
|
noexcept |
Unsets the blocking state of this connection.
true
if the connection has been in blocking state before.