ThreadSchedule 3.0.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 -> std::optional< std::string > const &
 Return configured thread name if present.
 
auto get_scheduling () const noexcept -> std::optional< scheduling_config > const &
 Return configured scheduling request if present.
 
auto get_affinity () const noexcept -> 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 24 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 80 of file thread_config.hpp.

◆ clear_name()

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

Clear previously configured thread name.

Definition at line 42 of file thread_config.hpp.

◆ clear_scheduling()

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

Clear previously configured scheduling request.

Definition at line 61 of file thread_config.hpp.

◆ empty()

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

Return whether no settings are currently configured.

Definition at line 106 of file thread_config.hpp.

◆ get_affinity()

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

Return configured affinity set if present.

Definition at line 100 of file thread_config.hpp.

◆ get_name()

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

Return configured thread name if present.

Definition at line 88 of file thread_config.hpp.

◆ get_scheduling()

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

Return configured scheduling request if present.

Definition at line 94 of file thread_config.hpp.

◆ 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 72 of file thread_config.hpp.

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 34 of file thread_config.hpp.

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 53 of file thread_config.hpp.


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