Home

André Aichert

Welcome to your wiki!

This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].

The wiki uses Markdown syntax.

Project Admins:


Discussion

  • André Aichert
    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
    GetSetGui::File("File","Input")
        .setExtensions("Text Files (*.txt);;All Files (*)")
        ="file.txt";
    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
    GetSetIO::load<GetSetIO::IniFile>("config.ini");
    
    // (try to) write configuration file
    GetSetIO::save<GetSetIO::IniFile>("config.ini");
    

    LibGetSet Example Image

     
    Last edit: André Aichert 2013-02-26