FireDynamics / ARTSS

ARTSS is an Accelerator-based Real Time Smoke Simulator, which specialises in fast calculation of smoke propagation
MIT License
11 stars 7 forks source link

feature: Proxy for Setting #181

Closed ChristianVonMach closed 2 years ago

ChristianVonMach commented 2 years ago

attempt to implement a proxy for Parameters bei class Settings. Settings uses a hash_map for fast access of already read values and the possibility to overwrite settings at runtime. Intern Settings continues using Parametersto read the XML.

ChristianVonMach commented 2 years ago

reading of values is done similiere to Parameters.

    Settings sets;
    std::cout << sets.get("physical_parameters/t_end") << "\n";
    std::cout << sets.get_real("physical_parameters/t_end") << "\n";
    sets.set("physical_parameters/t_end", "101.314");
    std::cout << sets.get_real("physical_parameters/t_end") << "\n";

Output

 100.
100
101.314

Logs

[2021-11-18 00:46:36.658] [P8Settings] [debug] first time reading: "physical_parameters/t_end" with value: " 100. "
[2021-11-18 00:46:36.658] [P8Settings] [debug] set: "physical_parameters/t_end" to value: " 100. "
[2021-11-18 00:46:36.658] [P8Settings] [debug] reading: "physical_parameters/t_end" with value: " 100. "
[2021-11-18 00:46:36.658] [P8Settings] [debug] reading: "physical_parameters/t_end" with value: " 100. "
[2021-11-18 00:46:36.658] [P8Settings] [debug] set: "physical_parameters/t_end" to value: "101.314"
[2021-11-18 00:46:36.658] [P8Settings] [debug] reading: "physical_parameters/t_end" with value: "101.314"