André Aichert - 2012-06-27

GetSet is a simple templated C++ library, which allows its users to focus on algorithm development by taking care of a clean configuration and loading/saving parameters.

Optionally, GetSet can automatically generate a simple GUI, which allows the user to tweak values. Notification works over a simple call-back mechanism, so the overhead for GUI-code is absolutely minimal.

GetSet is intended for small-sized projects, for example in the sciences, in algorithm development and for rapid prototyping.

Its simplicity is best illustrated in an example:

// Include GetSet
#include <GetSet/GetSet.hxx>

// Defining simple parameters
GetSet<int>("Algorithm","Number of Iterations")=25;
GetSet<double>("Algorithm","Step Size")=0.123;
GetSet<bool>("Algorithm","Verbose Output")=false;
GetSet<>("Algorithm","File Pattern")="file%i_%s.raw";
// GetSet<> is the same as GetSet<std::string>

// Accessing parameters
double step_size=GetSet<double>("Algorithm","Step Size");

// Accessing parameters: another example
if (GetSet<bool>("Algorithm","Verbose Output"))
    std::cout << "Verbose Output...\n";

// Defining advanced parameters : Files/Folders
    .setExtensions("Text Files (*.txt);;All Files (*)")
GetSetGui::Directory("File","Output Dir")="./results/";

// Defining advanced parameters : Enums (menu of choices)
GetSetGui::Enum("File","Output Format")
    .setChoices("JPEG;Windows BMP;PNG;raw data")
    =2; // here 2 means PNG
int selection=GetSet<int>("File","Output Format");

// And more!
// See documentation && examples shipped with the libraries

#include <GetSet/GetSetIO.h>
// (try to) read configuration file

// (try to) write configuration file

LibGetSet Example Image

Last edit: André Aichert 2013-02-26