Audio Processing Framework (APF) version 0.5.0
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
apf::MimoProcessor< Derived, interface_policy, query_policy > Class Template Reference

Multi-threaded multiple-input-multiple-output (MIMO) processor. More...

#include <apf/mimoprocessor.h>

Inheritance diagram for apf::MimoProcessor< Derived, interface_policy, query_policy >:
Inheritance graph
[legend]

Classes

struct  Item
 Abstract base class for list items. More...
 
struct  ProcessItem
 Base class for items which have a Process class. More...
 
struct  rtlist_proxy
 Proxy class for accessing an RtList. More...
 
class  ScopedLock
 Lock is released when it goes out of scope. More...
 

Public Types

using rtlist_t = RtList< Item * >
 

Public Member Functions

bool activate ()
 
template<typename F >
bool activate (F &query_function, int usleeptime)
 This is only available when enable_queries is used. More...
 
bool deactivate ()
 
void wait_for_rt_thread ()
 
template<typename X >
X * add ()
 
template<typename P >
P::outer * add (const P &p)
 
void rem (Input *in)
 
void rem (Output *out)
 
const rtlist_t & get_input_list () const
 
const rtlist_t & get_output_list () const
 
unsigned threads () const
 
- Public Member Functions inherited from apf::CRTP< Derived >
Derived & derived ()
 

Public Attributes

const parameter_map params
 

Protected Types

using MimoProcessorBase = MimoProcessor< Derived, interface_policy, query_policy >
 
using rtlist_iterator = typename rtlist_t::iterator
 
using rtlist_const_iterator = typename rtlist_t::const_iterator
 

Protected Member Functions

 MimoProcessor (const parameter_map &params=parameter_map())
 
 ~MimoProcessor ()
 Protected non-virtual destructor. More...
 
void _process_list (rtlist_t &l)
 
void _process_list (rtlist_t &l1, rtlist_t &l2)
 
- Protected Member Functions inherited from apf::CRTP< Derived >
 ~CRTP ()=default
 Protected destructor to avoid base class pointers. More...
 

Protected Attributes

CommandQueue _fifo
 

Detailed Description

template<typename Derived, typename interface_policy, typename query_policy = disable_queries>
class apf::MimoProcessor< Derived, interface_policy, query_policy >

Multi-threaded multiple-input-multiple-output (MIMO) processor.

Derive your own class from MimoProcessor and also use it as first template argument. This is called the "Curiously Recurring Template Pattern" (CRTP). The rest of the template arguments are Policies ("Policy-based Design").

Template Parameters
DerivedYour derived class -> CRTP!
interface_policyPolicy class. You can use existing policies (e.g. jack_policy, pointer_policy<T*>) or write your own policy class.

Example: MimoProcessor

Examples
dummy_example.cpp, jack_dynamic_inputs.cpp, jack_dynamic_outputs.cpp, jack_minimal.cpp, and simpleprocessor.h.

Definition at line 198 of file mimoprocessor.h.

Member Typedef Documentation

◆ rtlist_t

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
using apf::MimoProcessor< Derived, interface_policy, query_policy >::rtlist_t = RtList<Item*>

Definition at line 246 of file mimoprocessor.h.

◆ MimoProcessorBase

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
using apf::MimoProcessor< Derived, interface_policy, query_policy >::MimoProcessorBase = MimoProcessor<Derived, interface_policy, query_policy>
protected

Definition at line 341 of file mimoprocessor.h.

◆ rtlist_iterator

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
using apf::MimoProcessor< Derived, interface_policy, query_policy >::rtlist_iterator = typename rtlist_t::iterator
protected

Definition at line 343 of file mimoprocessor.h.

◆ rtlist_const_iterator

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
using apf::MimoProcessor< Derived, interface_policy, query_policy >::rtlist_const_iterator = typename rtlist_t::const_iterator
protected

Definition at line 344 of file mimoprocessor.h.

Constructor & Destructor Documentation

◆ MimoProcessor()

template<typename Derived , typename interface_policy , typename query_policy >
apf::MimoProcessor< Derived, interface_policy, query_policy >::MimoProcessor ( const parameter_map params_ = parameter_map())
explicitprotected
Exceptions
std::logic_errorif CommandQueue cannot be deactivated.

Definition at line 451 of file mimoprocessor.h.

References apf::CommandQueue::deactivate(), apf::fixed_vector< T, Allocator >::emplace_back(), and apf::fixed_vector< T, Allocator >::reserve().

◆ ~MimoProcessor()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
apf::MimoProcessor< Derived, interface_policy, query_policy >::~MimoProcessor ( )
inlineprotected

Protected non-virtual destructor.

Definition at line 351 of file mimoprocessor.h.

Member Function Documentation

◆ activate() [1/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
bool apf::MimoProcessor< Derived, interface_policy, query_policy >::activate ( )
inline

Definition at line 273 of file mimoprocessor.h.

◆ activate() [2/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
template<typename F >
bool apf::MimoProcessor< Derived, interface_policy, query_policy >::activate ( F &  query_function,
int  usleeptime 
)
inline

This is only available when enable_queries is used.

Definition at line 281 of file mimoprocessor.h.

◆ deactivate()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
bool apf::MimoProcessor< Derived, interface_policy, query_policy >::deactivate ( )
inline

Definition at line 288 of file mimoprocessor.h.

◆ wait_for_rt_thread()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
void apf::MimoProcessor< Derived, interface_policy, query_policy >::wait_for_rt_thread ( )
inline

Definition at line 311 of file mimoprocessor.h.

◆ add() [1/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
template<typename X >
X * apf::MimoProcessor< Derived, interface_policy, query_policy >::add ( )
inline

Definition at line 314 of file mimoprocessor.h.

◆ add() [2/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
template<typename P >
P::outer * apf::MimoProcessor< Derived, interface_policy, query_policy >::add ( const P &  p)
inline

Definition at line 321 of file mimoprocessor.h.

◆ rem() [1/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
void apf::MimoProcessor< Derived, interface_policy, query_policy >::rem ( Input *  in)
inline

Definition at line 329 of file mimoprocessor.h.

◆ rem() [2/2]

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
void apf::MimoProcessor< Derived, interface_policy, query_policy >::rem ( Output *  out)
inline

Definition at line 330 of file mimoprocessor.h.

◆ get_input_list()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
const rtlist_t & apf::MimoProcessor< Derived, interface_policy, query_policy >::get_input_list ( ) const
inline

Definition at line 332 of file mimoprocessor.h.

◆ get_output_list()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
const rtlist_t & apf::MimoProcessor< Derived, interface_policy, query_policy >::get_output_list ( ) const
inline

Definition at line 333 of file mimoprocessor.h.

◆ threads()

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
unsigned apf::MimoProcessor< Derived, interface_policy, query_policy >::threads ( ) const
inline

Definition at line 335 of file mimoprocessor.h.

◆ _process_list() [1/2]

template<typename Derived , typename interface_policy , typename query_policy >
void apf::MimoProcessor< Derived, interface_policy, query_policy >::_process_list ( rtlist_t &  l)
protected

Definition at line 476 of file mimoprocessor.h.

◆ _process_list() [2/2]

template<typename Derived , typename interface_policy , typename query_policy >
void apf::MimoProcessor< Derived, interface_policy, query_policy >::_process_list ( rtlist_t &  l1,
rtlist_t &  l2 
)
protected

Definition at line 484 of file mimoprocessor.h.

Member Data Documentation

◆ params

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
const parameter_map apf::MimoProcessor< Derived, interface_policy, query_policy >::params

Definition at line 338 of file mimoprocessor.h.

◆ _fifo

template<typename Derived , typename interface_policy , typename query_policy = disable_queries>
CommandQueue apf::MimoProcessor< Derived, interface_policy, query_policy >::_fifo
protected

Definition at line 361 of file mimoprocessor.h.


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