Clementine
Public Member Functions | List of all members
entt::scoped_connection Struct Reference

Scoped connection class. More...

#include <entt.hpp>

Public Member Functions

 scoped_connection ()=default
 Default constructor.
 
 scoped_connection (const connection &other)
 Constructs a scoped connection from a basic connection. More...
 
 scoped_connection (const scoped_connection &)=delete
 Default copy constructor, deleted on purpose.
 
 ~scoped_connection ()
 Automatically breaks the link on destruction.
 
scoped_connectionoperator= (const scoped_connection &)=delete
 Default copy assignment operator, deleted on purpose. More...
 
scoped_connectionoperator= (connection other)
 Acquires a connection. More...
 
 operator bool () const ENTT_NOEXCEPT
 Checks whether a scoped connection is properly initialized. More...
 
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.

Constructor & Destructor Documentation

◆ scoped_connection()

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

Constructs a scoped connection from a basic connection.

Parameters
otherA valid connection object.

Member Function Documentation

◆ operator bool()

entt::scoped_connection::operator bool ( ) const
inlineexplicit

Checks whether a scoped connection is properly initialized.

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

◆ operator=() [1/2]

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

Default copy assignment operator, deleted on purpose.

Returns
This scoped connection.

◆ operator=() [2/2]

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

Acquires a connection.

Parameters
otherThe connection object to acquire.
Returns
This scoped connection.

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