> 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::ExtensionManager

> Class to manage extensions.

Class to manage extensions.

This class is a helper class to manage extensions.

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

---

## Constructors

### ExtensionManager \[#extensionmanager]

```cpp showLineNumbers={false}
holoscan::ExtensionManager::ExtensionManager(
    void *context
)
```

Construct a new `ExtensionManager` object.

**Parameters**

**`context`** `void *`

The context.

---

### Destructor \[#destructor]

### \~ExtensionManager

```cpp showLineNumbers={false}
virtual holoscan::ExtensionManager::~ExtensionManager() = default
```

Destroy the `ExtensionManager` object.

---

## Methods

### reset\_context \[#resetcontext]

```cpp showLineNumbers={false}
virtual void holoscan::ExtensionManager::reset_context(
    void *context
)
```

Reset the extension manager with the context.

**Parameters**

**`context`** `void *`

The context.

---

### refresh \[#refresh]

```cpp showLineNumbers={false}
virtual void holoscan::ExtensionManager::refresh()
```

Refresh the extension list.

Based on the current context, construct the internal extension list.

### load\_extension \[#loadextension]

```cpp showLineNumbers={false}
virtual bool holoscan::ExtensionManager::load_extension(
    const std::string &file_name,
    bool no_error_message = false,
    const std::string &search_path_envs = "HOLOSCAN_LIB_PATH"
)
```

Load an extension.

This method loads an extension and stores the extension handler so that it can be unloaded when the class is destroyed.

**Returns:** true if the extension is loaded successfully, false otherwise.

**Parameters**

**`file_name`** `const std::string &`

The file name of the extension (e.g. libmyextension.so).

---

**`no_error_message`** `bool` — default: false

If true, no error message will be printed if the extension is not found.

---

**`search_path_envs`** `const std::string &` — default: "HOLOSCAN\_LIB\_PATH"

The environment variable names that contains the search paths for the extension. The environment variable names are separated by a comma (,). (default: "HOLOSCAN\_LIB\_PATH").

---

### load\_extensions\_from\_yaml \[#loadextensionsfromyaml]

```cpp showLineNumbers={false}
virtual bool holoscan::ExtensionManager::load_extensions_from_yaml(
    const YAML::Node &node,
    bool no_error_message = false,
    const std::string &search_path_envs = "HOLOSCAN_LIB_PATH",
    const std::string &key = "extensions"
)
```

Load extensions from a yaml file.

The yaml file should contain a list of extension file names under the key "extensions".

For example:

**Returns:** true if the extension is loaded successfully, false otherwise.

**Parameters**

**`node`** `const YAML::Node &`

The yaml node.

---

**`no_error_message`** `bool` — default: false

If true, no error message will be printed if the extension is not found.

---

**`search_path_envs`** `const std::string &` — default: "HOLOSCAN\_LIB\_PATH"

The environment variable names that contains the search paths for the extension. The environment variable names are separated by a comma (,). (default: "HOLOSCAN\_LIB\_PATH").

---

**`key`** `const std::string &` — default: "extensions"

The key in the yaml node that contains the extension file names (default: "extensions").

---

**Example**

```cpp showLineNumbers={false}
extensions:
- /path/to/extension1.so
- /path/to/extension2.so
- /path/to/extension3.so
```

---

## Member variables

| Name       | Type     | Description  |
| ---------- | -------- | ------------ |
| `context_` | `void *` | The context. |