22 #ifndef NDN_CXX_UTIL_SIGNAL_CONNECTION_HPP
23 #define NDN_CXX_UTIL_SIGNAL_CONNECTION_HPP
27 #include <boost/operators.hpp>
37 class Connection :
private boost::equality_comparable<Connection>
59 return !m_disconnect.expired();
66 template<
typename Owner,
typename... TArgs>
83 return (!lhs.isConnected() && !rhs.isConnected()) ||
84 (!lhs.m_disconnect.owner_before(rhs.m_disconnect) &&
85 !rhs.m_disconnect.owner_before(lhs.m_disconnect));
96 weak_ptr<DisconnectFunction> m_disconnect;
Represents a connection to a signal.
constexpr Connection() noexcept=default
void disconnect()
Disconnects from the signal.
friend bool operator==(const Connection &lhs, const Connection &rhs) noexcept
Compare for equality.
bool isConnected() const noexcept
Check if connected to the signal.
Provides a lightweight signal / event system.
Common includes and macros used throughout the library.
std::function< void()> DisconnectFunction