Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Friends

bdlmt::SignalerConnection Class Reference

#include <bdlmt_signaler.h>

List of all members.

Public Member Functions

 SignalerConnection ()
 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

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 Component bdlmt_signaler


Constructor & Destructor Documentation

bdlmt::SignalerConnection::SignalerConnection (  ) 

< Create SignalerConnection object weakly linked to the specified slotNodeBasePtr. Create a SignalerConnection object having no associated slot.

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.


Member Function Documentation

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.

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.

void bdlmt::SignalerConnection::reset (  ) 

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

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

Swap the contents of *this and the specified other. 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.


Friends And Related Function Documentation

friend class Signaler_Node [friend]
bool operator< ( const SignalerConnection ,
const SignalerConnection  
) [friend]

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

bool operator== ( const SignalerConnection ,
const SignalerConnection  
) [friend]

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


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