BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlmt::Signaler_SlotNode< t_PROT > Class Template Reference

#include <bdlmt_signaler.h>

Inheritance diagram for bdlmt::Signaler_SlotNode< t_PROT >:
bdlmt::Signaler_SlotNode_Base

Public Types

typedef bsl::pair< int, unsigned > SlotMapKey
 

Public Member Functions

template<class t_FUNC >
 Signaler_SlotNode (const bsl::weak_ptr< SignalerNode > &signalerNodePtr, BSLS_COMPILERFEATURES_FORWARD_REF(t_FUNC) slot, SlotMapKey slotMapKey, bslma::Allocator *allocator)
 
 ~Signaler_SlotNode ()=default
 Destroy this object.
 
void disconnect () BSLS_KEYWORD_NOEXCEPT BSLS_KEYWORD_OVERRIDE
 
void disconnectAndWait () BSLS_KEYWORD_NOEXCEPT BSLS_KEYWORD_OVERRIDE
 
void notifyDisconnected () BSLS_KEYWORD_NOEXCEPT
 
void invoke (typename ArgumentType::ForwardingType1 arg1, typename ArgumentType::ForwardingType2 arg2, typename ArgumentType::ForwardingType3 arg3, typename ArgumentType::ForwardingType4 arg4, typename ArgumentType::ForwardingType5 arg5, typename ArgumentType::ForwardingType6 arg6, typename ArgumentType::ForwardingType7 arg7, typename ArgumentType::ForwardingType8 arg8, typename ArgumentType::ForwardingType9 arg9) const
 
bool isConnected () const BSLS_KEYWORD_OVERRIDE
 

Additional Inherited Members

- Protected Member Functions inherited from bdlmt::Signaler_SlotNode_Base
virtual ~Signaler_SlotNode_Base ()
 Virtual d'tor.
 

Detailed Description

template<class t_PROT>
class bdlmt::Signaler_SlotNode< t_PROT >

Dynamically-allocated container for one slot, containing a function object that can be called by a signaler. Owned by a shared pointer in a skip list container in the Signaler_Node. Also referred to by weak pointers from SignalerConnection objects.

See bdlmt_signaler

Member Typedef Documentation

◆ SlotMapKey

template<class t_PROT >
typedef bsl::pair<int, unsigned> bdlmt::Signaler_SlotNode< t_PROT >::SlotMapKey

Defines a "key" used to index slots in an associative collection. The first element of the pair is the slot call group; the second is the slot ID.

Constructor & Destructor Documentation

◆ Signaler_SlotNode()

template<class t_PROT >
template<class t_FUNC >
bdlmt::Signaler_SlotNode< t_PROT >::Signaler_SlotNode ( const bsl::weak_ptr< SignalerNode > &  signalerNodePtr,
BSLS_COMPILERFEATURES_FORWARD_REF(t_FUNC)  slot,
SlotMapKey  slotMapKey,
bslma::Allocator allocator 
)

Create a Signaler_SlotNode object associated with signaler node at the specified signalerNodePtr using the specified slotMapKey and with the specified slot callable object. Specify an allocator used to supply memory.

◆ ~Signaler_SlotNode()

template<class t_PROT >
bdlmt::Signaler_SlotNode< t_PROT >::~Signaler_SlotNode ( )
default

Member Function Documentation

◆ disconnect()

template<class t_PROT >
void bdlmt::Signaler_SlotNode< t_PROT >::disconnect ( )
inlinevirtual

Disconnect this slot and return without waiting. If the slot was already disconnected, this function has no effect. Throws nothing. Note that it is guaranteed that this slot will not be called by a signal on the same signaler that begins after this function completes.

Implements bdlmt::Signaler_SlotNode_Base.

◆ disconnectAndWait()

template<class t_PROT >
void bdlmt::Signaler_SlotNode< t_PROT >::disconnectAndWait ( )
inlinevirtual

Disconnect this slot and block the calling thread pending the completion of signals being emitted on the signaler by any other threads. If the slot was already disconnected, this function has no effect on the slot. Throws nothing. The behavior is undefined if this function is called from a slot on the same signaler. Note that it is guaranteed that this slot will not be called by a signal on the same signaler that begins after this function completes, whether wait is true or not.

Implements bdlmt::Signaler_SlotNode_Base.

◆ invoke()

template<class t_PROT >
void bdlmt::Signaler_SlotNode< t_PROT >::invoke ( typename ArgumentType::ForwardingType1  arg1,
typename ArgumentType::ForwardingType2  arg2,
typename ArgumentType::ForwardingType3  arg3,
typename ArgumentType::ForwardingType4  arg4,
typename ArgumentType::ForwardingType5  arg5,
typename ArgumentType::ForwardingType6  arg6,
typename ArgumentType::ForwardingType7  arg7,
typename ArgumentType::ForwardingType8  arg8,
typename ArgumentType::ForwardingType9  arg9 
) const
inline

Invoke the stored callback c, as if by c(args...), where args... are the specified arguments arg1, arg2, arg3, etc., except that the actual number of arguments passed to c is equal to the number of arguments for t_PROT. If this slot is disconnected, this function has no effect.

◆ isConnected()

template<class t_PROT >
bool bdlmt::Signaler_SlotNode< t_PROT >::isConnected ( ) const
inlinevirtual

Return true if this slot is connected to its associated signaler, and false otherwise.

Implements bdlmt::Signaler_SlotNode_Base.

◆ notifyDisconnected()

template<class t_PROT >
void bdlmt::Signaler_SlotNode< t_PROT >::notifyDisconnected ( )
inline

Notify this slot that is was disconnected from its associated signaler. Throws nothing. After this function completes, isConnected() returns false.


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