simulation_framework::autonomy::cli::CliProvider Class Reference
Last update: 19.09.2025Provides a command-line interface for simulation execution via dependency injection. More...
#include <cli_provider.h>
Public Member Functions | |
| CliProvider (std::unique_ptr< ISimInstanceCreator > sim_instance_creator) | |
| Construct CliProvider to execute simulation based on given instance through command line options or args. | |
| ~CliProvider ()=default | |
| Default Destructor. | |
| const std::unique_ptr< core::Cli > & | GetCommandLineInterface () |
| Accesser of Cli reference. | |
| core::SimulationParameters | GetCoreParameters () const |
| Accesser of simulation parameters. | |
| bool | Parse (int argc, const char **argv) |
| Parses command-line arguments. | |
Detailed Description
Provides a command-line interface for simulation execution via dependency injection.
This class facilitates the creation of a command-line executable that executes a simulation on a specific simulation instance. The simulation instance is provided through a concrete implementation of the ISimInstanceCreator interface, enabling flexibility and modularity.
The design supports scenarios where different simulation instances need to be created dynamically based on the implementation of the ISimInstanceCreator.
An example of executable creation using CliProvider.
Definition at line 71 of file cli_provider.h.
Constructor & Destructor Documentation
◆ CliProvider()
| simulation_framework::autonomy::cli::CliProvider::CliProvider | ( | std::unique_ptr< ISimInstanceCreator > | sim_instance_creator | ) |
Construct CliProvider to execute simulation based on given instance through command line options or args.
- Parameters
-
sim_instance_creator An implementation of interface 'ISimInstanceCreator', showing how your simulation should be constructed
Member Function Documentation
◆ GetCommandLineInterface()
| const std::unique_ptr< core::Cli > & simulation_framework::autonomy::cli::CliProvider::GetCommandLineInterface | ( | ) |
Accesser of Cli reference.
- Returns
- The reference of 'core::Cli' object to let you do execution or enable the cli controller
◆ GetCoreParameters()
| core::SimulationParameters simulation_framework::autonomy::cli::CliProvider::GetCoreParameters | ( | ) | const |
Accesser of simulation parameters.
- Returns
- The generic simulation parameters parsed from command line inputs
◆ Parse()
Parses command-line arguments.
Processes the arguments passed from the process main function, allowing the application to configure or initialize based on the provided input. This function typically interprets options, flags, and positional arguments supplied via the command line.
- Parameters
-
argc The number of arguments passed to the program, including the executable name. argv An array of C-style strings representing the arguments.
- Returns
trueif the arguments were successfully parsed; otherwise,false.
The documentation for this class was generated from the following file: