Boost.Signals: Header <boost/signals/connection.hpp><boost/signals/connection.hpp> synopsis
namespace boost {
namespace signals {
class connection;
class scoped_connection;
void swap(connection&, connection&);
void swap(scoped_connection&, scoped_connection&);
}
}
connection synopsisThe connection class represents a connection between a Signal and a Slot. It is a lightweight object that has the ability to query whether the signal and slot are currently connected, and to disconnect the signal and slot. It is always safe to query or disconnect a connection.
namespace boost {
namespace signals {
class connection : // Class connection is LessThanComparable and EqualityComparable
private less_than_comparable1<connection>, // Exposition only.
private equality_comparable1<connection>// Exposition only.
{
public:
connection();
connection(const connection&);
~connection();
void disconnect() const;
bool connected() const;
connection& operator=(const connection&);
void swap(connection&);
bool operator==(const connection& other) const;
bool operator<(const connection& other) const;
};
}
}
connection members!this->connected()
connection(const connection& other);
this references the connection referenced by other.this->is_connected(), disconnects the signal and slot referenced by this; otherwise, this operation is a no-op.!this->is_connected()true if this references a non-NULL connection that is still active (connected), and false otherwise.connection& operator=(const connection& other);
connection(other).swap(*this);
*thisthis and other.bool operator==(const connection& other) const;
this and other reference the same connection or both reference the NULL connection, and false otherwise.bool operator<(const connection& other) const;
true if the connection referenced by this precedes the connection referenced by other based on some implementation-defined ordering, and false otherwise. scoped_connection synopsisThe scoped_connection class is a connection that will
be automatically disconnected when the scoped_connection
instance is destructed.
namespace boost {
namespace signals {
class scoped_connection : public connection
{
public:
scoped_connection();
scoped_connection(const scoped_connection&);
scoped_connection(const connection&);
~scoped_connection();
connection& operator=(const scoped_connection&);
connection& operator=(const connection&);
void swap(connection&);
};
}
}
scoped_connection members!this->connected()
scoped_connection(const scoped_connection& other);
this references the connection referenced by other.scoped_connection(const connection& other);
this references the connection referenced by other.this->disconnect()scoped_connection& operator=(const scoped_connection& other);
scoped_connection(other).swap(*this);
*thisscoped_connection& operator=(const connection& other);
scoped_connection(other).swap(*this);
*thisvoid swap(scoped_connection& other);
this and other.void swap(connection& c1, connection& c2);
c1.swap(c2).void swap(scoped_connection& c1, scoped_connection& c2);
c1.swap(c2).