[#BloombergLP-bslstl-StopToken_RefCountedState] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::StopToken_RefCountedState :relfileprefix: ../../ :mrdocs: Component‐private `StopState` with a `stop_source` reference count. == Synopsis Declared in `<bslstl_stoptoken.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct StopToken_RefCountedState : xref:BloombergLP/bslstl/StopState.adoc[StopState] ---- == Description This component‐private struct adds a reference count to the internal `StopState` class. This reference count represents the number of `bsl::stop_source` objects that refer to the stop state (NOT the total number of objects that refer to the stop state). Implementation note: The reference count has been kept outside the `StopState` object in order to enable `StopState` to potentially be reused to implement `in_place_stop_source` (from WG21 proposal P2300R7) without the overhead from the reference count. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslstl/StopState.adoc[StopState]` | Shared stop state that tracks a stop request and registered callbacks. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/StopState/deregister.adoc[`deregister`] | Remove `node` from this stop state, or wait if its callback is executing. | xref:BloombergLP/bslstl/StopState/enregister.adoc[`enregister`] | Register `node` with this stop state, or invoke it if a stop was already requested. | xref:BloombergLP/bslstl/StopState/requestStop.adoc[`requestStop`] | Request a stop on this state and invoke all registered callbacks. | xref:BloombergLP/bslstl/StopState/stopRequested.adoc[`stopRequested`] | Return `true` if a stop has been requested on this `StopState` object, and `false` otherwise. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/StopToken_RefCountedState/d_stopSourceCount.adoc[`d_stopSourceCount`] | The number of `bsl::stop_source` objects that refer to this stop state. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#