8.4.2. Parameter Accessor

Collection of APIs to access parameters.

Functions

MDOgetdblparam()

Retrieve the value of a double-valued parameter

MDOgetintparam()

Retrieve the value of a integer-valued parameter

MDOgetstrparam()

Retrieve the value of a string-valued parameter

MDOsetdblparam()

Set the value of a double-valued parameter

MDOsetintparam()

Set the value of a integer-valued parameter

MDOsetstrparam()

Set the value of a string-valued parameter

MDOgetdblparaminfo()

Retrieve information and the current value of a double-valued parameter

MDOgetintparaminfo()

Retrieve information and the current value of a integer-valued parameter

MDOgetstrparaminfo()

Retrieve information and the current value of a string-valued parameter

MDOreadparams()

Load parameter settings into environment from a file

MDOwriteparams()

Serialize parameter settings to a file

MDOresetparams()

Reset all parameters to their default values

int MDOgetdblparam(MDOenv *env, const char *paramname, double *valueP)

Retrieve the value of a double-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve.

  • valueP (double*) – [out] The place to hold the parameter value.

Returns

A response code that specifies the status of the function.

int MDOgetintparam(MDOenv *env, const char *paramname, int *valueP)

Retrieve the value of a integer-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve.

  • valueP (int*) – [out] The place to hold the parameter value.

Returns

A response code that specifies the status of the function.

int MDOgetstrparam(MDOenv *env, const char *paramname, char *valueP)

Retrieve the value of a string-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve.

  • valueP (char*) – [out] The place to hold the parameter value. It should have enough capacity to store the result string.

Returns

A response code that specifies the status of the function.

int MDOsetdblparam(MDOenv *env, const char *paramname, double newvalue)

Set the value of a double-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to set.

  • newvalue (double) – [out] The new parameter value.

Returns

A response code that specifies the status of the function.

int MDOsetintparam(MDOenv *env, const char *paramname, int newvalue)

Set the value of a integer-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to set.

  • newvalue (int) – [out] The new parameter value.

Returns

A response code that specifies the status of the function.

int MDOsetstrparam(MDOenv *env, const char *paramname, const char *newvalue)

Set the value of a string-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to set.

  • newvalue (const char*) – [out] The new parameter value.

Returns

A response code that specifies the status of the function.

int MDOgetdblparaminfo(MDOenv *env, const char *paramname, double *valueP, double *minP, double *maxP, double *defaultP)

Retrieve information and the current value of a double-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve information and value.

  • valueP (double*) – [out] Place to hold the current parameter value.

  • minP (double*) – [out] Place to hold the minimum acceptable parameter value.

  • maxP (double*) – [out] Place to hold the maximum acceptable parameter value.

  • defaultP (double*) – [out] Place to hold the default parameter value.

Returns

A response code that specifies the status of the function.

int MDOgetintparaminfo(MDOenv *env, const char *paramname, int *valueP, int *minP, int *maxP, int *defaultP)

Retrieve information and the current value of a integer-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve information and value.

  • valueP (int*) – [out] Place to hold the current parameter value.

  • minP (int*) – [out] Place to hold the minimum acceptable parameter value.

  • maxP (int*) – [out] Place to hold the maximum acceptable parameter value.

  • defaultP (int*) – [out] Place to hold the default parameter value.

Returns

A response code that specifies the status of the function.

int MDOgetstrparaminfo(MDOenv *env, const char *paramname, char *valueP, char *defaultP)

Retrieve information and the current value of a string-valued parameter.

Parameters
  • env (MDOenv*) – [in] The parameter holder environment.

  • paramname (const char*) – [in] parameter name to Retrieve information and value.

  • valueP (char*) – [out] Place to hold the current parameter value. It should have enough capacity to store the result string.

  • defaultP (char*) – [out] Place to hold the default parameter value. It should have enough capacity to store the result string.

Returns

A response code that specifies the status of the function.

int MDOreadparams(MDOenv *env, const char *filename)

Load parameter settings into environment from a file.

Parameters
  • env (MDOenv*) – [in] The environment pointer.

  • filename (const char*) – [in] The path to the parameter file. Its compression type (if any) should be encoded into its suffix. Valid suffixed are: .gz and .bz2.

Returns

A response code that specifies the status of the function.

int MDOwriteparams(MDOenv *env, const char *filename)

Serialize parameter settings to a file.

Parameters
  • env (MDOenv*) – [in] The environment pointer.

  • filename (const char*) – [in] The path to the parameter file. Its compression type (if any) can be encoded into its suffix. Valid suffixed are: .gz and .bz2.

Returns

A response code that specifies the status of the function.

void MDOresetparams(MDOenv *env)

Reset all parameters to their default values.

Parameters
  • env (MDOenv*) – [in] The environment pointer.