API Documentation
Loading...
Searching...
No Matches
ThreadQueue Class Reference

Executes a queue of commands in a single thread. More...

#include <ThreadQueue.h>

Inheritance diagram for ThreadQueue:
[legend]
Collaboration diagram for ThreadQueue:
[legend]

Public Member Functions

void add (const std::function< void()> &callback)
 
void run () override
 
 ThreadQueue (const String &name)
 
- Public Member Functions inherited from Thread
void detach ()
 
void forceStop ()
 
bool isPrimaryThread () const
 
bool isRunning () const
 
void join ()
 
virtual void requestStopThread ()
 
void setIsPrimaryThread (bool is_primary_thread)
 
void setThreadName (const String &name)
 
virtual bool shouldExitThread () const
 
void start ()
 
virtual void stopThread ()
 
 Thread ()
 
 Thread (const String &name)
 
 Thread (const Thread &name)=delete
 
const StringthreadName () const
 
virtual ~Thread ()
 

Public Attributes

Resource< bool > sv_is_running
 

Protected Attributes

std::function< void(const char *const)> m_error_callback
 
Buffer< std::function< void()> > m_functions
 
- Protected Attributes inherited from Thread
volatile bool m_is_running = false
 
volatile bool m_is_single_run = true
 

Additional Inherited Members

- Static Public Member Functions inherited from Thread
static ThreadCurrentThread ()
 
static String CurrentThreadName ()
 
static void ServiceVirtualThreads ()
 
static void SetCurrentThreadName (const String &name)
 
static void StopAllThreads ()
 
- Protected Member Functions inherited from Thread
const std::thread & self ()
 
- Static Protected Member Functions inherited from Thread
static void _setThreadName (const String &name)
 
static uint08 GetThreadCount ()
 

Detailed Description

Executes a queue of commands in a single thread.


autotoc_md586

Constructor & Destructor Documentation

◆ ThreadQueue()

ThreadQueue ( const String & name)
explicit

Member Function Documentation

◆ add()

void add ( const std::function< void()> & callback)
inline

◆ run()

void run ( )
overridevirtual

Reimplemented from Thread.

Member Data Documentation

◆ m_error_callback

std::function<void(const char* const)> m_error_callback
protected

◆ m_functions

Buffer<std::function<void()> > m_functions
protected

◆ sv_is_running

Resource<bool> sv_is_running

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