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

Keyword list class. More...

Public Types

typedef std::vector< std::string >::size_type size_t
 

Public Member Functions

void set_value (const std::string &)
 Select a value from keyword list. More...
 
void set_entries (const std::string &)
 Set keyword list entries. More...
 
const std::string & get_value () const
 Return selected value. More...
 
const std::vector< std::string > & get_entries () const
 Return keyword list. More...
 
const size_tget_index () const
 Return index of selected value. More...
 
void set_index (unsigned int)
 
void validate () const
 Check if index of selected value is valid. More...
 
void add_entry (const std::string &en)
 
 keyword_list_t ()
 Constructor. More...
 

Private Attributes

size_t index
 Index into list. More...
 
std::vector< std::string > entries
 List of valid entries. More...
 
std::string empty_string
 

Detailed Description

Keyword list class.

The stucture keyword_list_t defines a keyword list (vector of strings) with an index into the list. Used as MHAParser::kw_t, it can be used to access a set of valid keywords through the parser (i.e. one of "pear apple banana").

Member Typedef Documentation

◆ size_t

typedef std::vector<std::string>::size_type MHAParser::keyword_list_t::size_t

Constructor & Destructor Documentation

◆ keyword_list_t()

MHAParser::keyword_list_t::keyword_list_t ( )

Constructor.

Member Function Documentation

◆ set_value()

void MHAParser::keyword_list_t::set_value ( const std::string &  s)

Select a value from keyword list.

This function selects a value from the keyword list. The index is set to the last matching entry.

Parameters
sValue to be selected.

◆ set_entries()

void MHAParser::keyword_list_t::set_entries ( const std::string &  s)

Set keyword list entries.

With this function, the keyword list can be set from a space separated string list.

Parameters
sSpace separated entry list.

◆ get_value()

const std::string & MHAParser::keyword_list_t::get_value ( ) const

Return selected value.

◆ get_entries()

const std::vector< std::string > & MHAParser::keyword_list_t::get_entries ( ) const

Return keyword list.

◆ get_index()

const MHAParser::keyword_list_t::size_t & MHAParser::keyword_list_t::get_index ( ) const

Return index of selected value.

◆ set_index()

void MHAParser::keyword_list_t::set_index ( unsigned int  idx)

◆ validate()

void MHAParser::keyword_list_t::validate ( ) const

Check if index of selected value is valid.

◆ add_entry()

void MHAParser::keyword_list_t::add_entry ( const std::string &  en)
inline

Member Data Documentation

◆ index

size_t MHAParser::keyword_list_t::index
private

Index into list.

◆ entries

std::vector<std::string> MHAParser::keyword_list_t::entries
private

List of valid entries.

◆ empty_string

std::string MHAParser::keyword_list_t::empty_string
private

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