> This page is for version 4.3.
> For other versions, use one of these documentation indexes:
> - 4.6 (Latest) (default): https://docs.nvidia.com/holoscan/sdk-user-guide/4-6-latest/llms.txt
> - ltsb-2.0: https://docs.nvidia.com/holoscan/sdk-user-guide/ltsb-2-0/llms.txt
> - 4.5: https://docs.nvidia.com/holoscan/sdk-user-guide/4-5/llms.txt
> - 4.4: https://docs.nvidia.com/holoscan/sdk-user-guide/4-4/llms.txt
> - 4.3: https://docs.nvidia.com/holoscan/sdk-user-guide/4-3/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sdk-user-guide/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::ArgumentSetter

> Class to set arguments for components.

Class to set arguments for components.

This class is used to set arguments for components (including [Operator](operator), [Condition](condition), and [Resource](resource)) from [Arg](arg) or [ArgList](arglist).

```cpp showLineNumbers={false}
#include <holoscan/argument_setter.hpp>
```

---

## Constructors

### ArgumentSetter \[#argumentsetter]

```cpp showLineNumbers={false}
holoscan::ArgumentSetter::ArgumentSetter()
```

---

## Methods

### get\_argument\_setter \[#getargumentsetter]

```cpp showLineNumbers={false}
SetterFunc & holoscan::ArgumentSetter::get_argument_setter(
    std::type_index index
)
```

Get the argument setter function object.

**Returns:** The reference to the SetterFunc object.

**Parameters**

**`index`** `std::type_index`

The type index of the parameter.

---

### add\_argument\_setter \[#addargumentsetter]

#### Add the SetterFunc for the type (with func)

inline

```cpp showLineNumbers={false}
template <typename typeT>
void holoscan::ArgumentSetter::add_argument_setter(
    SetterFunc func
)
```

Add the SetterFunc for the type.

**Template parameters**

**`typeT`** `typename`

TypeT The type of the parameter.

---

**Parameters**

**`func`** `SetterFunc`

The SetterFunc object.

---

#### Add the SetterFunc for the type (with func and index)

inline

```cpp showLineNumbers={false}
void holoscan::ArgumentSetter::add_argument_setter(
    std::type_index index,
    SetterFunc func
)
```

Add the SetterFunc for the type.

**Parameters**

**`index`** `std::type_index`

The type index of the parameter.

---

**`func`** `SetterFunc`

The SetterFunc object.

---

#### Add the SetterFunc for the type

```cpp showLineNumbers={false}
template <typename typeT>
void holoscan::ArgumentSetter::add_argument_setter()
```

Add the SetterFunc for the type.

**Template parameters**

**`typeT`** `typename`

The type of the parameter.

---

---

## Static methods

### get\_instance \[#getinstance]

```cpp showLineNumbers={false}
static ArgumentSetter & holoscan::ArgumentSetter::get_instance()
```

Get the instance object.

**Returns:** The reference to the `ArgumentSetter` instance.

### set\_param \[#setparam]

```cpp showLineNumbers={false}
static void holoscan::ArgumentSetter::set_param(
    ParameterWrapper &param_wrap,
    Arg &arg
)
```

Set the param object.

**Throws:** `std::runtime_error` if the parameter could not be set.

**Parameters**

**`param_wrap`** `ParameterWrapper &`

The [ParameterWrapper](parameterwrapper) object.

---

**`arg`** `Arg &`

The [Arg](arg) object to set.

---

### ensure\_type \[#ensuretype]

```cpp showLineNumbers={false}
template <typename typeT>
static void holoscan::ArgumentSetter::ensure_type()
```

Register the SetterFunc for the type.

**Template parameters**

**`typeT`** `typename`

The type of the parameter.

---

---

## Types

### Typedefs

| Name         | Definition                                        | Description                                             |
| ------------ | ------------------------------------------------- | ------------------------------------------------------- |
| `SetterFunc` | `std::function< bool(ParameterWrapper &, Arg &)>` | Function type for setting an argument to the parameter. |

---

## Member variables

| Name                          | Type                                                | Description                                  |
| ----------------------------- | --------------------------------------------------- | -------------------------------------------- |
| `none_argument_setter` static | `SetterFunc`                                        | Default SetterFunc for [Arg](arg).           |
| `function_map_`               | `std::unordered_map< std::type_index, SetterFunc >` | [Map](map) of type index to setter function. |