The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHAParser::parser_t Class Reference

Parser node class. More...

Inherits MHAParser::base_t.

Inherited by alsa_dev_par_parser_t, AuditoryProfile::parser_t, AuditoryProfile::parser_t::ear_t, AuditoryProfile::parser_t::fmap_t, DynComp::dc_afterburn_vars_t, fw_t, io_alsa_t, io_asterisk_parser_t, io_dummy_t, io_file_t, io_parser_t, io_tcp_parser_t, MHAFilter::adapt_filter_t, MHAFilter::iir_filter_t, MHAIOJack::io_jack_t, MHAIOJackdb::io_jack_t, MHAIOPortAudio::device_info_t, MHAIOPortAudio::io_portaudio_t, MHAIOPortAudio::stream_info_t, MHAParser::mhaconfig_mon_t, MHAParser::window_t, MHAPlugin::plugin_t< runtime_cfg_t >, MHAPlugin_Split::split_t, MHAPlugin::plugin_t< ac2wave_t >, MHAPlugin::plugin_t< ac2xdf_rt_t >, MHAPlugin::plugin_t< acConcat_wave_config >, MHAPlugin::plugin_t< acPooling_wave_config >, MHAPlugin::plugin_t< acSteer_config >, MHAPlugin::plugin_t< acTransform_wave_config >, MHAPlugin::plugin_t< acwriter_t >, MHAPlugin::plugin_t< adaptive_feedback_canceller_config >, MHAPlugin::plugin_t< adm_rtconfig_t >, MHAPlugin::plugin_t< analysepath_t >, MHAPlugin::plugin_t< cfg_t >, MHAPlugin::plugin_t< char >, MHAPlugin::plugin_t< cohflt_t >, MHAPlugin::plugin_t< combc_t >, MHAPlugin::plugin_t< cpuload_cfg_t >, MHAPlugin::plugin_t< db_t >, MHAPlugin::plugin_t< dbasync_t >, MHAPlugin::plugin_t< dc_t >, MHAPlugin::plugin_t< delaysum_t >, MHAPlugin::plugin_t< delaysum_wave_t >, MHAPlugin::plugin_t< doasvm_classification_config >, MHAPlugin::plugin_t< doasvm_feature_extraction_config >, MHAPlugin::plugin_t< example5_t >, MHAPlugin::plugin_t< fftfb_plug_t >, MHAPlugin::plugin_t< fftfbpow_t >, MHAPlugin::plugin_t< fftfilter_t >, MHAPlugin::plugin_t< fshift_config_t >, MHAPlugin::plugin_t< gsc_adaptive_stage >, MHAPlugin::plugin_t< gtfb_analyzer_cfg_t >, MHAPlugin::plugin_t< gtfb_simd_cfg_t >, MHAPlugin::plugin_t< gtfb_simple_rt_t >, MHAPlugin::plugin_t< hilbert_shifter_t >, MHAPlugin::plugin_t< int >, MHAPlugin::plugin_t< level_matching_config_t >, MHAPlugin::plugin_t< lpc_bl_predictor_config >, MHAPlugin::plugin_t< lpc_burglattice_config >, MHAPlugin::plugin_t< lpc_config >, MHAPlugin::plugin_t< matlab_wrapper_rt_cfg_t >, MHAPlugin::plugin_t< MHA_AC::spectrum_t >, MHAPlugin::plugin_t< MHA_AC::waveform_t >, MHAPlugin::plugin_t< mhachain::plugs_t >, MHAPlugin::plugin_t< MHAFilter::partitioned_convolution_t >, MHAPlugin::plugin_t< MHASignal::async_rmslevel_t >, MHAPlugin::plugin_t< MHASignal::delay_t >, MHAPlugin::plugin_t< MHASignal::waveform_t >, MHAPlugin::plugin_t< MHAWindow::fun_t >, MHAPlugin::plugin_t< noise_psd_estimator_t >, MHAPlugin::plugin_t< overlapadd_t >, MHAPlugin::plugin_t< plingploing_t >, MHAPlugin::plugin_t< prediction_error_config >, MHAPlugin::plugin_t< resampling_t >, MHAPlugin::plugin_t< rohConfig >, MHAPlugin::plugin_t< route::process_t >, MHAPlugin::plugin_t< rt_nlms_t >, MHAPlugin::plugin_t< scaler_t >, MHAPlugin::plugin_t< sine_cfg_t >, MHAPlugin::plugin_t< smooth_cepstrum_t >, MHAPlugin::plugin_t< smoothspec_wrap_t >, MHAPlugin::plugin_t< spec2wave_t >, MHAPlugin::plugin_t< spec_fader_t >, MHAPlugin::plugin_t< steerbf_config >, MHAPlugin::plugin_t< trigger2lsl_rt_t >, MHAPlugin::plugin_t< UNIT >, MHAPlugin::plugin_t< wave2spec_t >, MHAPlugin::plugin_t< wavwriter_t >, softclipper_variables_t, testplugin::ac_parser_t, testplugin::config_parser_t, and testplugin::signal_parser_t.

Public Member Functions

 parser_t (const std::string &help_text="")
 Construct detached node to be used in the configuration tree. More...
 
 ~parser_t ()
 
void insert_item (const std::string &, base_t *)
 Register a parser item into this sub-parser. More...
 
void remove_item (const std::string &)
 Remove an item by name. More...
 
void force_remove_item (const std::string &)
 Remove an item by name. More...
 
void remove_item (const base_t *)
 Remove an item by address. More...
 
- Public Member Functions inherited from MHAParser::base_t
 base_t (const std::string &)
 Constructor for base class of all parser nodes. More...
 
 base_t (const base_t &)
 Copy constructor for base_t. More...
 
base_toperator= (const base_t &)=default
 
 base_t (base_t &&)=delete
 
base_toperator= (base_t &&)=delete
 
virtual ~base_t ()
 
virtual std::string parse (const std::string &)
 Causes this node to process a command in the openMHA configuration language. More...
 
virtual void parse (const char *, char *, unsigned int)
 This function parses a command and writes the parsing result into a C character array. More...
 
virtual void parse (const std::vector< std::string > &, std::vector< std::string > &)
 
virtual std::string query_perm (const std::string &)
 
virtual std::string query_range (const std::string &)
 
std::string query_version (const std::string &)
 
std::string query_id (const std::string &)
 
std::string query_subst (const std::string &)
 
std::string query_addsubst (const std::string &)
 
std::string query_help (const std::string &)
 
std::string query_cmds (const std::string &)
 
void set_node_id (const std::string &)
 Set the identification string of this parser node. More...
 
void set_help (const std::string &)
 Set the help comment of a variable or parser. More...
 
void add_parent_on_insert (parser_t *, std::string)
 
void rm_parent_on_remove (parser_t *)
 
const std::string & fullname () const
 Return the full dot-separated path name of this parser node in the openMHA configuration tree. More...
 

Protected Member Functions

std::string op_subparse (expression_t &)
 
std::string op_setval (expression_t &)
 
std::string op_query (expression_t &)
 
std::string query_type (const std::string &)
 
std::string query_dump (const std::string &)
 
std::string query_entries (const std::string &)
 
std::string query_readfile (const std::string &)
 
std::string query_savefile (const std::string &)
 
std::string query_savefile_compact (const std::string &)
 
std::string query_savemons (const std::string &)
 
std::string query_val (const std::string &)
 
std::string query_listids (const std::string &)
 
void set_id_string (const std::string &)
 
bool has_entry (const std::string &)
 
- Protected Member Functions inherited from MHAParser::base_t
void activate_query (const std::string &, query_t)
 
void notify ()
 

Private Attributes

entry_map_t entries
 
std::string id_string
 identification string More...
 
std::string last_errormsg
 

Additional Inherited Members

- Public Attributes inherited from MHAParser::base_t
MHAEvents::emitter_t writeaccess
 Event emitted on write access. More...
 
MHAEvents::emitter_t valuechanged
 Event emitted if the value has changed. More...
 
MHAEvents::emitter_t readaccess
 Event emitted on read access. More...
 
MHAEvents::emitter_t prereadaccess
 Event emitted on read access, before the data field is accessed. More...
 
- Protected Attributes inherited from MHAParser::base_t
query_map_t queries
 
bool data_is_initialized
 

Detailed Description

Parser node class.

A parser_t instance is a node in the configuration tree. A parser node can contain any number of other parser_t instances or configuration language variables. These items are inserted into a parser node using the parser_t::insert_item method.

Constructor & Destructor Documentation

◆ parser_t()

MHAParser::parser_t::parser_t ( const std::string &  help_text = "")

Construct detached node to be used in the configuration tree.

Parameters
help_textA text describing this node. E.g. if this node lives at the root of some openMHA plugin, then the help text should describe the functionality of the plugin.

◆ ~parser_t()

MHAParser::parser_t::~parser_t ( )

Member Function Documentation

◆ insert_item()

void MHAParser::parser_t::insert_item ( const std::string &  n,
MHAParser::base_t e 
)

Register a parser item into this sub-parser.

This function registers an item under a given name into this sub-parser and makes it accessible to the parser interface.

Parameters
nName of the item in the configuration tree
eC++ pointer to the item instance. e can either point to a variable, to a monitor, or to another sub-parser.

◆ remove_item() [1/2]

void MHAParser::parser_t::remove_item ( const std::string &  n)

Remove an item by name.

If the item does not exist, an error is being reported.

Parameters
nName of parser item to be removed from list.

◆ force_remove_item()

void MHAParser::parser_t::force_remove_item ( const std::string &  n)

Remove an item by name.

Non-existing items are ignored.

Parameters
nName of parser item to be removed from list.

◆ remove_item() [2/2]

void MHAParser::parser_t::remove_item ( const base_t addr)

Remove an item by address.

The item belonging to an address is being removed from the list of items.

Parameters
addrAddress of parser item to be removed.

◆ op_subparse()

std::string MHAParser::parser_t::op_subparse ( expression_t x)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ op_setval()

std::string MHAParser::parser_t::op_setval ( expression_t x)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ op_query()

std::string MHAParser::parser_t::op_query ( expression_t x)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_type()

std::string MHAParser::parser_t::query_type ( const std::string &  )
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_dump()

std::string MHAParser::parser_t::query_dump ( const std::string &  )
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_entries()

std::string MHAParser::parser_t::query_entries ( const std::string &  )
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_readfile()

std::string MHAParser::parser_t::query_readfile ( const std::string &  fname)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_savefile()

std::string MHAParser::parser_t::query_savefile ( const std::string &  fname)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_savefile_compact()

std::string MHAParser::parser_t::query_savefile_compact ( const std::string &  fname)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_savemons()

std::string MHAParser::parser_t::query_savemons ( const std::string &  fname)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_val()

std::string MHAParser::parser_t::query_val ( const std::string &  s)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ query_listids()

std::string MHAParser::parser_t::query_listids ( const std::string &  s)
protectedvirtual

Reimplemented from MHAParser::base_t.

◆ set_id_string()

void MHAParser::parser_t::set_id_string ( const std::string &  s)
protected

◆ has_entry()

bool MHAParser::parser_t::has_entry ( const std::string &  s)
protected

Member Data Documentation

◆ entries

entry_map_t MHAParser::parser_t::entries
private

◆ id_string

std::string MHAParser::parser_t::id_string
private

identification string

◆ last_errormsg

std::string MHAParser::parser_t::last_errormsg
private

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