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

Abstract base class for synchronizing multithreaded (producer/consumer) fifo operations. More...

Inheritance diagram for mha_fifo_thread_platform_t:
Inheritance graph

Public Member Functions

virtual void aquire_mutex ()=0
 Calling thread waits until it aquires the lock. More...
 
virtual void release_mutex ()=0
 Calling thread releases the lock. More...
 
virtual void wait_for_decrease ()=0
 Calling producer thread must own the lock. More...
 
virtual void wait_for_increase ()=0
 Calling consumer thread must own the lock. More...
 
virtual void increment ()=0
 To be called by producer thread after producing. More...
 
virtual void decrement ()=0
 To be called by consumer thread after consuming. More...
 
virtual ~mha_fifo_thread_platform_t ()
 Make destructor virtual. More...
 
 mha_fifo_thread_platform_t ()
 Make default constructor accessible. More...
 

Private Member Functions

 mha_fifo_thread_platform_t (const mha_fifo_thread_platform_t &)
 
mha_fifo_thread_platform_toperator= (const mha_fifo_thread_platform_t &)
 

Detailed Description

Abstract base class for synchronizing multithreaded (producer/consumer) fifo operations.

Works only with single producer and single consumer.

Constructor & Destructor Documentation

◆ ~mha_fifo_thread_platform_t()

virtual mha_fifo_thread_platform_t::~mha_fifo_thread_platform_t ( )
inlinevirtual

Make destructor virtual.

◆ mha_fifo_thread_platform_t() [1/2]

mha_fifo_thread_platform_t::mha_fifo_thread_platform_t ( const mha_fifo_thread_platform_t )
private

◆ mha_fifo_thread_platform_t() [2/2]

mha_fifo_thread_platform_t::mha_fifo_thread_platform_t ( )
inline

Make default constructor accessible.

Member Function Documentation

◆ aquire_mutex()

virtual void mha_fifo_thread_platform_t::aquire_mutex ( )
pure virtual

Calling thread waits until it aquires the lock.

Must not be called when the lock is already aquired.

Implemented in mha_fifo_posix_threads_t.

◆ release_mutex()

virtual void mha_fifo_thread_platform_t::release_mutex ( )
pure virtual

Calling thread releases the lock.

May only be called when lock is owned.

Implemented in mha_fifo_posix_threads_t.

◆ wait_for_decrease()

virtual void mha_fifo_thread_platform_t::wait_for_decrease ( )
pure virtual

Calling producer thread must own the lock.

Method releases lock, and waits for consumer thread to call decrease(). Then reaquires lock and returns

Implemented in mha_fifo_posix_threads_t.

◆ wait_for_increase()

virtual void mha_fifo_thread_platform_t::wait_for_increase ( )
pure virtual

Calling consumer thread must own the lock.

Method releases lock, and waits for producer thread to call increase(). Then reaquires lock and returns

Implemented in mha_fifo_posix_threads_t.

◆ increment()

virtual void mha_fifo_thread_platform_t::increment ( )
pure virtual

To be called by producer thread after producing.

Producer thread needs to own the lock to call this method.

Implemented in mha_fifo_posix_threads_t.

◆ decrement()

virtual void mha_fifo_thread_platform_t::decrement ( )
pure virtual

To be called by consumer thread after consuming.

Consumer thread needs to own the lock to call this method.

Implemented in mha_fifo_posix_threads_t.

◆ operator=()

mha_fifo_thread_platform_t& mha_fifo_thread_platform_t::operator= ( const mha_fifo_thread_platform_t )
private

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