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

Copyable handle for a cancellable scheduled task. More...

#include <scheduled_task_backend.hpp>

Public Member Functions

 scheduled_task_backend (uint64_t id)
 
 scheduled_task_backend (scheduled_task_backend const &)=default
 
auto operator= (scheduled_task_backend const &) -> scheduled_task_backend &=default
 
 scheduled_task_backend (scheduled_task_backend &&other) noexcept
 
auto operator= (scheduled_task_backend &&other) noexcept -> scheduled_task_backend &
 
void cancel ()
 
auto is_cancelled () const noexcept -> bool
 
auto id () const noexcept -> uint64_t
 

Friends

template<typename >
class scheduled_pool_backend_base
 

Detailed Description

Copyable handle for a cancellable scheduled task.

Copyable (its cancellation state is shared). Both cancel() and is_cancelled() are thread-safe.

Cancellation is cooperative: the scheduler checks the flag before dispatching the task to the worker pool, but a task that is already executing will not be interrupted.

Definition at line 25 of file scheduled_task_backend.hpp.

Constructor & Destructor Documentation

◆ scheduled_task_backend() [1/3]

threadschedule::detail::scheduled_task_backend::scheduled_task_backend ( uint64_t  id)
inlineexplicit

Definition at line 28 of file scheduled_task_backend.hpp.

◆ scheduled_task_backend() [2/3]

threadschedule::detail::scheduled_task_backend::scheduled_task_backend ( scheduled_task_backend const &  )
default

◆ scheduled_task_backend() [3/3]

threadschedule::detail::scheduled_task_backend::scheduled_task_backend ( scheduled_task_backend &&  other)
inlinenoexcept

Definition at line 36 of file scheduled_task_backend.hpp.

References threadschedule::detail::other.

Member Function Documentation

◆ cancel()

void threadschedule::detail::scheduled_task_backend::cancel ( )
inline

◆ id()

auto threadschedule::detail::scheduled_task_backend::id ( ) const -> uint64_t
inlinenoexcept

Definition at line 69 of file scheduled_task_backend.hpp.

Referenced by threadschedule::scheduled_task::id().

◆ is_cancelled()

auto threadschedule::detail::scheduled_task_backend::is_cancelled ( ) const -> bool
inlinenoexcept

◆ operator=() [1/2]

auto threadschedule::detail::scheduled_task_backend::operator= ( scheduled_task_backend &&  other) -> scheduled_task_backend&
inlinenoexcept

Definition at line 43 of file scheduled_task_backend.hpp.

References threadschedule::detail::other.

◆ operator=() [2/2]

auto threadschedule::detail::scheduled_task_backend::operator= ( scheduled_task_backend const &  ) -> scheduled_task_backend &=default
default

Friends And Related Symbol Documentation

◆ scheduled_pool_backend_base

template<typename >
friend class scheduled_pool_backend_base
friend

Definition at line 79 of file scheduled_task_backend.hpp.


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