Added the pure virtual isItThere method in base class eoParameterLoader

Also made the corresponding isItThere method in eoParser public.
This allows one to test if the user did actually input a given parameter
and thus not to write it in the output if not - as we want the output
of printOn to be "as identical as possible" to the actual user input
This commit is contained in:
evomarc 2001-04-10 15:08:09 +00:00
commit eafaa2d65e

View file

@ -24,7 +24,7 @@
*/
//-----------------------------------------------------------------------------
/**
CVS Info: $Date: 2001-03-21 13:35:10 $ $Version$ $Author: jmerelo $
CVS Info: $Date: 2001-04-10 15:08:09 $ $Version$ $Author: evomarc $
*/
#ifndef eoParser_h
#define eoParser_h
@ -56,6 +56,11 @@ public :
*/
virtual void processParam(eoParam& param, std::string section = "") = 0;
/**
* checks if _param has been actually entered
*/
virtual bool isItThere(eoParam& _param) const = 0;
/**
* Construct a Param and sets its value. The loader will own the memory thus created
*
@ -138,12 +143,16 @@ public:
string ProgramName() { return programName; }
/**
* checks if _param has been actually entered by the user
*/
virtual bool isItThere(eoParam& _param) const
{ return getValue(_param).first; }
private:
void doRegisterParam(eoParam& param) const;
bool isItThere(eoParam& _param) const { return getValue(_param).first; }
std::pair<bool, string> getValue(eoParam& _param) const;
void updateParameters() const;