|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
Holds and parses command-line arguments. More...
#include <cmd_line_parser.hpp>

Public Member Functions | |
| Configuration::SimulationConfig | toSimulationConfig () const |
| Creates a SimulationConfig object from the parsed arguments. More... | |
| void | validate (const std::function< QString(const char *)> &tr_func) const |
| Validates the parsed command-line arguments. More... | |
Static Public Member Functions | |
| static std::unique_ptr< CmdLineArgs > | parse (const QStringList &q_args, const std::function< QString(const char *)> &tr_func) |
| Parses and validates command-line arguments. More... | |
Public Attributes | |
| std::size_t | n_iter_ |
| The number of iterations to run the simulation. More... | |
| std::size_t | n_bodies_ |
| The number of bodies in the simulation. More... | |
| double | dens_ |
| The density of the bodies. More... | |
| double | dt_ |
| The time step for each simulation iteration. More... | |
| double | G_ |
| The universal gravitational constant. More... | |
| double | epsilon_ |
| The numerical precision for floating-point comparisons. More... | |
| unsigned int | seed_ |
| The seed for the random number generator. More... | |
| bool | debug_console_ |
| Flag to enable diagnostic output. More... | |
| std::string | debug_file_ |
| File path for logging. More... | |
| std::string | debug_syslog_ |
| Identifier for syslog logging. More... | |
| LogLevel | log_level_ |
| Log level filter. More... | |
| std::size_t | log_freq_ |
| Frequency of energy log output. More... | |
| double | restitution_ |
| Coefficient of restitution for collisions. More... | |
| double | friction_ |
| Coefficient of kinetic (sliding) friction. More... | |
| double | static_friction_ |
| Coefficient of static friction. More... | |
| double | linear_damping_ |
| Damping factor for linear velocity. More... | |
| double | angular_damping_ |
| Damping factor for angular velocity. More... | |
| bool | show_torque_arrow_ |
| Flag to display torque vectors in the UI. More... | |
| bool | show_alpha_arrow_ |
| Flag to display angular acceleration vectors in the UI. More... | |
| std::string | cleanup_mode_ |
| Cleanup strategy: "fast" (deferred) or "strict" (sync). More... | |
Holds and parses command-line arguments.
This struct inherits from QObject to gain access to the tr() function for internationalisation.
Definition at line 177 of file cmd_line_parser.hpp.
|
inlinestatic |
Parses and validates command-line arguments.
unique_ptr to a CmdLineArgs struct on success, or nullptr if –help or –version was requested, or if an error occurred. Definition at line 375 of file cmd_line_parser.hpp.

|
inline |
Creates a SimulationConfig object from the parsed arguments.
Definition at line 244 of file cmd_line_parser.hpp.
|
inline |
Validates the parsed command-line arguments.
| po::validation_error | if any argument is invalid. |
Definition at line 270 of file cmd_line_parser.hpp.

| double CmdLine::CmdLineArgs::angular_damping_ |
Damping factor for angular velocity.
Definition at line 228 of file cmd_line_parser.hpp.
| std::string CmdLine::CmdLineArgs::cleanup_mode_ |
Cleanup strategy: "fast" (deferred) or "strict" (sync).
Definition at line 237 of file cmd_line_parser.hpp.
| bool CmdLine::CmdLineArgs::debug_console_ |
Flag to enable diagnostic output.
Definition at line 201 of file cmd_line_parser.hpp.
| std::string CmdLine::CmdLineArgs::debug_file_ |
File path for logging.
Definition at line 204 of file cmd_line_parser.hpp.
| std::string CmdLine::CmdLineArgs::debug_syslog_ |
Identifier for syslog logging.
Definition at line 207 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::dens_ |
The density of the bodies.
Definition at line 186 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::dt_ |
The time step for each simulation iteration.
Definition at line 189 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::epsilon_ |
The numerical precision for floating-point comparisons.
Definition at line 195 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::friction_ |
Coefficient of kinetic (sliding) friction.
Definition at line 219 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::G_ |
The universal gravitational constant.
Definition at line 192 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::linear_damping_ |
Damping factor for linear velocity.
Definition at line 225 of file cmd_line_parser.hpp.
| std::size_t CmdLine::CmdLineArgs::log_freq_ |
Frequency of energy log output.
Definition at line 213 of file cmd_line_parser.hpp.
| LogLevel CmdLine::CmdLineArgs::log_level_ |
Log level filter.
Definition at line 210 of file cmd_line_parser.hpp.
| std::size_t CmdLine::CmdLineArgs::n_bodies_ |
The number of bodies in the simulation.
Definition at line 183 of file cmd_line_parser.hpp.
| std::size_t CmdLine::CmdLineArgs::n_iter_ |
The number of iterations to run the simulation.
Definition at line 180 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::restitution_ |
Coefficient of restitution for collisions.
Definition at line 216 of file cmd_line_parser.hpp.
| unsigned int CmdLine::CmdLineArgs::seed_ |
The seed for the random number generator.
Definition at line 198 of file cmd_line_parser.hpp.
| bool CmdLine::CmdLineArgs::show_alpha_arrow_ |
Flag to display angular acceleration vectors in the UI.
Definition at line 234 of file cmd_line_parser.hpp.
| bool CmdLine::CmdLineArgs::show_torque_arrow_ |
Flag to display torque vectors in the UI.
Definition at line 231 of file cmd_line_parser.hpp.
| double CmdLine::CmdLineArgs::static_friction_ |
Coefficient of static friction.
Definition at line 222 of file cmd_line_parser.hpp.