NUMA++ 0.11.0
Loading...
Searching...
No Matches
numapp::Scheduler Class Reference

A sum-type of all supported schedulers. More...

#include <numapp/scheduler.hpp>

Public Member Functions

template<class T>
constexpr bool HoldsScheduler () const noexcept
 Query the held scheduler.
 
template<class T>
constexpr T GetScheduler () const
 Get the held scheduler.
 
SchedulerVariant const & Get () const noexcept
 Get the underlying scheduler.
 
 operator SchedulerVariant () const noexcept
 Enable implicit conversion to underlying SchedulerVariant.
 

Static Public Member Functions

static Scheduler MakeFromActive ()
 Return active scheduler policy for this thread.
 
static Scheduler MakeFromActive (pid_t pid)
 Return active scheduler policy for thread with pid.
 

Related Symbols

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &os, Scheduler const &scheduler)
 Formats scheduler and inserts it to os.
 
Apply Scheduler to Specified Thread

Applies scheduler to specified thread.

std::error_code Apply (pid_t thread, Scheduler const &scheduler) noexcept
 Apply variadic scheduler to specified thread.
 
Apply Scheduler to Current Thread

Applies specified scheduler to current thread.

std::error_code Apply (Scheduler const &scheduler) noexcept
 Apply variadic scheduler to this thread.
 

Detailed Description

A sum-type of all supported schedulers.

Related man-page(s):

Definition at line 449 of file scheduler.hpp.

Member Function Documentation

◆ GetScheduler()

template<class T>
T numapp::Scheduler::GetScheduler ( ) const
inlinenodiscardconstexpr

Get the held scheduler.

idle_scheduler = scheduler.GetScheduler<IdleScheduler>(); // may throw
Exceptions
std::bad_variant_accessif T does not match held scheduler.

Definition at line 490 of file scheduler.hpp.

◆ HoldsScheduler()

template<class T>
bool numapp::Scheduler::HoldsScheduler ( ) const
inlinenodiscardconstexprnoexcept

Query the held scheduler.

if (scheduler.HoldsScheduler<IdleScheduler>()) {
    // ...
}

Definition at line 478 of file scheduler.hpp.

◆ MakeFromActive() [1/2]

static Scheduler numapp::Scheduler::MakeFromActive ( )
staticnodiscard

Return active scheduler policy for this thread.

Exceptions
std::system_errorwith std::errc::not_supported error if unknown policy is found..

◆ MakeFromActive() [2/2]

static Scheduler numapp::Scheduler::MakeFromActive ( pid_t pid)
staticnodiscard

Return active scheduler policy for thread with pid.

Exceptions
std::system_errorwith std::errc::not_supported error if unknown policy is found..

Friends And Related Symbol Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
Scheduler const & scheduler )
related

Formats scheduler and inserts it to os.

Parameters
osoutput stream to insert into.
schedulerScheduler to format.
Returns
os

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