Parameter Handling

by Stephan Pareigis

Parameter Handling

by Stephan Pareigis

Algorithms often need parameters which need to be adjusted while testing the program. Instead of writing all parameters in a .h-file which requires that the code has to be compiled after each change, we propose a method which allows parameter handling during runtime in a uniform manner.

A basic requirement for this is, that the parameters may still be used in equations, calculations and conditions without having to deal with bloatware method calls.

This code sample shows how to wrap atomic types such that they will still feel like an atomic type. However, because your parameters are inside a wrapper, you may now manipulate all your parameters via this wrapper class. For example, you may store all parameters in a list, save them to a file, remote access them with a browser and so on.

Related