I'm currently developing a project which has multiple c++ programs communicating over IPC to each other. Each of these programs will rely on some parameters to run and these may be common to several programs, e.g.parameters for camera calibration, minNeighbours, scaling factor, etc.
I am wondering what the best practices are for achieving this. Solutions being considered at this stage are:
Hardcoding the values in - obviously not good if I should ever want to change the values of the parameters.
Include a constants.hpp file containing const [int] variable definitions - my current solution.
A config.txt file which can be parsed by each program at its start-up - can multiple programs safely open and read files concurrently.
Preprocessor directives, i.e. #define.
I can implement any solution, I'm really looking for guidance on best practices.