Magnum::Ui::EventConnection class new in Git master

Connection in the EventLayer.

Performs automatic removal of a connection on destruction. Each instance with non-null data() counts towards EventLayer::usedScopedConnectionCount().

Constructors, destructors, conversion operators

EventConnection(const EventConnection&) deleted
Copying is not allowed.
EventConnection(EventConnection&& other) noexcept
Move constructor.
~EventConnection()
Destructor.

Public functions

auto operator=(const EventConnection&) -> EventConnection& deleted
Copying is not allowed.
auto operator=(EventConnection&& other) -> EventConnection& noexcept
Move assignment.
auto layer() -> EventLayer&
Event layer containing the connection.
auto layer() const -> const EventLayer&
auto data() const -> DataHandle
Connection data handle.
auto release() -> DataHandle
Release the connection.

Function documentation

Magnum::Ui::EventConnection::~EventConnection()

Destructor.

If data() is not DataHandle::Null and is valid, removes the connection from associated layer().

EventLayer& Magnum::Ui::EventConnection::layer()

Event layer containing the connection.

If data() is DataHandle::Null, the reference may be dangling.

const EventLayer& Magnum::Ui::EventConnection::layer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

DataHandle Magnum::Ui::EventConnection::data() const

Connection data handle.

If DataHandle::Null, the instance is moved out or released.

DataHandle Magnum::Ui::EventConnection::release()

Release the connection.

Returns data() and sets it to DataHandle::Null so it's no longer removed at destruction. Removing the connection using EventLayer::remove() before the layer itself is destructed is user responsibility.