libstp
Robotics library for Botball
Loading...
Searching...
No Matches
libstp::threading::ThreadManager::DaemonHandle Class Reference

#include <thread_manager.hpp>

Public Member Functions

 DaemonHandle () noexcept=default
 ~DaemonHandle ()
 DaemonHandle (const DaemonHandle &)=delete
DaemonHandle & operator= (const DaemonHandle &)=delete
 DaemonHandle (DaemonHandle &&other) noexcept
DaemonHandle & operator= (DaemonHandle &&other) noexcept
void stop () noexcept
bool owns_thread () const noexcept

Friends

class ThreadManager

Detailed Description

Move-only RAII token returned by ThreadManager::add_daemon. On destruction, requests stop on the underlying jthread and joins it, then removes it from the registry. A default-constructed handle owns nothing and is safe to destroy.

Definition at line 91 of file thread_manager.hpp.

Constructor & Destructor Documentation

◆ DaemonHandle() [1/3]

libstp::threading::ThreadManager::DaemonHandle::DaemonHandle ( )
defaultnoexcept

◆ ~DaemonHandle()

libstp::threading::ThreadManager::DaemonHandle::~DaemonHandle ( )
inline

Definition at line 95 of file thread_manager.hpp.

◆ DaemonHandle() [2/3]

libstp::threading::ThreadManager::DaemonHandle::DaemonHandle ( const DaemonHandle & )
delete

◆ DaemonHandle() [3/3]

libstp::threading::ThreadManager::DaemonHandle::DaemonHandle ( DaemonHandle && other)
inlinenoexcept

Definition at line 100 of file thread_manager.hpp.

Member Function Documentation

◆ operator=() [1/2]

DaemonHandle & libstp::threading::ThreadManager::DaemonHandle::operator= ( const DaemonHandle & )
delete

◆ operator=() [2/2]

DaemonHandle & libstp::threading::ThreadManager::DaemonHandle::operator= ( DaemonHandle && other)
inlinenoexcept

Definition at line 107 of file thread_manager.hpp.

◆ owns_thread()

bool libstp::threading::ThreadManager::DaemonHandle::owns_thread ( ) const
inlinenodiscardnoexcept

Definition at line 132 of file thread_manager.hpp.

◆ stop()

void libstp::threading::ThreadManager::DaemonHandle::stop ( )
inlinenoexcept

Stop and join the daemon now (idempotent). Subsequent calls and the destructor become no-ops.

Definition at line 122 of file thread_manager.hpp.

◆ ThreadManager

friend class ThreadManager
friend

Definition at line 135 of file thread_manager.hpp.


The documentation for this class was generated from the following file:
  • /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-threading/include/threading/thread_manager.hpp