EnTT: entt::scoped_connection Struct Reference

EnTT 3.16.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
entt::scoped_connection Struct Reference

Scoped connection class. More...

`#include <sigh.hpp>`

## Public Member Functions
| scoped_connection ()=default
| Default constructor.
| scoped_connection (const connection &other)
| Constructs a scoped connection from a basic connection.
| scoped_connection (const scoped_connection &)=delete
| Default copy constructor, deleted on purpose.
| scoped_connection (scoped_connection &&other) noexcept
| Move constructor.
| ~scoped_connection ()
| Automatically breaks the link on destruction.
scoped_connection & | operator= (const scoped_connection &)=delete
| Default copy assignment operator, deleted on purpose.
scoped_connection & | operator= (scoped_connection &&other) noexcept
| Move assignment operator.
scoped_connection & | operator= (connection other)
| Acquires a connection.
| operator bool () const noexcept
| Checks whether a scoped connection is properly initialized.
void | release ()
| Breaks the connection.

## Detailed Description

Scoped connection class.

Opaque object the aim of which is to allow users to release an already estabilished connection without having to keep a reference to the signal or the sink that generated it.
A scoped connection automatically breaks the link between the two objects when it goes out of scope.

Definition at line 271 of file sigh.hpp.

## Constructor & Destructor Documentation

## ◆ scoped_connection() [1/2]

entt::scoped_connection::scoped_connection | ( | const connection & | other | ) |
| inline

Constructs a scoped connection from a basic connection.

Parameters

  other | A valid connection object.

Definition at line 279 of file sigh.hpp.

## ◆ scoped_connection() [2/2]

entt::scoped_connection::scoped_connection | ( | scoped_connection && | other | ) |
| inlinenoexcept

Move constructor.

Parameters

  other | The scoped connection to move from.

Definition at line 289 of file sigh.hpp.

## ◆ ~scoped_connection()

entt::scoped_connection::~scoped_connection | ( |  | ) |
| inline

Automatically breaks the link on destruction.

Definition at line 293 of file sigh.hpp.

## Member Function Documentation

## ◆ operator bool()

entt::scoped_connection::operator bool | ( |  | ) | const
| inlineexplicitnodiscardnoexcept

Checks whether a scoped connection is properly initialized.

Returns
  True if the connection is properly initialized, false otherwise.

Definition at line 327 of file sigh.hpp.

## ◆ operator=() [1/3]

scoped_connection & entt::scoped_connection::operator= | ( | connection | other | ) |
| inline

Acquires a connection.

Parameters

  other | The connection object to acquire.

Returns
  This scoped connection.

Definition at line 318 of file sigh.hpp.

## ◆ operator=() [2/3]

scoped_connection & entt::scoped_connection::operator= | ( | const scoped_connection & |  | ) |
| delete

Default copy assignment operator, deleted on purpose.

Returns
  This scoped connection.

## ◆ operator=() [3/3]

scoped_connection & entt::scoped_connection::operator= | ( | scoped_connection && | other | ) |
| inlinenoexcept

Move assignment operator.

Parameters

  other | The scoped connection to move from.

Returns
  This scoped connection.

Definition at line 308 of file sigh.hpp.

## ◆ release()

void entt::scoped_connection::release | ( |  | ) |
| inline

Breaks the connection.

Definition at line 332 of file sigh.hpp.

The documentation for this struct was generated from the following file:

- src/entt/signal/sigh.hpp