[#BloombergLP-bdlmt-Signaler]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::Signaler
:relfileprefix: ../../
:mrdocs:

This class template provides a thread&hyphen;safe signaler that executes connected slots when invoked via its call operator&period; `t&lowbar;PROT` is a function signature and must have a return type of `void`&period; The callable objects assigned to the slots may have return types other than `void`, in which case their return values will be discarded&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;signaler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;PROT&gt;
class Signaler
    : public xref:BloombergLP/bdlmt/Signaler_Invocable-03.adoc[Signaler&lowbar;Invocable&lt;Signaler&lt;t&lowbar;PROT&gt;, t&lowbar;PROT&gt;]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlmt/Signaler_Invocable-03.adoc[Signaler&lowbar;Invocable&lt;Signaler&lt;t&lowbar;PROT&gt;, t&lowbar;PROT&gt;]`
| Provides a call operator for the derived class `bdlmt&colon;&colon;Signaler`, such that its call signature is identical to that of `t&lowbar;PROT`&period;
|===

== Type Aliases

[cols="1"]
|===
| Name
| xref:BloombergLP/bdlmt/Signaler/ResultType.adoc[`ResultType`] 
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/Signaler/2constructor.adoc[`Signaler`]         [.small]#[constructor]#
| Create a `Signaler` object having no connected slots&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; Note that the supplied allocator must remain valid until all connection objects associated with this signaler are destroyed&period;
| xref:BloombergLP/bdlmt/Signaler/2destructor.adoc[`&#126;Signaler`] [.small]#[destructor]#
| Destroy this object&period; Call `disconnectAllSlots()`&period; The behavior is undefined if this function is invoked from a slot connected to this signaler&period;
| xref:BloombergLP/bdlmt/Signaler/connect.adoc[`connect`] 
| Connect the specified `slot`, a callable object which must meet the `Slot Object Requirements` described in the component documentation, to this signaler&period; Optionally specify a `group` used to order slots upon invocation&period; Return an instance of `SignalerConnection` representing the created connection&period; This function meets the strong exception guarantee&period; Note that the connected slot may be called by a signal emitted from another thread before this function completes&period; Also note that it is unspecified whether connecting a slot while the signaler is emitting will result in the slot being called immediately&period; Note that `t&lowbar;FUNC` may have a return type other than `void`, but in that case, when the slot is called, the return value will be discarded&period;
| xref:BloombergLP/bdlmt/Signaler/disconnectAllSlots.adoc[`disconnectAllSlots`] 
| Disconnect all slots, if any, connected to this signaler&period; 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&period; Throws nothing&period; Note that this function does not block the calling thread pending completion of ongoing signals emitted on the signaler&period; Also note that it is unspecified how many slots, if any, will be called by any invocation on the signaler that begins before this function completes&period; Also note that if a slot is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected&period;
| xref:BloombergLP/bdlmt/Signaler/disconnectAllSlotsAndWait.adoc[`disconnectAllSlotsAndWait`] 
| Disconnect all slots, if any, connected to this signaler&period; 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&period; This function blocks the calling thread pending completion of all ongoing signals being emitted on the signaler&period; Throws nothing&period; The behavior is undefined if this method is called from a slot connected to the signaler&period; Note that it is unspecified how many slots, if any, will be called by any invocation on the signaler that begins before this function completes&period; Also note that if a slot is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected&period;
| xref:BloombergLP/bdlmt/Signaler/disconnectGroup.adoc[`disconnectGroup`] 
| Disconnect all slots, if any, connected to this signaler in the specified `group`&period; 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&period; Throws nothing&period; Note that this function does not block the calling thread pending completion of ongoing signals emitted on the signaler&period; Also note that it is unspecified how many affected slots, if any, will be signalled to by any invocation on the signaler that begins before this function completes&period; Also note that if a slot in `group` is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected&period;
| xref:BloombergLP/bdlmt/Signaler/disconnectGroupAndWait.adoc[`disconnectGroupAndWait`] 
| Disconnect all slots, if any, connected to this signaler in the specified `group`&period; 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&period; This function blocks the calling thread pending completion of ongoing signals being emitted on the signaler&period; Throws nothing&period; The behavior is undefined if this method is called from a slot connected to the signaler&period; Note that it is unspecified how many affected slots, if any, will be signaled to by any emission on the signaler that begins before this function completes&period; Also note that if a slot in `group` is connected to this signaler during a call to this function, it is unspecified whether that slot will be disconnected&period;
| xref:BloombergLP/bdlmt/Signaler/slotCount.adoc[`slotCount`] 
| Return the number of slots connected to this signaler&period; Note that the value returned by `slotCount()` is approximate if the signaler is being simultaneously manipulated by other threads&period;
| xref:BloombergLP/bdlmt/Signaler/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;Signaler, UsesBslmaAllocator&gt;`] 
| 
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlmt/Signaler_Invocable-03.adoc[BloombergLP::bdlmt::Signaler&lowbar;Invocable]`
| Provides a call operator for the derived class `bdlmt&colon;&colon;Signaler`, such that its call signature is identical to that of `t&lowbar;PROT`&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
