Standard IPluginLoader implementation that uses dynamic linking (dlopen/LoadLibrary) to find NvNeural IPlugin objects.
More...
#include <DynamicPluginLoader.h>
Standard IPluginLoader implementation that uses dynamic linking (dlopen/LoadLibrary) to find NvNeural IPlugin objects.
◆ allowIncompatiblePlugins()
void DynamicPluginLoader::allowIncompatiblePlugins |
( |
| ) |
|
|
noexcept |
Override the current compatibility checks to allow the loading of out-of-date plugins.
Not recommended for general use.
◆ getPluginByIndex()
IPlugin * DynamicPluginLoader::getPluginByIndex |
( |
std::size_t |
pluginIndex | ) |
const |
|
noexcept |
Returns a particular IPlugin object by index, or nullptr if the index is out of range.
- Parameters
-
pluginIndex | Plugin index; must be less than pluginCount |
This is a query function and does not increment the reference count of the IPlugin.
◆ getPluginPath()
NeuralResult DynamicPluginLoader::getPluginPath |
( |
const IPlugin * |
pPlugin, |
|
|
const char ** |
ppPluginPathOut |
|
) |
| const |
|
noexcept |
Returns the file path to a particular plugin object.
- Parameters
-
pPlugin | Plugin to query |
ppPluginPathOut | Variable receiving a pointer to pPlugin's location on disk. |
The returned plugin path is valid until the plugin is released or the IPluginLoader destroyed.
◆ loadDirectory()
NeuralResult DynamicPluginLoader::loadDirectory |
( |
const char * |
pPathname, |
|
|
std::uint32_t * |
pNumberLoadedOut |
|
) |
| |
|
noexcept |
Loads all compatible plugins from the provided directory.
- Parameters
-
pPathname | Directory to load |
pNumberLoadedOut | Optional pointer receiving the number of plugins loaded |
◆ loadLibrary()
NeuralResult DynamicPluginLoader::loadLibrary |
( |
const char * |
pFilename, |
|
|
IPlugin ** |
ppPluginOut |
|
) |
| |
|
noexcept |
Loads a plugin from a specific shared library file.
- Parameters
-
pFilename | Library filename to load |
ppPluginOut | Optional pointer receiving a new reference to the loaded plugin |
- Note
- If ppPluginOut is not null, the resulting reference should be released before calling releasePlugin or destroying the plugin loader.
◆ pluginCount()
std::size_t DynamicPluginLoader::pluginCount |
( |
| ) |
const |
|
noexcept |
Returns the number of plugins tracked by this object.
◆ releaseAllPlugins()
Releases all plugins tracked by this object.
Equivalent to calling releasePlugin on all return values from getPluginByIndex.
◆ releasePlugin()
Releases the internal reference to a given plugin object and frees the library.
The plugin and objects created by that plugin should not be referenced after this call.
The documentation for this class was generated from the following files:
- Host/Inc/DynamicPluginLoader.h
- Host/Src/DynamicPluginLoader_Common.cpp
- Host/Src/DynamicPluginLoader_Linux.cpp
- Host/Src/DynamicPluginLoader_Windows.cpp