|
BDE 4.39.x Production Release
|
#include <bdlmt_signaler.h>
This class template provides a thread-safe signaler that executes connected slots when invoked via its call operator. t_PROT is a function signature and must have a return type of void. The callable objects assigned to the slots may have return types other than void, in which case their return values will be discarded.
See bdlmt_signaler
Public Types | |
| typedef void | ResultType |
Public Member Functions | |
| Signaler (bslma::Allocator *basicAllocator=0) | |
| ~Signaler () | |
| template<class t_FUNC > | |
| SignalerConnection | connect (BSLS_COMPILERFEATURES_FORWARD_REF(t_FUNC) slot, int group=0) |
| void | disconnectAllSlots () BSLS_KEYWORD_NOEXCEPT |
| void | disconnectAllSlotsAndWait () BSLS_KEYWORD_NOEXCEPT |
| void | disconnectGroup (int group) BSLS_KEYWORD_NOEXCEPT |
| void | disconnectGroupAndWait (int group) BSLS_KEYWORD_NOEXCEPT |
| bsl::size_t | slotCount () const |
Friends | |
| struct | Signaler_Invocable< Signaler< t_PROT >, t_PROT > |
| typedef void bdlmt::Signaler< t_PROT >::ResultType |
|
explicit |
Create a Signaler object having no connected slots. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
|
inline |
Destroy this object. Call disconnectAllSlots().
|
inline |
Connect the specified slot, a callable object which must meet the Slot Object Requirements described in the component documentation, to this signaler. Optionally specify a group used to order slots upon invocation. Return an instance of SignalerConnection representing the created connection. This function meets the strong exception guarantee.
t_FUNC may have a return type other than void, but in that case, when the slot is called, the return value will be discarded.
|
inline |
Disconnect all slots, if any, connected to this signaler. Any signals emitted on the corresponding signaler that happen after this call to disconnect completes will not call any slots that were connected prior to this call. Throws nothing.
|
inline |
Disconnect all slots, if any, connected to this signaler. Any signals emitted on the corresponding signaler that happens after this call to disconnect completes will not call any slots that were connected prior to this call. This function blocks the calling thread pending completion of all ongoing signals being emitted on the signaler. Throws nothing.
|
inline |
Disconnect all slots, if any, connected to this signaler in the specified group. Any signal emitted on the corresponding signaler that happens after this call to disconnect completes will not call any slots in group that were connected prior to this call. Throws nothing.
group is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected.
|
inline |
Disconnect all slots, if any, connected to this signaler in the specified group. Any signal emitted on the corresponding signaler that happens after this call to disconnect completes will not call any slots in group that were connected prior to this call. This function blocks the calling thread pending completion of ongoing signals being emitted on the signaler. Throws nothing.
group is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected.
|
inline |
Return the number of slots connected to this signaler.
slotCount() is approximate if the signaler is being simultaneously manipulated by other threads.
|
friend |