The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHAPlugin_Split::thread_platform_t Class Referenceabstract

Basic interface for encapsulating thread creation, thread priority setting, and synchronization on any threading platform (i.e., pthreads or win32threads). More...

Inheritance diagram for MHAPlugin_Split::thread_platform_t:
Inheritance graph

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_tprocessor
 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_toperator= (const thread_platform_t &)
 Disallow assignment operator. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ thread_platform_t() [1/2]

MHAPlugin_Split::thread_platform_t::thread_platform_t ( const thread_platform_t )
private

Disallow copy constructor.

◆ thread_platform_t() [2/2]

MHAPlugin_Split::thread_platform_t::thread_platform_t ( uni_processor_t proc)
inline

Constructor.

Derived classes create the thread in the constructor.

Parameters
procPointer 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.

◆ ~thread_platform_t()

virtual MHAPlugin_Split::thread_platform_t::~thread_platform_t ( )
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.

Member Function Documentation

◆ operator=()

thread_platform_t& MHAPlugin_Split::thread_platform_t::operator= ( const thread_platform_t )
private

Disallow assignment operator.

◆ kick_thread()

virtual void MHAPlugin_Split::thread_platform_t::kick_thread ( )
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.

◆ catch_thread()

virtual void MHAPlugin_Split::thread_platform_t::catch_thread ( )
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.

Member Data Documentation

◆ processor

uni_processor_t* MHAPlugin_Split::thread_platform_t::processor
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).


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