#include <params.h>
Public Member Functions | |
Parameters (const ParamDefs *paramdefs, const count_t paramNum) | |
Parameters (int argc, char **argv, const ParamDefs *paramdefs, const count_t paramNum) | |
~Parameters () | |
bool | loadParams (int argc, char **argv) |
bool | loadParams (const std::string ¶m_file, std::set< std::string > &) |
int | getValueType (const std::string &name) |
bool | setParamValue (const std::string &name, const std::string &value) |
bool | verifyValueType (const std::string &name, const std::string &value) |
bool | isValidParamName (const std::string &name) |
std::string | getParamValue (const std::string &name) |
std::string | getParam (const std::string &name) |
int | getParamCount () const |
Static Public Attributes | |
static const std::string | kNotSetValue = "__NOT_SET__" |
static const int | kBoolValue = 0 |
static const int | kIntValue = 1 |
static const int | kFloatValue = 2 |
static const int | kStringValue = 3 |
static const int | kUndefinedValue = -1 |
static const std::string | kFalseValue = "0" |
static const std::string | kTrueValue = "1" |
Definition at line 25 of file params.h.
Definition at line 17 of file params.cpp.
Moses::Parameters::Parameters | ( | int | argc, | |
char ** | argv, | |||
const ParamDefs * | paramdefs, | |||
const count_t | paramNum | |||
) |
Definition at line 22 of file params.cpp.
References loadParams().
std::string Moses::Parameters::getParam | ( | const std::string & | name | ) |
Definition at line 134 of file params.cpp.
References getParamValue().
int Moses::Parameters::getParamCount | ( | ) | const |
Definition at line 172 of file params.cpp.
std::string Moses::Parameters::getParamValue | ( | const std::string & | name | ) |
Definition at line 123 of file params.cpp.
References getValueType(), isValidParamName(), kBoolValue, kFalseValue, and kNotSetValue.
Referenced by getParam(), and loadParams().
int Moses::Parameters::getValueType | ( | const std::string & | name | ) |
Definition at line 101 of file params.cpp.
References kUndefinedValue.
Referenced by getParamValue(), and loadParams().
bool Moses::Parameters::isValidParamName | ( | const std::string & | name | ) |
Definition at line 108 of file params.cpp.
Referenced by getParamValue(), loadParams(), and setParamValue().
bool Moses::Parameters::loadParams | ( | const std::string & | param_file, | |
std::set< std::string > & | setParams | |||
) |
Definition at line 180 of file params.cpp.
bool Moses::Parameters::loadParams | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 39 of file params.cpp.
References getParamValue(), getValueType(), isValidParamName(), kBoolValue, kTrueValue, Utils::ltrim(), setParamValue(), trim(), and UTIL_THROW_IF2.
Referenced by Parameters().
bool Moses::Parameters::setParamValue | ( | const std::string & | name, | |
const std::string & | value | |||
) |
Definition at line 113 of file params.cpp.
References isValidParamName().
Referenced by loadParams().
bool Moses::Parameters::verifyValueType | ( | const std::string & | name, | |
const std::string & | value | |||
) |
Definition at line 166 of file params.cpp.
const int Moses::Parameters::kBoolValue = 0 [static] |
const std::string Moses::Parameters::kFalseValue = "0" [static] |
const int Moses::Parameters::kFloatValue = 2 [static] |
const int Moses::Parameters::kIntValue = 1 [static] |
const std::string Moses::Parameters::kNotSetValue = "__NOT_SET__" [static] |
const int Moses::Parameters::kStringValue = 3 [static] |
const std::string Moses::Parameters::kTrueValue = "1" [static] |
const int Moses::Parameters::kUndefinedValue = -1 [static] |