Moses::Parameter Class Reference

#include <Parameter.h>

List of all members.

Public Member Functions

 Parameter ()
 ~Parameter ()
bool LoadParam (int argc, char *argv[])
bool LoadParam (const std::string &filePath)
void Explain ()
const PARAM_VECGetParam (const std::string &paramName)
bool isParamSpecified (const std::string &paramName)

Protected Member Functions

std::string FindParam (const std::string &paramSwitch, int argc, char *argv[])
void OverwriteParam (const std::string &paramSwitch, const std::string &paramName, int argc, char *argv[])
bool ReadConfigFile (const std::string &filePath)
bool FilesExist (const std::string &paramName, int fieldNo, std::vector< std::string > const &fileExtension=std::vector< std::string >(1,""))
bool isOption (const char *token)
bool Validate ()
void AddParam (const std::string &paramName, const std::string &description)
void AddParam (const std::string &paramName, const std::string &abbrevName, const std::string &description)
void PrintCredit ()

Protected Attributes

PARAM_MAP m_setting
PARAM_BOOL m_valid
PARAM_STRING m_abbreviation
PARAM_STRING m_description


Detailed Description

Handles parameter values set in config file or on command line. Process raw parameter data (names and values as strings) for StaticData to parse; to get useful values, see StaticData.

Definition at line 41 of file Parameter.h.


Constructor & Destructor Documentation

Moses::Parameter::Parameter (  ) 

define allowed parameters

Definition at line 38 of file Parameter.cpp.

References AddParam().

Here is the call graph for this function:

Moses::Parameter::~Parameter (  ) 

Definition at line 151 of file Parameter.cpp.


Member Function Documentation

void Moses::Parameter::AddParam ( const std::string &  paramName,
const std::string &  abbrevName,
const std::string &  description 
) [protected]

void Moses::Parameter::AddParam ( const std::string &  paramName,
const std::string &  description 
) [protected]

Referenced by Parameter().

Here is the caller graph for this function:

void Moses::Parameter::Explain (  ) 

print descriptions of all parameters

Definition at line 172 of file Parameter.cpp.

References m_abbreviation, and m_description.

Referenced by LoadParam(), and main().

Here is the caller graph for this function:

bool Moses::Parameter::FilesExist ( const std::string &  paramName,
int  fieldNo,
std::vector< std::string > const &  fileExtension = std::vector< std::string >(1,"") 
) [protected]

Referenced by Validate().

Here is the caller graph for this function:

std::string Moses::Parameter::FindParam ( const std::string &  paramSwitch,
int  argc,
char *  argv[] 
) [protected]

Referenced by LoadParam().

Here is the caller graph for this function:

const PARAM_VEC& Moses::Parameter::GetParam ( const std::string &  paramName  )  [inline]

bool Moses::Parameter::isOption ( const char *  token  )  [protected]

check whether an item on the command line is a switch or a value

Parameters:
token token on the command line to checked

Definition at line 189 of file Parameter.cpp.

Referenced by LoadParam().

Here is the caller graph for this function:

bool Moses::Parameter::isParamSpecified ( const std::string &  paramName  )  [inline]

check if parameter is defined (either in moses.ini or as switch)

Definition at line 73 of file Parameter.h.

References m_setting.

Referenced by Moses::StaticData::LoadData(), and main().

Here is the caller graph for this function:

bool Moses::Parameter::LoadParam ( const std::string &  filePath  ) 

bool Moses::Parameter::LoadParam ( int  argc,
char *  argv[] 
)

load all parameters from the configuration file and the command line switches

Definition at line 207 of file Parameter.cpp.

References Moses::UserMessage::Add(), Explain(), FindParam(), isOption(), m_abbreviation, m_description, m_setting, m_valid, OverwriteParam(), PrintCredit(), ReadConfigFile(), TRACE_ERR, and Validate().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::Parameter::OverwriteParam ( const std::string &  paramSwitch,
const std::string &  paramName,
int  argc,
char *  argv[] 
) [protected]

Referenced by LoadParam().

Here is the caller graph for this function:

void Moses::Parameter::PrintCredit (  )  [protected]

Definition at line 513 of file Parameter.cpp.

References NULL.

Referenced by LoadParam().

Here is the caller graph for this function:

bool Moses::Parameter::ReadConfigFile ( const std::string &  filePath  )  [protected]

Referenced by LoadParam().

Here is the caller graph for this function:

bool Moses::Parameter::Validate (  )  [protected]

check that parameter settings make sense

Definition at line 271 of file Parameter.cpp.

References Moses::UserMessage::Add(), Moses::FileExists(), FilesExist(), key, m_setting, and m_valid.

Referenced by LoadParam().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 46 of file Parameter.h.

Referenced by Explain(), and LoadParam().

Definition at line 47 of file Parameter.h.

Referenced by Explain(), and LoadParam().

Definition at line 44 of file Parameter.h.

Referenced by GetParam(), isParamSpecified(), LoadParam(), and Validate().

Definition at line 45 of file Parameter.h.

Referenced by LoadParam(), and Validate().


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

Generated on Wed Feb 8 22:04:09 2012 for Moses by  doxygen 1.5.9