The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Basic interface for encapsulating thread creation, thread priority setting, and synchronization on any threading platform (i.e., pthreads or win32threads). More...
Public Member Functions | |
thread_platform_t (uni_processor_t *proc) | |
Constructor. More... | |
virtual | ~thread_platform_t () |
Make derived classes destructable via pointer to this base class. More... | |
virtual void | kick_thread ()=0 |
Derived classes notify their processing thread that it should call processor->process(). More... | |
virtual void | catch_thread ()=0 |
Derived classes wait for their signal processing thread to return from the call to part->process(). More... | |
Protected Attributes | |
uni_processor_t * | processor |
A pointer to the plugin loader that processes the sound data in the channels for which this thread was created. More... | |
Private Member Functions | |
thread_platform_t (const thread_platform_t &) | |
Disallow copy constructor. More... | |
thread_platform_t & | operator= (const thread_platform_t &) |
Disallow assignment operator. More... | |
Basic interface for encapsulating thread creation, thread priority setting, and synchronization on any threading platform (i.e., pthreads or win32threads).
Derived classes specialize in the actual thread platform.
|
private |
Disallow copy constructor.
|
inline |
Constructor.
Derived classes create the thread in the constructor.
proc | Pointer to the associated plugin loader. This plugin loader has to live at least as long as this instance. This instance does not take possession of the plugin loader. In production code, this thread platform and the plugin loader are both created and destroyed by the MHAPlugin_Split::splitted_part_t instance. |
|
inlinevirtual |
Make derived classes destructable via pointer to this base class.
Derived classes' destructors notify the thread that it should terminate itself, and wait for the termination to occur.
|
private |
Disallow assignment operator.
|
pure virtual |
Derived classes notify their processing thread that it should call processor->process().
Implemented in MHAPlugin_Split::posix_threads_t, and MHAPlugin_Split::dummy_threads_t.
|
pure virtual |
Derived classes wait for their signal processing thread to return from the call to part->process().
Implemented in MHAPlugin_Split::posix_threads_t, and MHAPlugin_Split::dummy_threads_t.
|
protected |
A pointer to the plugin loader that processes the sound data in the channels for which this thread was created.
Using the MHAPlugin_Split::uni_processor_t interface instead of the mhapluginloader class directly for testability (no need to load real plugins for testing the thread platform).