Moses::Parameters Class Reference

#include <params.h>

List of all members.

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 &param_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"


Detailed Description

Todo:
ask abby2

Definition at line 25 of file params.h.


Constructor & Destructor Documentation

Moses::Parameters::Parameters ( const ParamDefs paramdefs,
const count_t  paramNum 
)

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().

Here is the call graph for this function:

Moses::Parameters::~Parameters (  )  [inline]

Definition at line 39 of file params.h.


Member Function Documentation

std::string Moses::Parameters::getParam ( const std::string &  name  ) 

Definition at line 134 of file params.cpp.

References getParamValue().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int Moses::Parameters::getValueType ( const std::string &  name  ) 

Definition at line 101 of file params.cpp.

References kUndefinedValue.

Referenced by getParamValue(), and loadParams().

Here is the caller graph for this function:

bool Moses::Parameters::isValidParamName ( const std::string &  name  ) 

Definition at line 108 of file params.cpp.

Referenced by getParamValue(), loadParams(), and setParamValue().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::Parameters::verifyValueType ( const std::string &  name,
const std::string &  value 
)

Definition at line 166 of file params.cpp.


Member Data Documentation

const int Moses::Parameters::kBoolValue = 0 [static]

Definition at line 29 of file params.h.

Referenced by getParamValue(), and loadParams().

const std::string Moses::Parameters::kFalseValue = "0" [static]

Definition at line 34 of file params.h.

Referenced by getParamValue().

const int Moses::Parameters::kFloatValue = 2 [static]

Definition at line 31 of file params.h.

const int Moses::Parameters::kIntValue = 1 [static]

Definition at line 30 of file params.h.

const std::string Moses::Parameters::kNotSetValue = "__NOT_SET__" [static]

Definition at line 28 of file params.h.

Referenced by getParamValue().

const int Moses::Parameters::kStringValue = 3 [static]

Definition at line 32 of file params.h.

const std::string Moses::Parameters::kTrueValue = "1" [static]

Definition at line 35 of file params.h.

Referenced by loadParams().

const int Moses::Parameters::kUndefinedValue = -1 [static]

Definition at line 33 of file params.h.

Referenced by getValueType().


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

Generated on Mon Aug 17 00:34:07 2015 for Moses by  doxygen 1.5.9