ThreadSchedule 4.1.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.

References id().

Referenced by operator=(), operator=(), scheduled_task_backend(), and scheduled_task_backend().

◆ 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

Member Function Documentation

◆ cancel()

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

◆ id()

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

Definition at line 69 of file scheduled_task_backend.hpp.

Referenced by scheduled_task_backend().

◆ is_cancelled()

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

Definition at line 62 of file scheduled_task_backend.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ scheduled_pool_backend_base

template<typename>
friend class scheduled_pool_backend_base
friend

Definition at line 79 of file scheduled_task_backend.hpp.

References scheduled_pool_backend_base.

Referenced by scheduled_pool_backend_base.


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