YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::OneShotEvent::Waiter Struct Reference

Waiter is public for advanced users. More...

#include <one_shot_event.hpp>

Inheritance diagram for yaclib::OneShotEvent::Waiter:
[legend]
Collaboration diagram for yaclib::OneShotEvent::Waiter:
[legend]

Public Member Functions

void Call () noexcept final
 
- Public Member Functions inherited from yaclib::Job
virtual void Drop () noexcept
 
- Public Member Functions inherited from yaclib::IRef
virtual void IncRef () noexcept
 Increments reference counter.
 
virtual void DecRef () noexcept
 Decrements reference counter.
 
virtual ~IRef () noexcept=default
 
- Public Member Functions inherited from yaclib::detail::MutexEvent
Token Make () noexcept
 
void Wait (Token &token) noexcept
 
template<typename Rep , typename Period >
bool Wait (Token &token, const std::chrono::duration< Rep, Period > &timeout_duration) noexcept
 
template<typename Clock , typename Duration >
bool Wait (Token &token, const std::chrono::time_point< Clock, Duration > &timeout_time) noexcept
 
void Set () noexcept
 
void Reset () noexcept
 

Additional Inherited Members

- Public Types inherited from yaclib::detail::MutexEvent
using Token = std::unique_lock< yaclib_std::mutex >
 
- Public Attributes inherited from yaclib::detail::Node
Nodenext = nullptr
 

Detailed Description

Waiter is public for advanced users.

Sometimes we don't want to recreate Waiter on every Wait call (it's created on stack).

So we make Waiter public for such users, and they can write code like:

Waiter _waiter; OneShotEvent _event; // code like OneShotEvent::Wait() but with our own _waiter _event.Set(); // code like OneShotEvent::Wait() but with our own _waiter

Definition at line 216 of file one_shot_event.hpp.

Member Function Documentation

◆ Call()

void yaclib::OneShotEvent::Waiter::Call ( )
inlinefinalvirtualnoexcept

Reimplemented from yaclib::IFunc.

Definition at line 217 of file one_shot_event.hpp.

References yaclib::OneShotEvent::Set().


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