Disconnects a Connection automatically upon destruction. More...
#include <ndn-cxx/util/signal/scoped-connection.hpp>
Public Member Functions | |
constexpr | ScopedConnection () noexcept=default |
ScopedConnection (const ScopedConnection &)=delete | |
ScopedConnection (ScopedConnection &&) noexcept | |
Move constructor. More... | |
ScopedConnection (Connection connection) noexcept | |
Implicit constructor from Connection. More... | |
~ScopedConnection () | |
Destructor, automatically disconnects the connection. More... | |
void | disconnect () |
Manually disconnect the connection. More... | |
bool | isConnected () const noexcept |
Check if the connection is connected to the signal. More... | |
ScopedConnection & | operator= (const ScopedConnection &)=delete |
ScopedConnection & | operator= (ScopedConnection &&) noexcept |
Move assignment operator. More... | |
ScopedConnection & | operator= (Connection connection) |
Assign a connection. More... | |
void | release () noexcept |
Release the connection so that it won't be disconnected when this ScopedConnection is destructed. More... | |
Disconnects a Connection automatically upon destruction.
Definition at line 33 of file scoped-connection.hpp.
|
defaultnoexcept |
|
delete |
|
inlinedefaultnoexcept |
Move constructor.
|
noexcept |
Implicit constructor from Connection.
connection | the Connection to be disconnected upon destruction |
Definition at line 28 of file scoped-connection.cpp.
ndn::util::signal::ScopedConnection::~ScopedConnection | ( | ) |
Destructor, automatically disconnects the connection.
Definition at line 43 of file scoped-connection.cpp.
void ndn::util::signal::ScopedConnection::disconnect | ( | ) |
Manually disconnect the connection.
Definition at line 49 of file scoped-connection.cpp.
|
noexcept |
Check if the connection is connected to the signal.
Definition at line 55 of file scoped-connection.cpp.
|
delete |
|
inlinedefaultnoexcept |
Move assignment operator.
ScopedConnection & ndn::util::signal::ScopedConnection::operator= | ( | Connection | connection | ) |
Assign a connection.
If a different connection has been assigned to this instance previously, that connection will be disconnected immediately.
Definition at line 34 of file scoped-connection.cpp.
|
noexcept |
Release the connection so that it won't be disconnected when this ScopedConnection is destructed.
Definition at line 61 of file scoped-connection.cpp.