Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::ThreadLoop Class Reference

#include <threadloop.h>

Inheritance diagram for jami::ThreadLoop:
Inheritance graph
Collaboration diagram for jami::ThreadLoop:
Collaboration graph

Public Types

enum class  ThreadState { READY , RUNNING , STOPPING }
 

Public Member Functions

void exit ()
 
std::thread::id get_id () const noexcept
 
bool isRunning () const noexcept
 
bool isStopping () const noexcept
 
void join ()
 
void start ()
 
virtual void stop ()
 
 ThreadLoop (const std::function< bool()> &setup, const std::function< void()> &process, const std::function< void()> &cleanup)
 
void waitForCompletion ()
 
virtual ~ThreadLoop ()
 

Detailed Description

Definition at line 35 of file threadloop.h.

Member Enumeration Documentation

◆ ThreadState

Enumerator
READY 
RUNNING 
STOPPING 

Definition at line 38 of file threadloop.h.

Constructor & Destructor Documentation

◆ ThreadLoop()

jami::ThreadLoop::ThreadLoop ( const std::function< bool()> &  setup,
const std::function< void()> &  process,
const std::function< void()> &  cleanup 
)

Definition at line 48 of file threadloop.cpp.

◆ ~ThreadLoop()

jami::ThreadLoop::~ThreadLoop ( )
virtual

Definition at line 57 of file threadloop.cpp.

References isRunning(), JAMI_ERR, and join().

Here is the call graph for this function:

Member Function Documentation

◆ exit()

void jami::ThreadLoop::exit ( )

Definition at line 109 of file threadloop.cpp.

References stop().

Here is the call graph for this function:

◆ get_id()

std::thread::id jami::ThreadLoop::get_id ( ) const
inlinenoexcept

◆ isRunning()

bool jami::ThreadLoop::isRunning ( ) const
noexcept

◆ isStopping()

◆ join()

◆ start()

◆ stop()

void jami::ThreadLoop::stop ( )
virtual

◆ waitForCompletion()

void jami::ThreadLoop::waitForCompletion ( )

Definition at line 102 of file threadloop.cpp.


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