ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag > Class Template Reference

Base thread wrapper with common functionality. More...

#include <thread_wrapper.hpp>

Inheritance diagram for threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >:
[legend]
Collaboration diagram for threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >:
[legend]

Public Types

using native_handle_type = typename ThreadType::native_handle_type
using id = typename ThreadType::id

Public Member Functions

 BaseThreadWrapper (ThreadType &t)
void join ()
void detach ()
auto joinable () const noexcept -> bool
auto get_id () const noexcept -> id
auto native_handle () noexcept -> native_handle_type
auto set_name (std::string const &name) -> expected< void, std::error_code >
auto get_name () const -> std::optional< std::string >
auto set_priority (ThreadPriority priority) -> expected< void, std::error_code >
auto set_scheduling_policy (SchedulingPolicy policy, ThreadPriority priority) -> expected< void, std::error_code >
auto set_affinity (ThreadAffinity const &affinity) -> expected< void, std::error_code >
auto get_affinity () const -> std::optional< ThreadAffinity >

Static Public Member Functions

static auto set_nice_value (int nice_value) -> bool
static auto get_nice_value () -> std::optional< int >

Detailed Description

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
class threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >

Base thread wrapper with common functionality.

Definition at line 82 of file thread_wrapper.hpp.

Member Typedef Documentation

◆ id

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
using threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::id = typename ThreadType::id

Definition at line 86 of file thread_wrapper.hpp.

◆ native_handle_type

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
using threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::native_handle_type = typename ThreadType::native_handle_type

Definition at line 85 of file thread_wrapper.hpp.

Constructor & Destructor Documentation

◆ BaseThreadWrapper()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::BaseThreadWrapper ( ThreadType & t)
inlineexplicit

Definition at line 89 of file thread_wrapper.hpp.

Member Function Documentation

◆ detach()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
void threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::detach ( )
inline

Definition at line 103 of file thread_wrapper.hpp.

◆ get_affinity()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_affinity ( ) const -> std::optional<ThreadAffinity>
inlinenodiscard

Definition at line 315 of file thread_wrapper.hpp.

◆ get_id()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_id ( ) const -> id
inlinenodiscardnoexcept

Definition at line 115 of file thread_wrapper.hpp.

◆ get_name()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_name ( ) const -> std::optional<std::string>
inlinenodiscard

Definition at line 158 of file thread_wrapper.hpp.

◆ get_nice_value()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_nice_value ( ) -> std::optional<int>
inlinestatic

Definition at line 388 of file thread_wrapper.hpp.

◆ join()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
void threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::join ( )
inline

Definition at line 95 of file thread_wrapper.hpp.

◆ joinable()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::joinable ( ) const -> bool
inlinenodiscardnoexcept

Definition at line 111 of file thread_wrapper.hpp.

◆ native_handle()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::native_handle ( ) -> native_handle_type
inlinenodiscardnoexcept

Definition at line 119 of file thread_wrapper.hpp.

◆ set_affinity()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_affinity ( ThreadAffinity const & affinity) -> expected<void, std::error_code>
inlinenodiscard

Definition at line 281 of file thread_wrapper.hpp.

◆ set_name()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_name ( std::string const & name) -> expected<void, std::error_code>
inlinenodiscard

Definition at line 125 of file thread_wrapper.hpp.

◆ set_nice_value()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_nice_value ( int nice_value) -> bool
inlinestatic

Definition at line 356 of file thread_wrapper.hpp.

◆ set_priority()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_priority ( ThreadPriority priority) -> expected<void, std::error_code>
inlinenodiscard

Definition at line 199 of file thread_wrapper.hpp.

◆ set_scheduling_policy()

template<typename ThreadType, typename OwnershipTag = detail::OwningTag>
auto threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_scheduling_policy ( SchedulingPolicy policy,
ThreadPriority priority ) -> expected<void, std::error_code>
inlinenodiscard

Definition at line 258 of file thread_wrapper.hpp.


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