BDE 4.14.0 Production release
|
#include <bdlmt_signaler.h>
Public Member Functions | |
SignalerConnection () | |
Create a SignalerConnection object having no associated slot. | |
SignalerConnection (const SignalerConnection &original) BSLS_KEYWORD_NOEXCEPT | |
SignalerConnection (bslmf::MovableRef< SignalerConnection > original) BSLS_KEYWORD_NOEXCEPT | |
SignalerConnection & | operator= (const SignalerConnection &rhs) |
SignalerConnection & | operator= (bslmf::MovableRef< SignalerConnection > rhs) BSLS_KEYWORD_NOEXCEPT |
void | reset () BSLS_KEYWORD_NOEXCEPT |
void | swap (SignalerConnection &other) BSLS_KEYWORD_NOEXCEPT |
void | disconnect () const BSLS_KEYWORD_NOEXCEPT |
void | disconnectAndWait () const BSLS_KEYWORD_NOEXCEPT |
bool | isConnected () const |
Friends | |
template<class > | |
class | Signaler_Node |
bool | operator< (const SignalerConnection &, const SignalerConnection &) |
bool | operator== (const SignalerConnection &, const SignalerConnection &) |
This class
represents a connection between a signaler and a slot. It is a lightweight object that has the ability to query whether the signaler and slot are currently connected, and to disconnect the slot from the signaler. Note that, unless otherwise specified, it is safe to invoke any method of SignalerConnection
from the context of its associated slot, or any other slot.
See bdlmt_signaler
bdlmt::SignalerConnection::SignalerConnection | ( | ) |
Create SignalerConnection
object weakly linked to the specified slotNodeBasePtr
.
bdlmt::SignalerConnection::SignalerConnection | ( | const SignalerConnection & | original | ) |
Create a SignalerConnection
object that refers to and assumes management of the same slot (if any) as the specified original
object. Throws nothing.
bdlmt::SignalerConnection::SignalerConnection | ( | bslmf::MovableRef< SignalerConnection > | original | ) |
Create a SignalerConnection
object that refers to and assumes management of the same slot (if any) as the specified original
object, and reset original
to a default-constructed state. Throws nothing.
void bdlmt::SignalerConnection::disconnect | ( | ) | const |
Disconnect the associated slot. If the slot was already disconnected, this function has no effect. This function returns immediately without waiting on any calls to the signaler that may be in progress. Any signal emitted on the corresponding signaler that happens after this call to disconnect
completes will not emit to the slot. Throws nothing. Note that it is unspecified if any signal that is emitted before this function completes will call the slot.
void bdlmt::SignalerConnection::disconnectAndWait | ( | ) | const |
Disconnect the associated slot. If the slot was already disconnected, this function has no effect. This function blocks the calling thread pending completion of signals emitted on the signaler by any thread, even if the slot was disconnected prior to this call. Any signal emitted on the corresponding signaler that happens after this call to disconnect
completes will not emit to the slot. Throws nothing. The behavior is undefined if this method is called from any slot. Note that it is unspecified if any signal emitted on the signaler that begins before this function completes will call the slot.
bool bdlmt::SignalerConnection::isConnected | ( | ) | const |
Return true
if the associated slot is connected to the signaler *this
was obtained from, and false
otherwise. If *this
does not have an associated slot (i.e., was default-constructed), return false
.
SignalerConnection & bdlmt::SignalerConnection::operator= | ( | bslmf::MovableRef< SignalerConnection > | rhs | ) |
Make this connection refer to and assume management of the same slot (if any) as the specified rhs
connection, and reset rhs
to a default-constructed state. Return *this
. Throws nothing.
SignalerConnection & bdlmt::SignalerConnection::operator= | ( | const SignalerConnection & | rhs | ) |
Make this connection refer to and assume management of the same slot (if any) as the specified rhs
connection. Return *this
.
void bdlmt::SignalerConnection::reset | ( | ) |
Disassociate this connection object from its associated slot, if any, and reset *this
to a default-constructed state. Throws nothing.
|
inline |
Swap the contents of *this
and the specified other
. Throws nothing.
|
friend |
Return true
if the specified lhs
is less than the specified rhs
and false
otherwise.
|
friend |
Return true
if the specified lhs
and rhs
referring to the same slot and false
otherwise.
|
friend |