4#ifndef _Stroika_Foundation_Execution_WaitForIOReady_h_
5#define _Stroika_Foundation_Execution_WaitForIOReady_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
9#include "Stroika/Foundation/Common/Common.h"
10#include "Stroika/Foundation/Containers/Collection.h"
11#include "Stroika/Foundation/Containers/Set.h"
47#ifndef qStroika_Foundation_Execution_WaitForIOReady_BreakWSAPollIntoTimedMillisecondChunks
48#if qStroika_Foundation_Common_Platform_Windows
49#define qStroika_Foundation_Execution_WaitForIOReady_BreakWSAPollIntoTimedMillisecondChunks 3000
53 namespace WaitForIOReady_Support {
58#if qStroika_Foundation_Common_Platform_Windows
66 class WaitForIOReady_Base {
79 enum class TypeOfMonitor {
117 static inline const TypeOfMonitorSet kDefaultTypeOfMonitor{TypeOfMonitor::eRead};
126 static auto _WaitQuietlyUntil (
const pair<SDKPollableType, TypeOfMonitorSet>* start,
const pair<SDKPollableType, TypeOfMonitorSet>* end,
145 virtual bool IsSet ()
const = 0;
148 virtual void Set () = 0;
151 virtual void Clear () = 0;
155 virtual pair<SDKPollableType, WaitForIOReady_Base::TypeOfMonitorSet> GetWaitInfo () = 0;
159 template <
typename T>
160 struct WaitForIOReady_Traits {
164 using HighLevelType = T;
222 template <
typename T = WaitForIOReady_Support::SDKPollableType,
typename TRAITS = WaitForIOReady_Support::WaitForIOReady_Traits<T>>
223 class [[nodiscard]]
WaitForIOReady :
public WaitForIOReady_Support::WaitForIOReady_Base {
225 using TraitsType = TRAITS;
233 optional<pair<SDKPollableType, TypeOfMonitorSet>> pollable2Wakeup = nullopt);
235 optional<pair<SDKPollableType, TypeOfMonitorSet>> pollable2Wakeup = nullopt);
237 optional<pair<SDKPollableType, TypeOfMonitorSet>> pollable2Wakeup = nullopt);
312 const optional<pair<SDKPollableType, TypeOfMonitorSet>> fPollable2Wakeup_;
322#include "WaitForIOReady.inl"
#define Stroika_Define_Enum_Bounds(FIRST_ITEM, LAST_ITEM)
time_point< RealtimeClock, DurationSeconds > TimePointSeconds
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates e...
chrono::duration< double > DurationSeconds
chrono::duration<double> - a time span (length of time) measured in seconds, but high precision.
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
NOT a real mutex - just a debugging infrastructure support tool so in debug builds can be assured thr...
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.
unique_ptr< EventFD > mkEventFD()