22 #ifndef NDN_CXX_UTIL_SIGNAL_CONNECTION_HPP
23 #define NDN_CXX_UTIL_SIGNAL_CONNECTION_HPP
56 return !m_disconnect.expired();
65 template<
typename Owner,
typename ...TArgs>
80 return (!lhs.isConnected() && !rhs.isConnected()) ||
81 (!lhs.m_disconnect.owner_before(rhs.m_disconnect) &&
82 !rhs.m_disconnect.owner_before(lhs.m_disconnect));
99 weak_ptr<DisconnectFunction> m_disconnect;
Represents a connection to a signal.
constexpr Connection() noexcept=default
friend bool operator==(const Connection &lhs, const Connection &rhs) noexcept
Compare for equality.
bool isConnected() const noexcept
Check if connected to the signal.
void disconnect()
Disconnects from the signal.
friend bool operator!=(const Connection &lhs, const Connection &rhs) noexcept
Provides a lightweight signal / event system.
Common includes and macros used throughout the library.
std::function< void()> DisconnectFunction