GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
Input Class Reference

Manages reading and parsing of input files and command-line arguments. More...

#include <input.h>

Public Member Functions

 Input (const std::string &filename)
 Constructs an Input object and parses the input file.
 
void parseInputFile (const std::string &filename)
 Parses the input file and stores constants and filenames.
 
void parseCommandLineArgs (int argc, char *argv[])
 Parses command-line arguments and updates constants.
 
double getConstant (const std::string &key) const
 Gets the value of a constant.
 
std::string getFilename (const std::string &key) const
 Gets the value of a filename.
 
void setConstant (const std::string &key, double value)
 Sets or updates the value of a constant.
 
void setFilename (const std::string &key, const std::string &value)
 Sets or updates the value of a filename.
 

Detailed Description

Manages reading and parsing of input files and command-line arguments.

Constructor & Destructor Documentation

◆ Input()

Input::Input ( const std::string & filename)

Constructs an Input object and parses the input file.

Parameters
filenameThe name of the input file to be parsed.

Member Function Documentation

◆ getConstant()

double Input::getConstant ( const std::string & key) const

Gets the value of a constant.

Parameters
keyThe name of the constant to retrieve.
Returns
The value of the constant, or 0 if not found.

◆ getFilename()

std::string Input::getFilename ( const std::string & key) const

Gets the value of a filename.

Parameters
keyThe name of the filename to retrieve.
Returns
The filename as a string, or an empty string if not found.

◆ parseCommandLineArgs()

void Input::parseCommandLineArgs ( int argc,
char * argv[] )

Parses command-line arguments and updates constants.

Parameters
argcNumber of command-line arguments.
argvArray of command-line arguments.

◆ parseInputFile()

void Input::parseInputFile ( const std::string & filename)

Parses the input file and stores constants and filenames.

Parameters
filenameThe name of the input file to be parsed.

◆ setConstant()

void Input::setConstant ( const std::string & key,
double value )

Sets or updates the value of a constant.

Parameters
keyThe name of the constant to set.
valueThe value to assign to the constant.

◆ setFilename()

void Input::setFilename ( const std::string & key,
const std::string & value )

Sets or updates the value of a filename.

Parameters
keyThe name of the filename to set.
valueThe filename as a string.

The documentation for this class was generated from the following files: