|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
Namespace for command-line parsing logic. More...
Classes | |
| struct | CmdLineArgs |
| Holds and parses command-line arguments. More... | |
| struct | OptionDefinition |
| A struct to hold the definition of a single command-line option. More... | |
Enumerations | |
| enum class | ExitCode : int { Success = 0 , CmdLineError = -1 , NotEnoughIterations = -2 , NotEnoughBodies = -3 , NegativeDensity = -4 , NegativeTimeStep = -5 , NegativeGravity = -6 , NegativeEpsilon = -7 , OutOfRange = -8 , BadAlloc = -9 , StdException = -10 , UnknownException = -11 } |
| Exit codes for the application. More... | |
| enum class | LogLevel { Debug , Info , Warning , Critical , Fatal } |
| Log level for the application. More... | |
Functions | |
| std::ostream & | operator<< (std::ostream &os, const LogLevel &level) |
Overload of operator<< for LogLevel to enable streaming. More... | |
| std::string | toStringWithPrecision (double value, int precision=1, bool use_scientific=true) |
| Converts a double to a string with a specified precision for display. More... | |
| void | validateIsPositive ( const std::size_t &value, const std::string &option_name, const std::function< QString(const char *)> &tr_func) |
| Validates that an unsigned integer option is greater than zero. More... | |
| std::istream & | operator>> (std::istream &is, LogLevel &level) |
Overload of operator>> for Boost.Program_Options to parse LogLevel. More... | |
Namespace for command-line parsing logic.
|
strong |
Exit codes for the application.
Definition at line 45 of file cmd_line_parser.hpp.
|
strong |
Log level for the application.
Definition at line 61 of file cmd_line_parser.hpp.
|
inline |
Overload of operator<< for LogLevel to enable streaming.
This is required by boost::program_options for displaying default values in the help message.
| os | The output stream. |
| level | The LogLevel enum to stream. |
Definition at line 79 of file cmd_line_parser.hpp.
|
inline |
Overload of operator>> for Boost.Program_Options to parse LogLevel.
| is | The input stream. |
| level | The LogLevel enum to populate. |
Definition at line 133 of file cmd_line_parser.hpp.
|
inline |
Converts a double to a string with a specified precision for display.
| value | The double value to convert. |
| precision | The number of digits of precision. |
| use_scientific | If true, uses scientific notation; otherwise, uses fixed. |
Definition at line 106 of file cmd_line_parser.hpp.
|
inline |
Validates that an unsigned integer option is greater than zero.
| value | The value of the option to validate. |
| option_name | The name of the option, used for the error message. |
| po::validation_error | if the value is zero. |
This is a custom validator for use with Boost.Program_Options.
Definition at line 690 of file cmd_line_parser.hpp.
