1 #ifndef SIGNALS_CONNECTION_HPP
2 #define SIGNALS_CONNECTION_HPP
6 #include "detail/connection_impl_base.hpp"
24 explicit Connection(std::weak_ptr<Connection_impl_base> wp_cib)
25 : pimpl_{std::move(wp_cib)}
34 if (!this->pimpl_.expired())
35 pimpl_.lock()->disconnect();
42 if (!this->pimpl_.expired())
43 return pimpl_.lock()->connected();
53 if (!this->pimpl_.expired())
54 return pimpl_.lock()->blocked();
61 return pimpl_.lock() == x.pimpl_.lock();
67 return pimpl_.lock() < x.pimpl_.lock();
73 std::weak_ptr<Connection_impl_base> pimpl_;
83 #endif // SIGNALS_CONNECTION_HPP
Connection()=default
Default constructors a connection that refers to no real connection.
Blocks a Signal/Slot Connection.
Definition: shared_connection_block.hpp:13
void disconnect() const
Disconnects the connection.
Definition: connection.hpp:32
Definition: connection.hpp:8
Connection(std::weak_ptr< Connection_impl_base > wp_cib)
Constructor used by the Signal::connect() function.
Definition: connection.hpp:24
auto blocked() const -> bool
Query whether the connection is currently blocked or not.
Definition: connection.hpp:51
auto operator==(Connection const &x) const -> bool
Return true if both parameters refer to the same Signal/Slot connection.
Definition: connection.hpp:59
Represents the connection made when a Slot is connected to a Signal.
Definition: connection.hpp:13
auto connected() const -> bool
Query whether the connection is connected or not.
Definition: connection.hpp:40
auto operator<(Connection const &x) const -> bool
Does pointer less than comparison of underlying implementation.
Definition: connection.hpp:65
auto operator!=(Connection const &x, Connection const &y) -> bool
Returns !(*this == x)
Definition: connection.hpp:77