TermOx
Public Member Functions | List of all members
ox::Listener_thread< Function_t > Class Template Reference

Thread that waits to be notified, then performs some action. More...

#include <listener_thread.hpp>

Public Member Functions

 Listener_thread (Function_t &&action)
 Launch the listener thread. More...
 
 ~Listener_thread ()
 Shutdown the listener thread.
 
void launch ()
 Start the thread that will wait for notification.
 
void notify ()
 Wakes up the thread and has it run the action once.
 
void exit ()
 Notify the thread to exit.
 
void wait ()
 Blocks until the thread is dead.
 

Detailed Description

template<typename Function_t>
class ox::Listener_thread< Function_t >

Thread that waits to be notified, then performs some action.

Parameterized on the action that will be taken, with Function_t. This is basically a wrapped condition variable that helps you launch and exit a new thread.

Constructor & Destructor Documentation

◆ Listener_thread()

template<typename Function_t >
ox::Listener_thread< Function_t >::Listener_thread ( Function_t &&  action)
inline

Launch the listener thread.

Function_t can be any (zero argument)invokable with a move or copy constructor.


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