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

#include <bdlmt_signaler.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (SignalerConnectionGuard, bslmf::IsBitwiseMoveable)
 
 SignalerConnectionGuard ()
 
 SignalerConnectionGuard (const SignalerConnection &connection, bool waitOnDisconnect=false)
 
 SignalerConnectionGuard (bslmf::MovableRef< SignalerConnection > connection, bool waitOnDisconnect=false) BSLS_KEYWORD_NOEXCEPT
 
 SignalerConnectionGuard (bslmf::MovableRef< SignalerConnectionGuard > original) BSLS_KEYWORD_NOEXCEPT
 
 ~SignalerConnectionGuard ()
 
SignalerConnectionGuardoperator= (bslmf::MovableRef< SignalerConnectionGuard > rhs) BSLS_KEYWORD_NOEXCEPT
 
SignalerConnection release () BSLS_KEYWORD_NOEXCEPT
 
void swap (SignalerConnectionGuard &other) BSLS_KEYWORD_NOEXCEPT
 
const SignalerConnectionconnection () const BSLS_KEYWORD_NOEXCEPT
 
bool waitOnDisconnect () const BSLS_KEYWORD_NOEXCEPT
 

Detailed Description

This guard type has a SignalerConnection, through which it can manage a slot, and when it is destroyed or assigned to it will disconnect that slot. It also contains a boolean waitOnDisconnect attribute, which determines whether disconnect or disconnectAndWait is used to disconnect the slot. The waitOnDisconnect attribute is set in constructors from a SignalerConnection and propagated when move constructing or move assigning a guard to a different guard.

See bdlmt_signaler

Constructor & Destructor Documentation

◆ SignalerConnectionGuard() [1/4]

bdlmt::SignalerConnectionGuard::SignalerConnectionGuard ( )

Create a SignalerConnectionGuard object having no associated slot with waitOnDisconnect set to false.

◆ SignalerConnectionGuard() [2/4]

bdlmt::SignalerConnectionGuard::SignalerConnectionGuard ( const SignalerConnection connection,
bool  waitOnDisconnect = false 
)
explicit

Create a SignalerConnectionGuard object that refers to and assumes management of the same slot, if any, as the specified connection object. Upon destruction or assignment, the optionally specified waitOnDisconnect determines whether disconnect or disconnectAndWait will be called on the slot managed by this object, if any.

◆ SignalerConnectionGuard() [3/4]

bdlmt::SignalerConnectionGuard::SignalerConnectionGuard ( bslmf::MovableRef< SignalerConnection connection,
bool  waitOnDisconnect = false 
)
explicit

Create a SignalerConnectionGuard that refers to the same slot, if any, as the specified connection, which is left in an unspecified state. Optionally specify waitOnDisconnect indicating whether disconnect or disconnectAndWait will be called on the slot, if any, managed by this object upon destruction or assignment. Throws nothing.

◆ SignalerConnectionGuard() [4/4]

bdlmt::SignalerConnectionGuard::SignalerConnectionGuard ( bslmf::MovableRef< SignalerConnectionGuard original)

Create a SignalerConnectionGuard that manages the same slot, if any, as the specified original, which is left in the default-constructed state. Copy the waitOnDisconnect state from original, indicating whether disconnect() or disconnectAndWait() will be called on the slot, if any, contained in this object upon destruction or assignment. Throws nothing.

◆ ~SignalerConnectionGuard()

bdlmt::SignalerConnectionGuard::~SignalerConnectionGuard ( )

Destroy this object. If a slot is being managed by this object, call disconnect or disconnectAndWait on it, depending upon the value of waitOnDisconnect.

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

bdlmt::SignalerConnectionGuard::BSLMF_NESTED_TRAIT_DECLARATION ( SignalerConnectionGuard  ,
bslmf::IsBitwiseMoveable   
)

◆ connection()

const SignalerConnection & bdlmt::SignalerConnectionGuard::connection ( ) const
inline

Return a const reference to the connection held by this object. Throws nothing.

◆ operator=()

SignalerConnectionGuard & bdlmt::SignalerConnectionGuard::operator= ( bslmf::MovableRef< SignalerConnectionGuard rhs)

If there is a currently managed slot, call disconnect or disconnectAndWait on it, depending on the value of the waitOnDisconnect state. Make this connection refer to the same slot, if any, as the specified rhs, leaving rhs in the default-constructed state. Use the waitOnDisconnect state of rhs, indicating whether disconnect() or disconnectAndWait() will be called on the slot managed by this object upon destruction or assignment. Return *this. Throws nothing.

◆ release()

SignalerConnection bdlmt::SignalerConnectionGuard::release ( )

Disassociate this guard from its associated slot, if any, and reset *this to a default-constructed state. Return a connection object referring to the slot, if any, that this guard was associated with prior to this call. Throws nothing.

◆ swap()

void bdlmt::SignalerConnectionGuard::swap ( SignalerConnectionGuard other)

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

◆ waitOnDisconnect()

bool bdlmt::SignalerConnectionGuard::waitOnDisconnect ( ) const
inline

Return a bool that indicates the value that determines whether the slot, if any, managed by this object will be disconnected using disconnect or disconnectAndWait. Throws nothing.


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