GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GApplicationPar Class Reference

Application parameter class. More...

#include <GApplicationPar.hpp>

Inheritance diagram for GApplicationPar:
GBase

Public Member Functions

 GApplicationPar (void)
 Void constructor. More...
 
 GApplicationPar (const std::string &name, const std::string &type, const std::string &mode, const std::string &value, const std::string &min, const std::string &max, const std::string &prompt)
 Parameter constructor. More...
 
 GApplicationPar (const GApplicationPar &par)
 Copy constructor. More...
 
virtual ~GApplicationPar (void)
 Destructor. More...
 
GApplicationParoperator= (const GApplicationPar &par)
 Assignment operator. More...
 
void clear (void)
 Clear parameter. More...
 
GApplicationParclone (void) const
 Clone parameter. More...
 
std::string classname (void) const
 Return class name. More...
 
void type (const std::string &type)
 Set parameter type. More...
 
void mode (const std::string &mode)
 Set parameter mode. More...
 
void value (const std::string &value)
 Set parameter value. More...
 
void string (const std::string &value)
 Set string parameter value. More...
 
void filename (const GFilename &value)
 Set filename parameter value. More...
 
void time (const GTime &value)
 Set time parameter value. More...
 
void boolean (const bool &value)
 Set bool parameter value. More...
 
void integer (const int &value)
 Set integer parameter value. More...
 
void real (const double &value)
 Set real parameter value. More...
 
const std::string & name (void) const
 Returns parameter name. More...
 
const std::string & type (void) const
 Returns parameter type. More...
 
const std::string & mode (void) const
 Returns parameter mode. More...
 
void query (void)
 Query parameter if required. More...
 
std::string value (void)
 Returns parameter value as string. More...
 
std::string string (void)
 Returns string parameter value. More...
 
GFilename filename (void)
 Returns filename parameter value. More...
 
GTime time (void)
 Return time in native reference system. More...
 
GTime time (const GTimeReference &ref)
 Returns time parameter value. More...
 
bool boolean (void)
 Returns boolean. More...
 
int integer (void)
 Returns integer. More...
 
double real (void)
 Returns real. More...
 
const std::string & current_value (void) const
 Returns current parameter value without querying. More...
 
const std::string & min (void) const
 Returns parameter minimum. More...
 
const std::string & max (void) const
 Returns parameter maximum. More...
 
const std::string & prompt (void) const
 Returns parameter prompt. More...
 
bool is_learn (void) const
 Signals if parameter mode is "learn". More...
 
bool is_query (void) const
 Signals if parameter mode is "query". More...
 
bool is_filename (void) const
 Signals if parameter mode is of type "filename". More...
 
bool is_valid (void)
 Signals if parameter is valid. More...
 
bool is_undefined (void)
 Signals if parameter is undefined. More...
 
bool is_notanumber (void)
 Signals if parameter is not a number. More...
 
bool was_queried (void) const
 Signals if parameter was queried. More...
 
void pickle (const std::vector< std::string > &string)
 Set class from pickled string vector. More...
 
std::vector< std::string > pickle (void) const
 Return pickled string vector. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print parameter. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Types

enum  Status {
  ST_VALID, ST_UNDEFINED, ST_NAN, ST_UNDERFLOW,
  ST_OVERFLOW
}
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GApplicationPar &par)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void check_type (const std::string &type) const
 Test validity of type string. More...
 
void check_mode (const std::string &mode) const
 Test validity of mode string. More...
 
void check_value (const std::string &value) const
 Test validity of value string. More...
 
void check_value_bool (const std::string &value) const
 Test validity of boolean value string. More...
 
void check_value_int (const std::string &value) const
 Test validity of integer parameter value. More...
 
void check_value_real (const std::string &value) const
 Test validity of real parameter value. More...
 
void check_value_string (const std::string &value) const
 Test validity of string parameter value. More...
 
void check_value_filename (const std::string &value) const
 Test validity of filename parameter value. More...
 
void check_value_time (const std::string &value) const
 Test validity of time parameter value. More...
 
bool check_options (const std::string &value) const
 Test if parameter value satisfies possible options. More...
 
std::string set_status (const std::string &value)
 Set parameter status. More...
 
void set_value (const std::string &value)
 Set parameter value. More...
 
void stop_query (void)
 Don't query parameter again. More...
 
std::string par_type_string (const std::string &type) const
 Return type string. More...
 
std::string par_status_string (void) const
 Return status string. More...
 

Protected Attributes

bool m_update
 Signal value updating. More...
 
bool m_queried
 Signal that parameter was queried. More...
 
std::string m_name
 Parameter name. More...
 
std::string m_type
 Parameter type. More...
 
std::string m_mode
 Parameter mode. More...
 
std::string m_value
 Parameter value. More...
 
std::string m_min
 Parameter minimum. More...
 
std::string m_max
 Parameter maximum. More...
 
std::string m_prompt
 Parameter prompt. More...
 
Status m_status
 Parameter status. More...
 

Friends

class GApplicationPars
 
class GApplication
 

Detailed Description

Application parameter class.

Definition at line 46 of file GApplicationPar.hpp.

Member Enumeration Documentation

enum GApplicationPar::Status
protected
Enumerator
ST_VALID 
ST_UNDEFINED 
ST_NAN 
ST_UNDERFLOW 
ST_OVERFLOW 

Definition at line 107 of file GApplicationPar.hpp.

Constructor & Destructor Documentation

GApplicationPar::GApplicationPar ( void  )

Void constructor.

Definition at line 78 of file GApplicationPar.cpp.

References init_members().

Referenced by clone().

GApplicationPar::GApplicationPar ( const std::string &  name,
const std::string &  type,
const std::string &  mode,
const std::string &  value,
const std::string &  min,
const std::string &  max,
const std::string &  prompt 
)

Parameter constructor.

Parameters
[in]nameParameter name.
[in]typeParameter type.
[in]modeParameter mode.
[in]valueParameter value.
[in]minParameter minimum.
[in]maxParameter maximum.
[in]promptParameter prompt string.

Constructs a parameter from parameter attributes.

Definition at line 101 of file GApplicationPar.cpp.

References init_members(), m_max, m_min, m_name, m_prompt, m_queried, max(), min(), mode(), name(), prompt(), type(), and value().

GApplicationPar::GApplicationPar ( const GApplicationPar par)

Copy constructor.

Parameters
[in]parParameter.

Definition at line 135 of file GApplicationPar.cpp.

References copy_members(), and init_members().

GApplicationPar::~GApplicationPar ( void  )
virtual

Destructor.

Definition at line 151 of file GApplicationPar.cpp.

References free_members().

Member Function Documentation

void GApplicationPar::boolean ( const bool &  value)

Set bool parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of boolean type.

This method sets a boolean parameter. The method only applies to parameters of type "b". Other parameter types will produce an exception.

Definition at line 384 of file GApplicationPar.cpp.

References G_BOOLEAN_SET, m_name, m_type, par_type_string(), set_value(), and value().

bool GApplicationPar::boolean ( void  )

Returns boolean.

Exceptions
GException::invalid_valueParameter is not of boolean type.

This method queries and returns a boolean parameter. The method only applies to parameters of type "b". Other parameter types will produce an exception.

Definition at line 660 of file GApplicationPar.cpp.

References G_BOOLEAN_GET, m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), ST_VALID, and gammalib::toupper().

void GApplicationPar::check_mode ( const std::string &  mode) const
protected

Test validity of mode string.

Parameters
[in]modeMode string.
Exceptions
GException::invalid_valueInvalid parameter mode.

The parameter mode has to be one of a,h,l,q,hl,ql,lh,lq.

Definition at line 1065 of file GApplicationPar.cpp.

References G_CHECK_MODE, and m_name.

Referenced by mode().

bool GApplicationPar::check_options ( const std::string &  value) const
protected

Test if parameter value satisfies possible options.

Parameters
[in]valueParameter value.
Returns
True if there were options, false otherwise.
Exceptions
GException::invalid_valueValue does not satisfy one of the possible options.

In case that the parameter has different options (m_max field not set and at least one character chain in m_min field, multiple chains separated by pipe symbol), check that the parameter value corresponds to one of the values in the m_min field. For strings, and for strings only, the parameter check is case insensitive.

Definition at line 1337 of file GApplicationPar.cpp.

References G_CHECK_OPTIONS, m_max, m_min, m_name, m_type, gammalib::split(), gammalib::strip_whitespace(), gammalib::toupper(), and value().

Referenced by check_value_filename(), check_value_int(), check_value_real(), check_value_string(), and check_value_time().

void GApplicationPar::check_type ( const std::string &  type) const
protected

Test validity of type string.

Parameters
[in]typeType string.
Exceptions
GException::invalid_valueInvalid parameter type.

The parameter type has to be one of b,i,r,s,f,fr,fw,fe,fn,t. The fr,fw,fe,fn types test for read access, write access, file existence, and file absence, respectively.

Definition at line 1039 of file GApplicationPar.cpp.

References G_CHECK_TYPE, and m_name.

Referenced by type().

void GApplicationPar::check_value ( const std::string &  value) const
protected

Test validity of value string.

Parameters
[in]valueValue string.

Requires that m_type, m_min and m_max are set. The method does not verify if m_type is valid.

Definition at line 1088 of file GApplicationPar.cpp.

References check_value_bool(), check_value_filename(), check_value_int(), check_value_real(), check_value_string(), check_value_time(), is_filename(), and m_type.

Referenced by set_value().

void GApplicationPar::check_value_bool ( const std::string &  value) const
protected

Test validity of boolean value string.

Parameters
[in]valueValue string.
Exceptions
GException::invalid_valueBoolean value string is not valid.

The Boolean value string has to be one of y,yes,true,t or n,no,false,f (case insensitive).

Definition at line 1126 of file GApplicationPar.cpp.

References G_CHECK_VALUE_BOOL, m_name, and gammalib::tolower().

Referenced by check_value().

void GApplicationPar::check_value_filename ( const std::string &  value) const
protected

Test validity of filename parameter value.

Parameters
[in]valueParameter value.

If options have been specified, check if the filename parameter value satisfies the options.

Requires that m_type, m_min and m_max are set. The method does not verify if m_type is valid.

Todo:
NONE is equivalent to an empty string.

Definition at line 1291 of file GApplicationPar.cpp.

References check_options().

Referenced by check_value().

void GApplicationPar::check_value_int ( const std::string &  value) const
protected

Test validity of integer parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueInteger parameter value outside validity range

If either options or a validity range has been specified, check if the integer parameter value satisfies the validity constraints.

Requires that m_type, m_status, m_min and m_max are set. The method does not verify if m_type is valid.

Definition at line 1159 of file GApplicationPar.cpp.

References check_options(), G_CHECK_VALUE_INT, m_max, m_min, m_name, m_status, ST_NAN, ST_UNDEFINED, and gammalib::toint().

Referenced by check_value().

void GApplicationPar::check_value_real ( const std::string &  value) const
protected

Test validity of real parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueReal parameter value outside validity range

If either options or a validity range has been specified, check if the real parameter value satisfies the validity constraints.

Requires that m_type, m_status, m_min and m_max are set. The method does not verify if m_type is valid.

Definition at line 1215 of file GApplicationPar.cpp.

References check_options(), G_CHECK_VALUE_REAL, m_max, m_min, m_name, m_status, ST_NAN, ST_UNDEFINED, and gammalib::todouble().

Referenced by check_value().

void GApplicationPar::check_value_string ( const std::string &  value) const
protected

Test validity of string parameter value.

Parameters
[in]valueParameter value.

If options have been specified, check if the string parameter value satisfies the options.

Requires that m_type, m_min and m_max are set. The method does not verify if m_type is valid.

Definition at line 1268 of file GApplicationPar.cpp.

References check_options().

Referenced by check_value().

void GApplicationPar::check_value_time ( const std::string &  value) const
protected

Test validity of time parameter value.

Parameters
[in]valueParameter value.

If options have been specified, check if the time parameter value satisfies the options.

Requires that m_type, m_min and m_max are set. The method does not verify if m_type is valid.

Definition at line 1312 of file GApplicationPar.cpp.

References check_options().

Referenced by check_value().

std::string GApplicationPar::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GApplicationPar").

Implements GBase.

Definition at line 155 of file GApplicationPar.hpp.

void GApplicationPar::clear ( void  )
virtual

Clear parameter.

Implements GBase.

Definition at line 203 of file GApplicationPar.cpp.

References free_members(), and init_members().

Referenced by pickle().

GApplicationPar * GApplicationPar::clone ( void  ) const
virtual

Clone parameter.

Returns
Pointer to deep copy of parameter.

Implements GBase.

Definition at line 221 of file GApplicationPar.cpp.

References GApplicationPar().

void GApplicationPar::copy_members ( const GApplicationPar par)
protected

Copy class members.

Parameters
[in]parParameter.

Definition at line 998 of file GApplicationPar.cpp.

References m_max, m_min, m_mode, m_name, m_prompt, m_queried, m_status, m_type, m_update, and m_value.

Referenced by GApplicationPar(), and operator=().

const std::string & GApplicationPar::current_value ( void  ) const
inline

Returns current parameter value without querying.

Returns
Current parameter value

Definition at line 203 of file GApplicationPar.hpp.

References m_value.

void GApplicationPar::filename ( const GFilename value)

Set filename parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of filename type.

This method sets a filename parameter. The method only applies to filename parameters. Other parameter types will produce an exception.

Definition at line 327 of file GApplicationPar.cpp.

References G_FILENAME_SET, is_filename(), m_name, m_type, par_type_string(), and set_value().

GFilename GApplicationPar::filename ( void  )

Returns filename parameter value.

Exceptions
GException::invalid_valueParameter is not of filename type.

This method queries and returns a filename parameter. The method only applies to filename parameters. Other parameter types will produce an exception. Any environment variables that are encountered within the filename are expanded automatically.

Definition at line 586 of file GApplicationPar.cpp.

References G_FILENAME_GET, is_filename(), m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), and ST_VALID.

void GApplicationPar::free_members ( void  )
protected

Delete class members.

Definition at line 1020 of file GApplicationPar.cpp.

Referenced by clear(), operator=(), and ~GApplicationPar().

void GApplicationPar::init_members ( void  )
protected

Initialise class members.

Definition at line 974 of file GApplicationPar.cpp.

References m_max, m_min, m_mode, m_name, m_prompt, m_queried, m_status, m_type, m_update, m_value, and ST_VALID.

Referenced by clear(), GApplicationPar(), and operator=().

void GApplicationPar::integer ( const int &  value)

Set integer parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of integer type.

This method sets an integer parameter. The method only applies to parameters of type "i". Other parameter types will produce an exception.

Definition at line 415 of file GApplicationPar.cpp.

References G_INTEGER_SET, m_name, m_type, par_type_string(), set_value(), and gammalib::str().

int GApplicationPar::integer ( void  )

Returns integer.

Exceptions
GException::invalid_valueParameter is not of integer type.

This method queries and returns an integer parameter. The method only applies to parameters of type "i". Other parameter types will produce an exception.

Definition at line 702 of file GApplicationPar.cpp.

References G_INTEGER_GET, m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), ST_VALID, and gammalib::toint().

bool GApplicationPar::is_filename ( void  ) const

Signals if parameter mode is of type "filename".

A parameter is of type "filename" if it has one of the following types: f, fr, fw, fe, or fn.

Definition at line 807 of file GApplicationPar.cpp.

References m_type.

Referenced by check_value(), and filename().

bool GApplicationPar::is_learn ( void  ) const

Signals if parameter mode is "learn".

A parameter is in mode learn when it has one of the following modes: hl,ql,lh, or lq.

Definition at line 774 of file GApplicationPar.cpp.

References m_mode.

bool GApplicationPar::is_notanumber ( void  )

Signals if parameter is not a number.

Definition at line 847 of file GApplicationPar.cpp.

References m_status, query(), and ST_NAN.

bool GApplicationPar::is_query ( void  ) const

Signals if parameter mode is "query".

A parameter will be queried when it has one of the following modes: q, ql, or lq.

Definition at line 791 of file GApplicationPar.cpp.

References m_mode.

Referenced by query().

bool GApplicationPar::is_undefined ( void  )

Signals if parameter is undefined.

Definition at line 834 of file GApplicationPar.cpp.

References m_status, query(), and ST_UNDEFINED.

bool GApplicationPar::is_valid ( void  )

Signals if parameter is valid.

Definition at line 821 of file GApplicationPar.cpp.

References m_status, query(), and ST_VALID.

const std::string & GApplicationPar::max ( void  ) const
inline

Returns parameter maximum.

Returns
Parameter maximum

Definition at line 227 of file GApplicationPar.hpp.

References m_max.

Referenced by GApplicationPar(), GApplicationPars::parline(), and print().

const std::string & GApplicationPar::min ( void  ) const
inline

Returns parameter minimum.

Returns
Parameter minimum

Definition at line 215 of file GApplicationPar.hpp.

References m_min.

Referenced by GApplicationPar(), GApplicationPars::parline(), and print().

void GApplicationPar::mode ( const std::string &  mode)

Set parameter mode.

Parameters
[in]modeParameter mode.

Sets the parameter model. Valid parameter modes are: a,h,l,q,hl,ql,lh,lq.

Definition at line 255 of file GApplicationPar.cpp.

References check_mode(), m_mode, and mode().

Referenced by GApplicationPars::parline().

const std::string & GApplicationPar::mode ( void  ) const
inline

Returns parameter mode.

Returns
Parameter mode

Definition at line 191 of file GApplicationPar.hpp.

References m_mode.

Referenced by GApplicationPar(), mode(), and print().

const std::string & GApplicationPar::name ( void  ) const
inline

Returns parameter name.

Returns
Parameter name

Definition at line 167 of file GApplicationPar.hpp.

References m_name.

Referenced by GApplicationPars::append(), GApplicationPar(), GApplicationPars::insert(), GApplicationPars::parline(), and print().

GApplicationPar & GApplicationPar::operator= ( const GApplicationPar par)

Assignment operator.

Parameters
[in]parParameter.
Returns
Parameter.

Definition at line 173 of file GApplicationPar.cpp.

References copy_members(), free_members(), and init_members().

std::string GApplicationPar::par_status_string ( void  ) const
protected

Return status string.

Returns
Returns the parameter status in human readable form.

Definition at line 1596 of file GApplicationPar.cpp.

References m_status, ST_NAN, ST_OVERFLOW, ST_UNDEFINED, ST_UNDERFLOW, and ST_VALID.

Referenced by boolean(), filename(), integer(), real(), string(), and time().

std::string GApplicationPar::par_type_string ( const std::string &  type) const
protected

Return type string.

Parameters
[in]typeParameter type.

Translates parameter type character(s) into a human readable type string. Valid parameter types are: b,i,r,s,f,fr,fw,fe,fn,t. If the parameter type is not valid, the method returns "unknown".

Definition at line 1557 of file GApplicationPar.cpp.

Referenced by boolean(), filename(), integer(), real(), string(), and time().

void GApplicationPar::pickle ( const std::vector< std::string > &  string)

Set class from pickled string vector.

Parameters
[in]stringString vector containing class information.

Definition at line 862 of file GApplicationPar.cpp.

References clear(), m_max, m_min, m_mode, m_name, m_prompt, m_queried, m_status, m_type, m_update, m_value, and gammalib::toint().

Referenced by GApplicationPars::pickle().

std::vector< std::string > GApplicationPar::pickle ( void  ) const

Return pickled string vector.

Returns
String vector containing class information.

Definition at line 889 of file GApplicationPar.cpp.

References m_max, m_min, m_mode, m_name, m_prompt, m_queried, m_status, m_type, m_update, m_value, gammalib::str(), and string().

std::string GApplicationPar::print ( const GChatter chatter = NORMAL) const
virtual

Print parameter.

Parameters
[in]chatterChattiness.
Returns
String containing parameter information.

Implements GBase.

Definition at line 917 of file GApplicationPar.cpp.

References m_status, m_value, max(), min(), mode(), name(), gammalib::parformat(), SILENT, ST_NAN, ST_OVERFLOW, ST_UNDEFINED, ST_UNDERFLOW, ST_VALID, and type().

const std::string & GApplicationPar::prompt ( void  ) const
inline

Returns parameter prompt.

Returns
Parameter prompt

Definition at line 239 of file GApplicationPar.hpp.

References m_prompt.

Referenced by GApplicationPar(), GApplicationPars::parline(), and query().

void GApplicationPar::query ( void  )

Query parameter if required.

This method queries the parameter from the stardard input if it is needed to be input by the user.

Definition at line 472 of file GApplicationPar.cpp.

References is_query(), m_max, m_min, m_prompt, m_update, m_value, prompt(), set_value(), stop_query(), gammalib::strip_whitespace(), value(), and was_queried().

Referenced by boolean(), filename(), integer(), is_notanumber(), is_undefined(), is_valid(), real(), string(), time(), and value().

void GApplicationPar::real ( const double &  value)

Set real parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of real type.

This method sets a real parameter. The method only applies to parameters of type "r". Other parameter types will produce an exception.

Definition at line 446 of file GApplicationPar.cpp.

References G_REAL_SET, m_name, m_type, par_type_string(), set_value(), and gammalib::str().

double GApplicationPar::real ( void  )

Returns real.

Exceptions
GException::invalid_valueParameter is not of real type.

This method queries and returns a real parameter. The method only applies to parameters of type "r". Other parameter types will produce an exception.

Definition at line 740 of file GApplicationPar.cpp.

References G_REAL_GET, m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), ST_VALID, and gammalib::todouble().

std::string GApplicationPar::set_status ( const std::string &  value)
protected

Set parameter status.

Parameters
[in]valueParameter value.
Returns
Updated parameter value.

Set parameter status depending on the content of the value field.

For an integer parameter, INDEF, NONE, UNDEF or UNDEFINED will result in a status of "undefined". INF, INFINITY or NAN will be transformed in the maximum long number.

For a real parameter, INDEF, NONE, UNDEF or UNDEFINED will result in a status of "undefined", while INF, INFINITY or NAN will result in a status of "nan".

For a time parameter, INDEF, NONE, UNDEF or UNDEFINED will result in a status of "undefined".

For a filename parameter, an empty string or INDEF, NONE, UNDEF or UNDEFINED will result in a status of "undefined".

Definition at line 1418 of file GApplicationPar.cpp.

References m_status, m_type, ST_NAN, ST_UNDEFINED, ST_VALID, gammalib::str(), gammalib::tolower(), and value().

Referenced by set_value().

void GApplicationPar::set_value ( const std::string &  value)
protected

Set parameter value.

Parameters
[in]valueParameter value.

Set parameter value, signal it for update and disable parameter querying.

Definition at line 1513 of file GApplicationPar.cpp.

References check_value(), m_update, m_value, set_status(), and stop_query().

Referenced by boolean(), filename(), integer(), query(), real(), string(), time(), and value().

void GApplicationPar::stop_query ( void  )
protected

Don't query parameter again.

Definition at line 1538 of file GApplicationPar.cpp.

References m_queried.

Referenced by query(), and set_value().

void GApplicationPar::string ( const std::string &  value)

Set string parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of string type.

This method sets a string parameter. The method only applies to parameters of type "s". Other parameter types will produce an exception.

Definition at line 299 of file GApplicationPar.cpp.

References G_STRING_SET, m_name, m_type, par_type_string(), and set_value().

std::string GApplicationPar::string ( void  )

Returns string parameter value.

Exceptions
GException::invalid_valueParameter is not of string type.

This method queries and returns a string parameter. The method only applies to parameters of type "s". Other parameter types will produce an exception.

Definition at line 550 of file GApplicationPar.cpp.

References G_STRING_GET, m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), and ST_VALID.

Referenced by pickle().

void GApplicationPar::time ( const GTime value)

Set time parameter value.

Parameters
[in]valueParameter value.
Exceptions
GException::invalid_valueParameter is not of time type.

This method sets a time parameter with a UTC string. The method only applies to time parameters. Other parameter types will produce an exception.

Definition at line 356 of file GApplicationPar.cpp.

References G_TIME_SET, m_name, m_type, par_type_string(), set_value(), and GTime::utc().

GTime GApplicationPar::time ( void  )
inline

Return time in native reference system.

Returns
Time.

Definition at line 250 of file GApplicationPar.hpp.

References GTime::reference().

GTime GApplicationPar::time ( const GTimeReference ref)

Returns time parameter value.

Parameters
[in]refTime reference system.
Returns
Time.
Exceptions
GException::invalid_valueParameter is not of time type.

This method queries and returns a time parameter. The method only applies to time parameters. Other parameter types will produce an exception. If the time is specified as "Mission Elapsed Time" (MET) the specified time reference system will be used for conversion.

Definition at line 625 of file GApplicationPar.cpp.

References G_TIME_GET, m_name, m_status, m_type, m_value, par_status_string(), par_type_string(), query(), and ST_VALID.

void GApplicationPar::type ( const std::string &  type)

Set parameter type.

Parameters
[in]typeParameter type.

Sets the parameter type. Valid parameter types are: b,i,r,s,f,fr,fw,fe,fn,t.

Definition at line 235 of file GApplicationPar.cpp.

References check_type(), m_type, and type().

Referenced by GApplicationPars::parline().

const std::string & GApplicationPar::type ( void  ) const
inline

Returns parameter type.

Returns
Parameter type

Definition at line 179 of file GApplicationPar.hpp.

References m_type.

Referenced by GApplicationPar(), print(), and type().

void GApplicationPar::value ( const std::string &  value)

Set parameter value.

Parameters
[in]valueParameter value.

Sets the parameter value dependent on the parameter type.

It is a parser method that verifies that the given parameter value is compatible with the parameter type.

Definition at line 278 of file GApplicationPar.cpp.

References set_value().

Referenced by GApplicationPars::parline().

std::string GApplicationPar::value ( void  )

Returns parameter value as string.

This method queries any parameter and returns it as a string. No parameter type checking is performed.

Definition at line 530 of file GApplicationPar.cpp.

References m_value, and query().

Referenced by boolean(), check_options(), GApplicationPar(), query(), and set_status().

bool GApplicationPar::was_queried ( void  ) const
inline

Signals if parameter was queried.

Returns
True if parameter was queried, false otherwise.

Definition at line 263 of file GApplicationPar.hpp.

References m_queried.

Referenced by query().

Friends And Related Function Documentation

friend class GApplication
friend

Definition at line 50 of file GApplicationPar.hpp.

friend class GApplicationPars
friend

Definition at line 49 of file GApplicationPar.hpp.

Member Data Documentation

std::string GApplicationPar::m_max
protected
std::string GApplicationPar::m_min
protected
std::string GApplicationPar::m_mode
protected

Parameter mode.

Definition at line 140 of file GApplicationPar.hpp.

Referenced by copy_members(), init_members(), is_learn(), is_query(), mode(), and pickle().

std::string GApplicationPar::m_prompt
protected

Parameter prompt.

Definition at line 144 of file GApplicationPar.hpp.

Referenced by copy_members(), GApplicationPar(), init_members(), pickle(), prompt(), and query().

bool GApplicationPar::m_queried
protected

Signal that parameter was queried.

Definition at line 137 of file GApplicationPar.hpp.

Referenced by copy_members(), GApplicationPar(), init_members(), pickle(), stop_query(), and was_queried().

std::string GApplicationPar::m_type
protected
bool GApplicationPar::m_update
protected

Signal value updating.

Definition at line 136 of file GApplicationPar.hpp.

Referenced by copy_members(), init_members(), pickle(), query(), and set_value().

std::string GApplicationPar::m_value
protected

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