GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1#ifndef INPUT_H
2#define INPUT_H
3
4#include <string>
5#include <map>
6
10class Input {
11private:
12 std::map<std::string, std::string> filenames;
13 std::map<std::string, double> constants;
14
15public:
20 Input(const std::string &filename);
21
26 void parseInputFile(const std::string &filename);
27
33 void parseCommandLineArgs(int argc, char *argv[]);
34
40 double getConstant(const std::string &key) const;
41
47 std::string getFilename(const std::string &key) const;
48
54 void setConstant(const std::string &key, double value);
55
61 void setFilename(const std::string &key, const std::string &value);
62};
63
64#endif // INPUT_H
Manages reading and parsing of input files and command-line arguments.
Definition input.h:10
void setConstant(const std::string &key, double value)
Sets or updates the value of a constant.
Definition input.cpp:74
void setFilename(const std::string &key, const std::string &value)
Sets or updates the value of a filename.
Definition input.cpp:78
std::string getFilename(const std::string &key) const
Gets the value of a filename.
Definition input.cpp:65
void parseInputFile(const std::string &filename)
Parses the input file and stores constants and filenames.
Definition input.cpp:11
double getConstant(const std::string &key) const
Gets the value of a constant.
Definition input.cpp:56
void parseCommandLineArgs(int argc, char *argv[])
Parses command-line arguments and updates constants.
Definition input.cpp:37
Input(const std::string &filename)
Constructs an Input object and parses the input file.
Definition input.cpp:7