|
Aggie Student Toolkit — Load Balancer CSCE 412 Project 4
Arnav Fotedar · Fall 2026 · C++ load balancer simulation
|
Declares the Config structure and the command-line and interactive input functions. More...
#include <cstdint>#include <iosfwd>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | Config |
| Every user-adjustable setting for one simulation run. More... | |
Functions | |
| bool | parseArguments (int argc, char *argv[], Config &config, std::string &error) |
| Reads command-line options into a Config. | |
| void | promptForSettings (Config &config, std::istream &in, std::ostream &out) |
| Asks the user for the main settings, keeping the current value when the answer is blank. | |
| bool | validateConfig (const Config &config, std::string &error) |
| Checks that the settings are consistent. | |
| void | printUsage (std::ostream &out, const std::string &program) |
| Prints the list of command-line options. | |
Declares the Config structure and the command-line and interactive input functions.
Definition in file Config.h.
| bool parseArguments | ( | int | argc, |
| char * | argv[], | ||
| Config & | config, | ||
| std::string & | error ) |
Reads command-line options into a Config.
Running with no options (or only –no-color) turns on interactive mode so the user is asked for the main settings.
| argc | Argument count from main(). |
| argv | Argument values from main(). |
| config | Receives the parsed settings. |
| error | Receives a message when parsing fails. |
Definition at line 95 of file Config.cpp.
| void promptForSettings | ( | Config & | config, |
| std::istream & | in, | ||
| std::ostream & | out ) |
Asks the user for the main settings, keeping the current value when the answer is blank.
| config | Settings to update. |
| in | Stream to read answers from. |
| out | Stream to write questions to. |
Definition at line 201 of file Config.cpp.
| bool validateConfig | ( | const Config & | config, |
| std::string & | error ) |
Checks that the settings are consistent.
| config | Settings to check. |
| error | Receives a message describing the first problem found. |
Definition at line 214 of file Config.cpp.
| void printUsage | ( | std::ostream & | out, |
| const std::string & | program ) |
Prints the list of command-line options.
| out | Stream to write to. |
| program | Program name shown in the usage line. |
Definition at line 61 of file Config.cpp.