libsigc++: sigc::connection Struct Reference

libsigc++ 3.0.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
sigc::connection Struct Reference
Signals

This may be used to disconnect the referred slot at any time (disconnect()). 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...

## Detailed Description

This may 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()).

## Constructor & Destructor Documentation

sigc::connection::connection | ( |  | ) |
| noexcept

Constructs an empty connection object.

sigc::connection::connection | ( | const connection& | c | ) |

Constructs a connection object copying an existing one.

Parameters

  c | The connection object to make a copy from.

sigc::connection::connection | ( | slot_base& | slot | ) |
| explicit

Constructs a connection object from a slot object.

Parameters

  slot | The slot to operate on.

sigc::connection::~connection | ( |  | ) |

## Member Function Documentation

bool sigc::connection::block | ( | bool | should_block = `true` | ) |
| noexcept

Sets or unsets the blocking state of this connection.

See slot_base::block() for details.

Parameters

  should_block | Indicates whether the blocking state should be set or unset.

Returns
  `true` if the connection has been in blocking state before.

bool sigc::connection::blocked | ( |  | ) | const
| noexcept

Returns whether the connection is blocked.

Returns
  `true` if the connection is blocked.

bool sigc::connection::connected | ( |  | ) | const
| noexcept

Returns whether the connection is still active.

Returns
  `true` if the connection is still active.

void sigc::connection::disconnect | ( |  | ) |

Disconnects the referred slot.

bool sigc::connection::empty | ( |  | ) | const
| noexcept

Returns whether the connection is still active.

Returns
  `false` if the connection is still active.

sigc::connection::operator bool | ( |  | ) | const
| explicitnoexcept

Returns whether the connection is still active.

Returns
  `true` if the connection is still active.

connection& sigc::connection::operator= | ( | const connection& | src | ) |

Overrides this connection object copying another one.

Parameters

  src | The connection object to make a copy from.

bool sigc::connection::unblock | ( |  | ) |
| noexcept

Unsets the blocking state of this connection.

Returns
  `true` if the connection has been in blocking state before.