holoscan::ExtensionManager

Beta
View as Markdown

Class to manage extensions.

This class is a helper class to manage extensions.

#include <holoscan/extension_manager.hpp>

Constructors

ExtensionManager

holoscan::ExtensionManager::ExtensionManager(holoscan::ExtensionManager::ExtensionManager(
void *context
)

Construct a new ExtensionManager object.

Parameters

context
void *

The context.

Destructor

~ExtensionManager

virtual holoscan::ExtensionManager::~ExtensionManager() = defaultvirtual holoscan::ExtensionManager::~ExtensionManager() = default

Destroy the ExtensionManager object.


Methods

reset_context

virtual void holoscan::ExtensionManager::reset_context(
void *context
)

Reset the extension manager with the context.

Parameters

context
void *

The context.

refresh

virtual void holoscan::ExtensionManager::refresh()

Refresh the extension list.

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

load_extension

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
boolDefaults to false

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

search_path_envs
const std::string &Defaults to "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

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
boolDefaults to false

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

search_path_envs
const std::string &Defaults to "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 &Defaults to "extensions"

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

Example

extensions:
- /path/to/extension1.so
- /path/to/extension2.so
- /path/to/extension3.so

Member variables

NameTypeDescription
context_void *The context.