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

Portable thread configuration bundle. More...

#include <thread_config.hpp>

Public Member Functions

 thread_config ()=default
auto set_name (std::string name) -> thread_config &
 Set thread name.
auto clear_name () noexcept -> thread_config &
 Clear previously configured thread name.
auto set_scheduling (scheduling_config scheduling) noexcept -> thread_config &
 Set scheduling configuration.
auto clear_scheduling () noexcept -> thread_config &
 Clear previously configured scheduling request.
auto set_affinity (thread_affinity affinity) -> thread_config &
 Set CPU affinity mask.
auto clear_affinity () noexcept -> thread_config &
 Clear previously configured CPU affinity.
auto get_name () const noexcept THREADSCHEDULE_LIFETIMEBOUND -> std::optional< std::string > const &
 Return configured thread name if present.
auto get_scheduling () const noexcept THREADSCHEDULE_LIFETIMEBOUND -> std::optional< scheduling_config > const &
 Return configured scheduling request if present.
auto get_affinity () const noexcept THREADSCHEDULE_LIFETIMEBOUND -> std::optional< thread_affinity > const &
 Return configured affinity set if present.
auto empty () const noexcept -> bool
 Return whether no settings are currently configured.

Detailed Description

Portable thread configuration bundle.

Instances can be reused across thread creation and runtime reconfiguration APIs. Any unset field is ignored when applied.

Definition at line 25 of file thread_config.hpp.

Constructor & Destructor Documentation

◆ thread_config()

threadschedule::thread_config::thread_config ( )
default

Member Function Documentation

◆ clear_affinity()

auto threadschedule::thread_config::clear_affinity ( ) ->thread_config &
inlinenoexcept

Clear previously configured CPU affinity.

Definition at line 81 of file thread_config.hpp.

References thread_config().

◆ clear_name()

auto threadschedule::thread_config::clear_name ( ) ->thread_config &
inlinenoexcept

Clear previously configured thread name.

Definition at line 43 of file thread_config.hpp.

References thread_config().

◆ clear_scheduling()

auto threadschedule::thread_config::clear_scheduling ( ) ->thread_config &
inlinenoexcept

Clear previously configured scheduling request.

Definition at line 62 of file thread_config.hpp.

References thread_config().

◆ empty()

auto threadschedule::thread_config::empty ( ) const->bool
inlinenodiscardnoexcept

Return whether no settings are currently configured.

Definition at line 107 of file thread_config.hpp.

◆ get_affinity()

auto threadschedule::thread_config::get_affinity ( ) const->std::optional< thread_affinity >const &
inlinenodiscardnoexcept

Return configured affinity set if present.

Definition at line 101 of file thread_config.hpp.

References THREADSCHEDULE_LIFETIMEBOUND.

◆ get_name()

auto threadschedule::thread_config::get_name ( ) const->std::optional< std::string >const &
inlinenodiscardnoexcept

Return configured thread name if present.

Definition at line 89 of file thread_config.hpp.

References THREADSCHEDULE_LIFETIMEBOUND.

◆ get_scheduling()

auto threadschedule::thread_config::get_scheduling ( ) const->std::optional< scheduling_config >const &
inlinenodiscardnoexcept

Return configured scheduling request if present.

Definition at line 95 of file thread_config.hpp.

References THREADSCHEDULE_LIFETIMEBOUND.

◆ set_affinity()

auto threadschedule::thread_config::set_affinity ( thread_affinity affinity) ->thread_config &
inline

Set CPU affinity mask.

Parameters
affinityNormalized affinity set.

Definition at line 73 of file thread_config.hpp.

References thread_config().

Referenced by threadschedule::advanced::profile_detail::make_config().

◆ set_name()

auto threadschedule::thread_config::set_name ( std::string name) ->thread_config &
inline

Set thread name.

Parameters
nameUser-visible thread name.

Definition at line 35 of file thread_config.hpp.

References thread_config().

Referenced by threadschedule::advanced::apply_profile_detailed(), and threadschedule::advanced::profile_detail::make_config().

◆ set_scheduling()

auto threadschedule::thread_config::set_scheduling ( scheduling_config scheduling) ->thread_config &
inlinenoexcept

Set scheduling configuration.

Parameters
schedulingPortable scheduling request.

Definition at line 54 of file thread_config.hpp.

References thread_config().


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