The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Base class for all parser items. More...
Classes | |
class | replace_t |
Public Member Functions | |
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_t & | operator= (const base_t &)=default |
base_t (base_t &&)=delete | |
base_t & | operator= (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 | op_subparse (expression_t &) |
virtual std::string | op_setval (expression_t &) |
virtual std::string | op_query (expression_t &) |
virtual std::string | query_dump (const std::string &) |
virtual std::string | query_entries (const std::string &) |
virtual std::string | query_perm (const std::string &) |
virtual std::string | query_range (const std::string &) |
virtual std::string | query_type (const std::string &) |
virtual std::string | query_val (const std::string &) |
virtual std::string | query_readfile (const std::string &) |
virtual std::string | query_savefile (const std::string &) |
virtual std::string | query_savefile_compact (const std::string &) |
virtual std::string | query_savemons (const std::string &) |
virtual std::string | query_listids (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... | |
Public Attributes | |
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 Member Functions | |
void | activate_query (const std::string &, query_t) |
void | notify () |
Protected Attributes | |
query_map_t | queries |
bool | data_is_initialized |
Private Types | |
typedef std::vector< replace_t > | repl_list_t |
Private Member Functions | |
void | add_replace_pair (const std::string &, const std::string &) |
std::string | oplist () |
Private Attributes | |
std::string | help |
std::string | id_str |
opact_map_t | operators |
repl_list_t | repl_list |
bool | nested_lock |
parser_t * | parent |
std::string | thefullname |
Base class for all parser items.
The key method of the parser base class is the std::string parse(const std::string&) method. Parser proxy derivatives which overwrite any of the other parse() methods to be the key method must make sure that the original parse() method utilizes the new key method.
|
private |
MHAParser::base_t::base_t | ( | const std::string & | h | ) |
Constructor for base class of all parser nodes.
h | Help text describing this parser node. This help text is accessible to the configuration language through the "?help" query command. |
MHAParser::base_t::base_t | ( | const base_t & | src | ) |
Copy constructor for base_t.
Copies help text and id string, but does not insert the new node into the parser tree structure.
src | Source parser |
|
delete |
|
virtual |
|
virtual |
Causes this node to process a command in the openMHA configuration language.
cs | The command to parse |
MHA_Error | If the command cannot be executed successfully. The reason for failure is given in the message string of the exception. |
Reimplemented in plug_wrapperI, PluginLoader::mhapluginloader_t, plug_wrapper, io_wrapper, and altplugs_t.
|
virtual |
This function parses a command and writes the parsing result into a C character array.
This base class implementation delegates to parse(const std::string &).
cmd | Command to be parsed |
retv | Buffer for the result |
len | Length of buffer |
Reimplemented in altplugs_t.
|
virtual |
|
virtual |
Reimplemented in MHAParser::c_ifc_parser_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::c_ifc_parser_t, MHAParser::mcomplex_t, MHAParser::mfloat_t, MHAParser::mint_t, MHAParser::vcomplex_t, MHAParser::vfloat_t, MHAParser::vint_t, MHAParser::complex_t, MHAParser::float_t, MHAParser::int_t, MHAParser::bool_t, MHAParser::vstring_t, MHAParser::string_t, MHAParser::kw_t, MHAParser::variable_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::c_ifc_parser_t, MHAParser::monitor_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::monitor_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::variable_t, and MHAParser::monitor_t.
|
virtual |
Reimplemented in MHAParser::kw_t, and MHAParser::range_var_t.
|
virtual |
Reimplemented in MHAParser::mcomplex_mon_t, MHAParser::vcomplex_mon_t, MHAParser::complex_mon_t, MHAParser::float_mon_t, MHAParser::mfloat_mon_t, MHAParser::vfloat_mon_t, MHAParser::mint_mon_t, MHAParser::vint_mon_t, MHAParser::vstring_mon_t, MHAParser::string_mon_t, MHAParser::bool_mon_t, MHAParser::int_mon_t, MHAParser::mcomplex_t, MHAParser::mfloat_t, MHAParser::mint_t, MHAParser::vcomplex_t, MHAParser::vfloat_t, MHAParser::vint_t, MHAParser::complex_t, MHAParser::float_t, MHAParser::int_t, MHAParser::bool_t, MHAParser::vstring_t, MHAParser::string_t, MHAParser::kw_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::mcomplex_mon_t, MHAParser::vcomplex_mon_t, MHAParser::complex_mon_t, MHAParser::float_mon_t, MHAParser::mfloat_mon_t, MHAParser::vfloat_mon_t, MHAParser::mint_mon_t, MHAParser::vint_mon_t, MHAParser::vstring_mon_t, MHAParser::string_mon_t, MHAParser::bool_mon_t, MHAParser::int_mon_t, MHAParser::mcomplex_t, MHAParser::mfloat_t, MHAParser::mint_t, MHAParser::vcomplex_t, MHAParser::vfloat_t, MHAParser::vint_t, MHAParser::complex_t, MHAParser::float_t, MHAParser::int_t, MHAParser::bool_t, MHAParser::vstring_t, MHAParser::string_t, MHAParser::kw_t, and MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
|
virtual |
Reimplemented in MHAParser::parser_t.
std::string MHAParser::base_t::query_version | ( | const std::string & | ) |
std::string MHAParser::base_t::query_id | ( | const std::string & | ) |
std::string MHAParser::base_t::query_subst | ( | const std::string & | ) |
std::string MHAParser::base_t::query_addsubst | ( | const std::string & | s | ) |
std::string MHAParser::base_t::query_help | ( | const std::string & | ) |
std::string MHAParser::base_t::query_cmds | ( | const std::string & | ) |
void MHAParser::base_t::set_node_id | ( | const std::string & | s | ) |
Set the identification string of this parser node.
The id can be queried from the configuration language using the ?id query command. Nodes can be found by id using the ?listid query command on a containing parser node.
s | The new identification string. |
void MHAParser::base_t::set_help | ( | const std::string & | s | ) |
Set the help comment of a variable or parser.
s | New help comment. |
void MHAParser::base_t::add_parent_on_insert | ( | parser_t * | p, |
std::string | n | ||
) |
void MHAParser::base_t::rm_parent_on_remove | ( | parser_t * | ) |
const std::string & MHAParser::base_t::fullname | ( | ) | const |
Return the full dot-separated path name of this parser node in the openMHA configuration tree.
|
protected |
|
protected |
|
private |
|
private |
MHAEvents::emitter_t MHAParser::base_t::writeaccess |
Event emitted on write access.
To connect a callback that is invoked on write access to this parser variable, use MHAEvents::patchbay_t<receiver_t> method connect(&writeaccess,&receiver_t::callback) where callback is a method that expects no parameters and returns void.
MHAEvents::emitter_t MHAParser::base_t::valuechanged |
Event emitted if the value has changed.
To connect a callback that is invoked when write access to this parser variable actually changes its value, use MHAEvents::patchbay_t<receiver_t> method connect(&valuechanged,&receiver_t::callback) where callback is a method that expects no parameters and returns void.
MHAEvents::emitter_t MHAParser::base_t::readaccess |
Event emitted on read access.
To connect a callback that is invoked after the value of this variable has been read through the configuration interface, use MHAEvents::patchbay_t<receiver_t> method connect(&readaccess,&receiver_t::callback) where callback is a method that expects no parameters and returns void.
MHAEvents::emitter_t MHAParser::base_t::prereadaccess |
Event emitted on read access, before the data field is accessed.
To connect a callback that is invoked when the value of this variable is about to be read through the configuration interface, so that the callback can influence the value that is reported, use MHAEvents::patchbay_t<receiver_t> method connect(&prereadaccess,&receiver_t::callback) where callback is a method that expects no parameters and returns void.
|
protected |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |