Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::TContractProvider< TParameterTypes >::Blocker Class Reference

RAII helper that ignores or delays triggers while active. More...

#include <spk_contract_provider.hpp>

Collaboration diagram for spk::TContractProvider< TParameterTypes >::Blocker:
Collaboration graph

Public Types

enum class  Mode { Ignore = 0 , Delay = 1 }
 Strategies controlling how callbacks are treated while blocked. More...

Public Member Functions

 Blocker (const Blocker &)=delete
Blockeroperator= (const Blocker &)=delete
 Blocker (Blocker &&p_other) noexcept
 Move-constructs a blocker, transferring block ownership.
Blockeroperator= (Blocker &&p_other) noexcept
 Move-assigns a blocker, releasing current ownership first.
bool active () const noexcept
 Checks if this blocker is attached to a provider.
Mode mode () const noexcept
 Gets the blocking mode.
void release () noexcept
 Releases the block, applying deferred triggers when appropriate.

Friends

class TContractProvider< TParameterTypes... >

Detailed Description

template<typename... TParameterTypes>
class spk::TContractProvider< TParameterTypes >::Blocker

RAII helper that ignores or delays triggers while active.

Member Enumeration Documentation

◆ Mode

template<typename... TParameterTypes>
enum class spk::TContractProvider::Blocker::Mode
strong

Strategies controlling how callbacks are treated while blocked.

Enumerator
Ignore 

Drop callbacks triggered during the block.

Delay 

Queue callbacks until the block ends.

Constructor & Destructor Documentation

◆ Blocker()

template<typename... TParameterTypes>
spk::TContractProvider< TParameterTypes >::Blocker::Blocker ( Blocker && p_other)
inlinenoexcept

Move-constructs a blocker, transferring block ownership.

Parameters
p_otherSource blocker to steal state from.

Member Function Documentation

◆ active()

template<typename... TParameterTypes>
bool spk::TContractProvider< TParameterTypes >::Blocker::active ( ) const
inlinenoexcept

Checks if this blocker is attached to a provider.

Returns
true when active.

◆ mode()

template<typename... TParameterTypes>
Mode spk::TContractProvider< TParameterTypes >::Blocker::mode ( ) const
inlinenoexcept

Gets the blocking mode.

Returns
Current mode.

◆ operator=()

template<typename... TParameterTypes>
Blocker & spk::TContractProvider< TParameterTypes >::Blocker::operator= ( Blocker && p_other)
inlinenoexcept

Move-assigns a blocker, releasing current ownership first.

Parameters
p_otherSource blocker to steal state from.
Returns
*this after transfer.
Here is the call graph for this function:

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