ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::nice_value Class Reference

Strongly-typed nice value in the POSIX range $[-20, 19]$. More...

#include <nice_value.hpp>

Public Member Functions

constexpr nice_value (int value)
 Construct and validate a nice value.
 
constexpr auto value () const noexcept -> int
 Return the wrapped nice value.
 

Static Public Member Functions

static auto create (int value) noexcept -> result< nice_value >
 Construct a nice value without exceptions.
 

Static Public Attributes

static constexpr int minimum = -20
 Lowest accepted nice value (highest priority).
 
static constexpr int maximum = 19
 Highest accepted nice value (lowest priority).
 

Friends

constexpr auto operator== (nice_value lhs, nice_value rhs) noexcept -> bool
 
constexpr auto operator!= (nice_value lhs, nice_value rhs) noexcept -> bool
 

Detailed Description

Strongly-typed nice value in the POSIX range $[-20, 19]$.

Definition at line 18 of file nice_value.hpp.

Constructor & Destructor Documentation

◆ nice_value()

constexpr threadschedule::nice_value::nice_value ( int  value)
inlineexplicitconstexpr

Construct and validate a nice value.

Parameters
valueNice value in the range minimum .. maximum.
Exceptions
std::invalid_argumentif value is out of range.

Definition at line 31 of file nice_value.hpp.

Member Function Documentation

◆ create()

static auto threadschedule::nice_value::create ( int  value) -> result<nice_value>
inlinestaticnoexcept

Construct a nice value without exceptions.

Parameters
valueNice value in the range minimum .. maximum.
Returns
A valid nice_value or errc::invalid_argument.

Definition at line 39 of file nice_value.hpp.

References maximum, and value().

◆ value()

constexpr auto threadschedule::nice_value::value ( ) const -> int
inlineconstexprnoexcept

Return the wrapped nice value.

Definition at line 48 of file nice_value.hpp.

Referenced by create().

Friends And Related Symbol Documentation

◆ operator!=

constexpr auto operator!= ( nice_value  lhs,
nice_value  rhs 
) -> bool
friend

Definition at line 59 of file nice_value.hpp.

◆ operator==

constexpr auto operator== ( nice_value  lhs,
nice_value  rhs 
) -> bool
friend

Definition at line 54 of file nice_value.hpp.

Member Data Documentation

◆ maximum

constexpr int threadschedule::nice_value::maximum = 19
staticconstexpr

Highest accepted nice value (lowest priority).

Definition at line 24 of file nice_value.hpp.

Referenced by create().

◆ minimum

constexpr int threadschedule::nice_value::minimum = -20
staticconstexpr

Lowest accepted nice value (highest priority).

Definition at line 22 of file nice_value.hpp.


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