I am currently working in an aleady developed C++ project. The existing files are the following:
-main.cpp
-HydroModel.cpp
-ODESys.cpp
-HydroModel.hpp
-ODESys.hpp
-ODESysSol.hpp
In the file HydroModel.hpp there are some constants defined in the namespace config, for example
namespace config
{
const unsigned int dim = 40;
const unsigned int NaN = 10101; ...
}
This file is being included in main.cpp, ODESysSol.hpp and HydroModel.cpp. These constants are being used over and over in those files.
However, these constants are not always the same, as they change depending on the case study analyzed. The idea is to take out these variables into a txt file in order to avoid compiling each time that the case study changes.
I know it would be easy if the variables are being defined inside a function or the main(), but so far I didn't find a way to do it in the preprocessor.
Is it possible to load the txt file and define the variables inside the namespace or I have to rewrite everything that is related to those variables?