> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# simulation_framework::autonomy::cli::CliProvider Class Reference

Provides a command-line interface for simulation execution via dependency injection.

`#include <cli_provider.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | [CliProvider](#aaa4a83f8ce6c7532b64621c25a646eb3) (std::unique\_ptr\< [ISimInstanceCreator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1ISimInstanceCreator.md) > sim\_instance\_creator) Construct [CliProvider](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1cli_1_1CliProvider.md) to execute simulation based on given instance through command line options or args. |
| | [\~CliProvider](#ad471556a9f2093e7678b580843827f12) ()=default Default Destructor. |
| const std::unique\_ptr\< [core::Cli](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1core_1_1Cli.md) > & | [GetCommandLineInterface](#a9d9724853b96277950023d17cd251d39) () Accesser of Cli reference. |
| [core::SimulationParameters](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/structsimulation__framework_1_1core_1_1SimulationParameters.md) | [GetCoreParameters](#a632fd12769ad3ba2aecaf2d854602e9a) () const Accesser of simulation parameters. |
| bool | [Parse](#abd689d5923a3218f0acb267f080ec591) (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`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1ISimInstanceCreator) 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`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1ISimInstanceCreator).

**See also**

[ISimInstanceCreator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1ISimInstanceCreator.md), [core::SimulationParameters](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/structsimulation__framework_1_1core_1_1SimulationParameters.md)

An example of executable creation using [CliProvider](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1cli_1_1CliProvider.md).

```cpp theme={null}
#include "autonomy/cli/cli_provider/cli_provider.h"
#include "your_sim_instance_creator.h"

enum CliReturnCode
{
    kSuccess = 0,
    kParserError = 1,
    kCliError = 2
};

int main(int argc, const char** argv)
{
 auto cli_provider = std::make_unique<autonomy::cli::CliProvider>(
        std::move(std::make_unique<YourSimInstanceCreator>()));

 if (cli_provider->Parse(argc, argv))
    {
 if (!cli_provider->GetCommandLineInterface()->Execute())
        {
 return CliReturnCode::kCliError;
        }
 return CliReturnCode::kSuccess;
    }

 return CliReturnCode::kParserError;
}
```

## Constructor & Destructor Documentation

### CliProvider()

```cpp theme={null}
simulation_framework::autonomy::cli::CliProvider::CliProvider(
    std::unique_ptr< ISimInstanceCreator > sim_instance_creator
)
```

Construct [CliProvider](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1cli_1_1CliProvider.md) to execute simulation based on given instance through command line options or args.

**Parameters**

| Name | Description |
| - | - |
| sim\_instance\_creator | An implementation of interface '[ISimInstanceCreator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1autonomy_1_1ISimInstanceCreator.md)', showing how your simulation should be constructed |

## Member Function Documentation

### GetCommandLineInterface()

```cpp theme={null}
const std::unique_ptr< core::Cli >& simulation_framework::autonomy::cli::CliProvider::GetCommandLineInterface(
)
```

Accesser of Cli reference.

**Returns**

The reference of '[core::Cli](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/classsimulation__framework_1_1core_1_1Cli.md)' object to let you do execution or enable the cli controller

### GetCoreParameters()

```cpp theme={null}
core::SimulationParameters simulation_framework::autonomy::cli::CliProvider::GetCoreParameters(
) const
```

Accesser of simulation parameters.

**Returns**

The generic simulation parameters parsed from command line inputs

### Parse()

```cpp theme={null}
bool simulation_framework::autonomy::cli::CliProvider::Parse(
    int argc,
    const char ** argv
)
```

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**

| Name | Description |
| - | - |
| argc | The number of arguments passed to the program, including the executable name. |
| argv | An array of C-style strings representing the arguments. |

**Returns**

`true` if the arguments were successfully parsed; otherwise, `false`.

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

* [cli\_provider.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/cli__provider_8h_source.md)
