lxgui
Public Member Functions | Private Member Functions | List of all members
lxgui::utils::scoped_connection Class Reference

A connection that automatically disconnects when going out of scope. More...

#include <utils_signal.hpp>

Inheritance diagram for lxgui::utils::scoped_connection:
lxgui::utils::connection

Public Member Functions

 scoped_connection ()=default
 Default constructor, no connection. More...
 
 scoped_connection (connection c) noexcept
 Conversion constructor from a raw connection. More...
 
 ~scoped_connection () noexcept
 Destructor, disconnects. More...
 
 scoped_connection (const scoped_connection &)=delete
 
 scoped_connection (scoped_connection &&)=default
 
scoped_connectionoperator= (const scoped_connection &)=delete
 
scoped_connectionoperator= (scoped_connection &&)=default
 
void disconnect () noexcept
 Disconnect the slot. More...
 
bool connected () const noexcept
 Check if this slot is still connected. More...
 

Private Member Functions

bool connected () const noexcept
 Check if this slot is still connected. More...
 

Detailed Description

A connection that automatically disconnects when going out of scope.

Definition at line 66 of file utils_signal.hpp.

Constructor & Destructor Documentation

◆ scoped_connection() [1/4]

lxgui::utils::scoped_connection::scoped_connection ( )
default

Default constructor, no connection.

◆ scoped_connection() [2/4]

lxgui::utils::scoped_connection::scoped_connection ( connection  c)
inlinenoexcept

Conversion constructor from a raw connection.

Definition at line 72 of file utils_signal.hpp.

◆ ~scoped_connection()

lxgui::utils::scoped_connection::~scoped_connection ( )
inlinenoexcept

Destructor, disconnects.

Definition at line 75 of file utils_signal.hpp.

◆ scoped_connection() [3/4]

lxgui::utils::scoped_connection::scoped_connection ( const scoped_connection )
delete

◆ scoped_connection() [4/4]

lxgui::utils::scoped_connection::scoped_connection ( scoped_connection &&  )
default

Member Function Documentation

◆ connected()

bool lxgui::utils::connection::connected
inlinenoexcept

Check if this slot is still connected.

Definition at line 54 of file utils_signal.hpp.

◆ disconnect()

void lxgui::utils::connection::disconnect
inlinenoexcept

Disconnect the slot.

Definition at line 46 of file utils_signal.hpp.

◆ operator=() [1/2]

scoped_connection& lxgui::utils::scoped_connection::operator= ( const scoped_connection )
delete

◆ operator=() [2/2]

scoped_connection& lxgui::utils::scoped_connection::operator= ( scoped_connection &&  )
default

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