BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlmt::SignalerConnection Class Reference

#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
 
SignalerConnectionoperator= (const SignalerConnection &rhs)
 
SignalerConnectionoperator= (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 &)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ SignalerConnection() [1/3]

bdlmt::SignalerConnection::SignalerConnection ( )

Create SignalerConnection object weakly linked to the specified slotNodeBasePtr.

◆ SignalerConnection() [2/3]

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.

◆ SignalerConnection() [3/3]

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.

Member Function Documentation

◆ disconnect()

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.

◆ disconnectAndWait()

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.

◆ isConnected()

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.

◆ operator=() [1/2]

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.

◆ operator=() [2/2]

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.

◆ reset()

void bdlmt::SignalerConnection::reset ( )

Disassociate this connection object from its associated slot, if any, and reset *this to a default-constructed state. Throws nothing.

◆ swap()

void bdlmt::SignalerConnection::swap ( SignalerConnection other)
inline

Swap the contents of *this and the specified other. Throws nothing.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const SignalerConnection lhs,
const SignalerConnection rhs 
)
friend

Return true if the specified lhs is less than the specified rhs and false otherwise.

◆ operator==

bool operator== ( const SignalerConnection lhs,
const SignalerConnection rhs 
)
friend

Return true if the specified lhs and rhs referring to the same slot and false otherwise.

◆ Signaler_Node

template<class >
friend class Signaler_Node
friend

The documentation for this class was generated from the following file: