fesa-core  4.2.0
fesa::ProcessConfigurer Class Reference

Take care of configuring the FESA process from either configuration files or command line arguments. More...

#include <ProcessConfigurer.h>

Inherits noncopyable.

Public Member Functions

 ProcessConfigurer ()
 Constructor.
 
virtual ~ProcessConfigurer ()
 Destructor.
 
void init (int argc, char *argv[])
 Create process configuration. More...
 
bool isHelpNeeded () const
 Check if user spcified a help argument. More...
 
void printHelp () const
 Print out information on arguments that can be given to a Fesa binary.
 
virtual void load (const ConfigDirs &configDirs)
 Decode the command line arguments and load the configuration files. All configuration parameters frome these files are stored in this class. More...
 
const std::string & getLogConfigFile () const
 Get the name and location of the logging configuration file. More...
 
const std::string & getCMWConfigFile () const
 Get the name and location of the CMW configuration file. More...
 
const std::string & getMsgConfigFile () const
 Get the name and location of the file with exception messages. More...
 
const std::string & getLabMsgConfigFile () const
 Get the name and location of the lab specific file with exception messages. More...
 
const std::string & getCMWServerName () const
 Get the name of the CMW server. More...
 
void setCMWServerName (const std::string &name)
 Set the name of the CMW server. More...
 
bool isInTimingSimulationMode () const
 Check if timing simulation is enabled. More...
 
LoggingMode::LoggingMode getLoggingMode () const
 Get the logging mode - normal, verbose, or very verbose. More...
 
const std::string & getUsrCmdArgs () const
 Get the user command line arguments. More...
 
bool isDefined (const std::string &tag) const
 Check if a property is defined. More...
 
std::string getStringValue (const std::string &tag) const
 Get a string property's value. More...
 
int getIntValue (const std::string &tag) const
 Get a numerical property's value. More...
 
int getIntValue (const std::string &tag, int defaultValue) const
 Get a numerical property's value. If it is not found or in a bad format, returns a default value. More...
 
bool getBoolValue (const std::string &tag) const
 Get a boolean property's value. More...
 

Protected Member Functions

 ProcessConfigurer (cmw::util::CmdOptions::CmdArgList argList)
 Constructor. More...
 
void setIntValue (const std::string &tag, int value)
 Set a numerical property's value. More...
 
void setBoolValue (const std::string &tag, bool value)
 Set a boolean property's value. More...
 

Detailed Description

Take care of configuring the FESA process from either configuration files or command line arguments.

Exceptions
FesaExceptionIf an invalid command line argument was specified

Constructor & Destructor Documentation

fesa::ProcessConfigurer::ProcessConfigurer ( cmw::util::CmdOptions::CmdArgList  argList)
protected

Constructor.

Parameters
argListlist of the command line arguments

Member Function Documentation

bool fesa::ProcessConfigurer::getBoolValue ( const std::string &  tag) const

Get a boolean property's value.

Parameters
tagThe name of the property
Returns
The value of the property
Exceptions
FesaExceptionIf the property with the given name was not found or the property is not boolean
const std::string & fesa::ProcessConfigurer::getCMWConfigFile ( ) const

Get the name and location of the CMW configuration file.

Returns
The name and location of the CMW configuration file
const std::string & fesa::ProcessConfigurer::getCMWServerName ( ) const

Get the name of the CMW server.

Returns
The name of the CMW server
int fesa::ProcessConfigurer::getIntValue ( const std::string &  tag) const

Get a numerical property's value.

Parameters
tagThe name of the property
Returns
The value of the property
Exceptions
FesaExceptionIf the property with the given name was not found or the property is not numerical
int fesa::ProcessConfigurer::getIntValue ( const std::string &  tag,
int  defaultValue 
) const

Get a numerical property's value. If it is not found or in a bad format, returns a default value.

Parameters
tagThe name of the property
defaultValuethe value to return in case of an error
Returns
The value of the property
Exceptions
FesaExceptionIf the property with the given name was not found or the property is not numerical
const std::string & fesa::ProcessConfigurer::getLabMsgConfigFile ( ) const

Get the name and location of the lab specific file with exception messages.

Returns
The name and location of the CMW configuration file
const std::string & fesa::ProcessConfigurer::getLogConfigFile ( ) const

Get the name and location of the logging configuration file.

Returns
The name and location of the logging configuration file
LoggingMode::LoggingMode fesa::ProcessConfigurer::getLoggingMode ( ) const

Get the logging mode - normal, verbose, or very verbose.

Returns
The logging mode
const std::string & fesa::ProcessConfigurer::getMsgConfigFile ( ) const

Get the name and location of the file with exception messages.

Returns
The name and location of the CMW configuration file
std::string fesa::ProcessConfigurer::getStringValue ( const std::string &  tag) const

Get a string property's value.

Parameters
tagThe name of the property
Returns
The value of the property
Exceptions
FesaExceptionIf the property with the given name was not found
const std::string & fesa::ProcessConfigurer::getUsrCmdArgs ( ) const

Get the user command line arguments.

Returns
The user command line arguments
void fesa::ProcessConfigurer::init ( int  argc,
char *  argv[] 
)

Create process configuration.

Parameters
argcargc given to main
argvargv given to main
bool fesa::ProcessConfigurer::isDefined ( const std::string &  tag) const

Check if a property is defined.

Parameters
tagThe name of the property
Returns
true if the property is defined, false otherwise
bool fesa::ProcessConfigurer::isHelpNeeded ( ) const

Check if user spcified a help argument.

Returns
true if a help argument was specified, false otherwise
bool fesa::ProcessConfigurer::isInTimingSimulationMode ( ) const

Check if timing simulation is enabled.

Returns
true if timing simulation is enabled, false otherwise
void fesa::ProcessConfigurer::load ( const ConfigDirs &  configDirs)
virtual

Decode the command line arguments and load the configuration files. All configuration parameters frome these files are stored in this class.

Parameters
configDirsDirectories where the configuration files are
void fesa::ProcessConfigurer::setBoolValue ( const std::string &  tag,
bool  value 
)
protected

Set a boolean property's value.

Parameters
tagThe name of the property
valueThe value of the property
void fesa::ProcessConfigurer::setCMWServerName ( const std::string &  name)

Set the name of the CMW server.

Parameters
nameThe name of the CMW server
void fesa::ProcessConfigurer::setIntValue ( const std::string &  tag,
int  value 
)
protected

Set a numerical property's value.

Parameters
tagThe name of the property
valueThe value of the property

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