Platform-agnostic plugin loader interface.
More...
#include <nvneural/PluginTypes.h>
|
using | RefCount = std::uint32_t |
| Typedef used to track the number of active references to an object.
|
|
using | TypeId = std::uint64_t |
| Every interface must define a unique TypeId. This should be randomized.
|
|
virtual | ~IRefObject ()=default |
| A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
|
|
Platform-agnostic plugin loader interface.
◆ allowIncompatiblePlugins()
virtual void nvneural::IPluginLoader::allowIncompatiblePlugins |
( |
| ) |
|
|
pure virtualnoexcept |
Override the current compatibility checks to allow the loading of out-of-date plugins.
Not recommended for general use.
◆ getPluginByIndex()
virtual IPlugin* nvneural::IPluginLoader::getPluginByIndex |
( |
std::size_t |
pluginIndex | ) |
const |
|
pure virtualnoexcept |
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()
virtual NeuralResult nvneural::IPluginLoader::getPluginPath |
( |
const IPlugin * |
pPlugin, |
|
|
const char ** |
ppPluginPathOut |
|
) |
| const |
|
pure virtualnoexcept |
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()
virtual NeuralResult nvneural::IPluginLoader::loadDirectory |
( |
const char * |
pPathname, |
|
|
std::uint32_t * |
pNumberLoadedOut |
|
) |
| |
|
pure virtualnoexcept |
Loads all compatible plugins from the provided directory.
- Parameters
-
pPathname | Directory to load |
pNumberLoadedOut | Optional pointer receiving the number of plugins loaded |
◆ loadLibrary()
virtual NeuralResult nvneural::IPluginLoader::loadLibrary |
( |
const char * |
pFilename, |
|
|
IPlugin ** |
ppPluginOut |
|
) |
| |
|
pure virtualnoexcept |
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.
◆ releaseAllPlugins()
virtual NeuralResult nvneural::IPluginLoader::releaseAllPlugins |
( |
| ) |
|
|
pure virtualnoexcept |
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 file: