Boost.Signals: ヘッダ <boost/signals/connection.hpp><boost/signals/connection.hpp> ヘッダ概要
namespace boost {
namespace signals {
class connection;
class scoped_connection;
void swap(connection&, connection&);
void swap(scoped_connection&, scoped_connection&);
}
}
connection クラス概要connection クラスは Signal と Slot の間の接続を表す。
これはシグナルとスロットが現在接続されているかを問い合わせ、またシグナルとスロットを切断する能力を有する軽量オブジェクトである。
問い合わせと connection の切断を行うことは、常に安全である。
namespace boost {
namespace signals {
class connection : // connection クラスは LessThanComparable かつ EqualityComparableである
private less_than_comparable1<connection>, // 開示用
private equality_comparable1<connection>// 開示用
{
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 クラスメンバ!this->connected()
connection(const connection& other);
other によって参照されていた接続を this が参照する。this->is_connected() が真であれば this によって参照されているシグナルとスロットの接続を切断する; そうでなければ何もしない。!this->is_connected()this がアクティブな (接続されている) 非 NULL 接続を参照していれば true、そうでなければ false。connection& operator=(const connection& other);
connection(other).swap(*this);
*thisthis と other が参照している接続を交換する。bool operator==(const connection& other) const;
this と other が同一の接続を参照しているか、両方とも NULL 接続を参照している場合 true、そうでなければ false。bool operator<(const connection& other) const;
this によって参照されている接続が other によって参照されている接続に先行する場合 true、そうでなければ false。scoped_connection クラス概要 scoped_connection クラスは、
そのインスタンスが破棄されるときに自動的に切断される接続である。
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 クラスメンバ!this->connected()
scoped_connection(const scoped_connection& other);
other によって参照されていた接続を this が参照する。scoped_connection(const connection& other);
other によって参照されていた接続を this が参照する。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 と other が参照する接続を交換する。void swap(connection& c1, connection& c2);
c1.swap(c2)void swap(scoped_connection& c1, scoped_connection& c2);
c1.swap(c2)