The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
The parser interface of the IOAsterisk library. More...
Public Member Functions | |
virtual const std::string & | get_local_address () const |
Read parser variable local_address, this is the address of the network interface that should listen for incoming connections. More... | |
virtual unsigned short | get_local_port () const |
Read parser variable local_port, this is the TCP port that should be used for incoming connections. More... | |
virtual void | set_local_port (unsigned short port) |
Set parser variable local_port. More... | |
virtual bool | get_server_port_open () const |
Return the status of the server port as it is known to the parser. More... | |
virtual void | set_server_port_open (bool open) |
Inform the parser of the current status of the server socket. More... | |
virtual bool | get_connected () const |
Return the parser's knowledge concerning wether there currently exists an established sound data TCP connection or not. More... | |
virtual void | set_connected (bool connected) |
Inform the parser about the existance of a sound data connection. More... | |
virtual void | set_new_peer (unsigned short port, const std::string &host) |
Set parser monitor variables peer_port and peer_address, and calls set_connected(true). More... | |
io_asterisk_parser_t () | |
Constructor initializes parser variables. More... | |
virtual | ~io_asterisk_parser_t () |
Do-nothing destructor. More... | |
virtual void | debug (const std::string &message) |
Public Member Functions inherited from MHAParser::parser_t | |
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_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 | 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... | |
Private Attributes | |
MHAParser::string_t | local_address |
Lets the user set the local network interface to listen on. More... | |
MHAParser::int_t | local_port |
Lets the user choose the local tcp port to listen on. More... | |
MHAParser::int_mon_t | server_port_open |
Indicates wether the TCP server socket is currently open. More... | |
MHAParser::int_mon_t | connected |
Indicator if there currently is a sound data connection over TCP. More... | |
MHAParser::string_mon_t | peer_address |
Display the ip address of the currently connected sound data client. More... | |
MHAParser::int_mon_t | peer_port |
Display the tcp port used by the current sound data client. More... | |
MHAParser::string_t | debug_filename |
filename to write debugging info to (if non-empty) More... | |
FILE * | debug_file |
file handle to write debugging info to More... | |
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 Member Functions inherited from MHAParser::parser_t | |
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 () |
Protected Attributes inherited from MHAParser::base_t | |
query_map_t | queries |
bool | data_is_initialized |
The parser interface of the IOAsterisk library.
io_asterisk_parser_t::io_asterisk_parser_t | ( | ) |
Constructor initializes parser variables.
|
inlinevirtual |
Do-nothing destructor.
|
inlinevirtual |
Read parser variable local_address, this is the address of the network interface that should listen for incoming connections.
|
virtual |
Read parser variable local_port, this is the TCP port that should be used for incoming connections.
|
virtual |
Set parser variable local_port.
This is needed when it was set to 0 before: In this case, the OS chooses a free port for the TCP server socket, and the port that it chose has to be published to the user over the parser interface.
port | The TCP port number that is currently used. In the range [MIN_TCP_PORT, MAX_TCP_PORT], excluding 0. |
|
virtual |
Return the status of the server port as it is known to the parser.
|
virtual |
Inform the parser of the current status of the server socket.
open | Indicates wether the server socket has just been opened or closed. |
|
virtual |
Return the parser's knowledge concerning wether there currently exists an established sound data TCP connection or not.
|
virtual |
Inform the parser about the existance of a sound data connection.
connected | Indicates wether there currently is a connection or not. |
|
virtual |
Set parser monitor variables peer_port and peer_address, and calls set_connected(true).
This method should be called when a new connection is established.
port | The TCP port number used by the peer. |
host | The Internet host where the peer is located. |
|
inlinevirtual |
|
private |
Lets the user set the local network interface to listen on.
|
private |
Lets the user choose the local tcp port to listen on.
|
private |
Indicates wether the TCP server socket is currently open.
|
private |
Indicator if there currently is a sound data connection over TCP.
|
private |
Display the ip address of the currently connected sound data client.
|
private |
Display the tcp port used by the current sound data client.
|
private |
filename to write debugging info to (if non-empty)
|
private |
file handle to write debugging info to