The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_plugin.hh File Reference

Header file for MHA C++ plugin class templates. More...

Classes

class  MHAPlugin::cfg_node_t< runtime_cfg_t >
 A node class for storing MHA plugin runtime configurations as a singly linked list, where the nodes store besides the usual "next" and "data" pointers also a flag that indicates whether this node can be deleted. More...
 
class  MHAPlugin::config_t< runtime_cfg_t >
 Template class for thread safe configuration. More...
 
class  MHAPlugin::plugin_t< runtime_cfg_t >
 The template class for C++ openMHA plugins. More...
 

Namespaces

 MHAPlugin
 Namespace for openMHA plugin class templates and thread-safe runtime configurations.
 

Macros

#define __declspec(p)
 
#define WINAPI
 
#define HINSTANCE   int
 
#define MHAPLUGIN_PROC_CALLBACK_PREFIX(prefix, classname, indom, outdom)
 
#define MHAPLUGIN_SETCPP_CALLBACK_PREFIX(prefix, classname)
 
#define MHAPLUGIN_INIT_CALLBACKS_PREFIX(prefix, classname)
 
#define MHAPLUGIN_CALLBACKS_PREFIX(prefix, classname, indom, outdom)
 C++ wrapper macro for the plugin interface. More...
 
#define MHAPLUGIN_DOCUMENTATION_PREFIX(prefix, cat, doc)
 
#define MHAPLUGIN_PROC_CALLBACK(plugname, classname, indom, outdom)    MHAPLUGIN_PROC_CALLBACK_PREFIX(MHA_STATIC_ ## plugname ## _,classname,indom,outdom)
 
#define MHAPLUGIN_INIT_CALLBACKS(plugname, classname)    MHAPLUGIN_INIT_CALLBACKS_PREFIX(MHA_STATIC_ ## plugname ## _,classname)
 
#define MHAPLUGIN_CALLBACKS(plugname, classname, indom, outdom)    MHAPLUGIN_CALLBACKS_PREFIX(MHA_STATIC_ ## plugname ## _,classname,indom,outdom)
 C++ wrapper macro for the plugin interface. More...
 
#define MHAPLUGIN_DOCUMENTATION(plugname, cat, doc)    MHAPLUGIN_DOCUMENTATION_PREFIX(MHA_STATIC_ ## plugname ## _,cat,doc)
 Wrapper macro for the plugin documentation interface. More...
 

Detailed Description

Header file for MHA C++ plugin class templates.

This file defines useful macros and template classes for the development of MHA plugins. A set of macros wraps a C++ interface around the ANSI-C plugin interface. The plugin_t template class defines a corresponding C++ class with all required members. This class can make use of thread safe configurations (config_t).

Macro Definition Documentation

◆ __declspec

#define __declspec (   p)

◆ WINAPI

#define WINAPI

◆ HINSTANCE

#define HINSTANCE   int

◆ MHAPLUGIN_PROC_CALLBACK_PREFIX

#define MHAPLUGIN_PROC_CALLBACK_PREFIX (   prefix,
  classname,
  indom,
  outdom 
)

◆ MHAPLUGIN_SETCPP_CALLBACK_PREFIX

#define MHAPLUGIN_SETCPP_CALLBACK_PREFIX (   prefix,
  classname 
)

◆ MHAPLUGIN_INIT_CALLBACKS_PREFIX

#define MHAPLUGIN_INIT_CALLBACKS_PREFIX (   prefix,
  classname 
)

◆ MHAPLUGIN_CALLBACKS_PREFIX

#define MHAPLUGIN_CALLBACKS_PREFIX (   prefix,
  classname,
  indom,
  outdom 
)

C++ wrapper macro for the plugin interface.

Parameters
classnameThe name of the plugin class
indomInput domain (wave or spec)
outdomOutput domain (wave or spec)

This macro defines all required openMHA Plugin interface functions and passes calls of these functions to the corresponding member functions of the class ‘classname’. The parameters ‘indom’ and ‘outdom’ specify the input and output domain of the processing method. The MHAInit() and MHADestroy() functions will create or destroy an instance of the class. The approriate member functions have to be defined in the class. It is suggested to make usage of the MHAPlugin::plugin_t template class. Exceptions of type MHA_Error are caught and transformed into apropriate error codes with their corresponding error messages.

◆ MHAPLUGIN_DOCUMENTATION_PREFIX

#define MHAPLUGIN_DOCUMENTATION_PREFIX (   prefix,
  cat,
  doc 
)

◆ MHAPLUGIN_PROC_CALLBACK

#define MHAPLUGIN_PROC_CALLBACK (   plugname,
  classname,
  indom,
  outdom 
)     MHAPLUGIN_PROC_CALLBACK_PREFIX(MHA_STATIC_ ## plugname ## _,classname,indom,outdom)

◆ MHAPLUGIN_INIT_CALLBACKS

#define MHAPLUGIN_INIT_CALLBACKS (   plugname,
  classname 
)     MHAPLUGIN_INIT_CALLBACKS_PREFIX(MHA_STATIC_ ## plugname ## _,classname)

◆ MHAPLUGIN_CALLBACKS

#define MHAPLUGIN_CALLBACKS (   plugname,
  classname,
  indom,
  outdom 
)     MHAPLUGIN_CALLBACKS_PREFIX(MHA_STATIC_ ## plugname ## _,classname,indom,outdom)

C++ wrapper macro for the plugin interface.

Parameters
plugnameThe file name of the plugin without the .so or .dll extension
classnameThe name of the plugin class
indomInput domain (wave or spec)
outdomOutput domain (wave or spec)

This macro defines all required openMHA Plugin interface functions and passes calls of these functions to the corresponding member functions of the class ‘classname’. The parameters ‘indom’ and ‘outdom’ specify the input and output domain of the processing method. The MHAInit() and MHADestroy() functions will create or destroy an instance of the class. The approriate member functions have to be defined in the class. It is suggested to make usage of the MHAPlugin::plugin_t template class. Exceptions of type MHA_Error are caught and transformed into apropriate error codes with their corresponding error messages.

◆ MHAPLUGIN_DOCUMENTATION

#define MHAPLUGIN_DOCUMENTATION (   plugname,
  cat,
  doc 
)     MHAPLUGIN_DOCUMENTATION_PREFIX(MHA_STATIC_ ## plugname ## _,cat,doc)

Wrapper macro for the plugin documentation interface.

Parameters
pluginThe file name of the plugin without the .so or .dll extension
catSpace separated list of categories to which belong the plugin (as const char*)
docDocumentation of the plugin (as const char*)

This macro defines the openMHA Plugin interface function for the documentation. The categories can be any space seperated list of category names. An empty string will categorize the plugin in the category 'other'.

The documentation should contain a description of the plugin including a description of the underlying models, and a paragraph containing hints for usage. The text should be LaTeX compatible (e.g., avoid or quote underscores in the text part); equations should be formatted as LaTeX.