MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::thread::BeforeOptionNoCallback< Clock, Duration > Struct Template Reference

Option to add a timeout on select to ensure a path runs before a timeout If the timeout is hit, a timeout error will be returned from the select. More...

#include <select.hpp>

Public Member Functions

Result< void, SelectOptionErrorsattempt ()
 
bool prevents_deadlock () const noexcept
 

Public Attributes

std::chrono::time_point< Clock, Duration > time_point
 

Detailed Description

template<typename Clock, typename Duration>
struct mtcore::thread::BeforeOptionNoCallback< Clock, Duration >

Option to add a timeout on select to ensure a path runs before a timeout If the timeout is hit, a timeout error will be returned from the select.

Template Parameters
ClockClock to get time from
DurationDuration for time point

Definition at line 205 of file select.hpp.

Member Function Documentation

◆ attempt()

template<typename Clock, typename Duration>
Result< void, SelectOptionErrors > mtcore::thread::BeforeOptionNoCallback< Clock, Duration >::attempt ( )
inline

Definition at line 208 of file select.hpp.

208 {
209 if (time_point <= Clock::now()) {
211 }
213 }
Error< Underlying > error(Underlying err)
Creates an error.
Definition result.hpp:425
Option to add a timeout on select to ensure a path runs before a timeout If the timeout is hit,...
Definition select.hpp:205
std::chrono::time_point< Clock, Duration > time_point
Definition select.hpp:206
Here is the call graph for this function:

◆ prevents_deadlock()

template<typename Clock, typename Duration>
bool mtcore::thread::BeforeOptionNoCallback< Clock, Duration >::prevents_deadlock ( ) const
inlinenodiscardnoexcept

Definition at line 216 of file select.hpp.

216{ return false; }

Member Data Documentation

◆ time_point

template<typename Clock, typename Duration>
std::chrono::time_point<Clock, Duration> mtcore::thread::BeforeOptionNoCallback< Clock, Duration >::time_point

Definition at line 206 of file select.hpp.


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