-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_parameter.cpp
34 lines (24 loc) · 1.02 KB
/
test_parameter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Author: Mario S. Könz <mskoenz@gmx.net>
// Date: 07.01.2015 10:26:38 CET
// File: test_parameter.cpp
#include <iostream>
#include "addon/all.hpp"
int main(int argc, char * argv[]) {
//=========================== parameter ========================================================
auto & p = addon::parameter;
//-------------------------- set defaults ------------------------------------------------------
p["energy"] = 1.23;
p["x"] = 1;
p["p"] = "bla";
//------------------ read argv and bash_in.txt if available ------------------------------------
p.read(argc, argv);
//-------------------- basic +/* (returns boost::any) ------------------------------------------
p["img_dir"] = p["prog_dir"] + "/img";
p["y"] = p["x"] * 10;
p["magn"] = 13.45 + p["energy"];
std::cout << p << std::endl;
//---------------------------- assign ----------------------------------------------------------
int i = p["y"];
DEBUG_VAR(i)
return 0;
}