NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::IPluginLoader Class Referenceabstract

Platform-agnostic plugin loader interface. More...

#include <nvneural/PluginTypes.h>

Inheritance diagram for nvneural::IPluginLoader:
nvneural::IRefObject

Public Member Functions

virtual void allowIncompatiblePlugins () noexcept=0
 Override the current compatibility checks to allow the loading of out-of-date plugins. More...
 
virtual IPlugingetPluginByIndex (std::size_t pluginIndex) const noexcept=0
 Returns a particular IPlugin object by index, or nullptr if the index is out of range. More...
 
virtual NeuralResult getPluginPath (const IPlugin *pPlugin, const char **ppPluginPathOut) const noexcept=0
 Returns the file path to a particular plugin object. More...
 
virtual NeuralResult loadDirectory (const char *pPathname, std::uint32_t *pNumberLoadedOut) noexcept=0
 Loads all compatible plugins from the provided directory. More...
 
virtual NeuralResult loadLibrary (const char *pFilename, IPlugin **ppPluginOut) noexcept=0
 Loads a plugin from a specific shared library file. More...
 
virtual std::size_t pluginCount () const noexcept=0
 Returns the number of plugins tracked by this object.
 
virtual NeuralResult releaseAllPlugins () noexcept=0
 Releases all plugins tracked by this object. More...
 
virtual NeuralResult releasePlugin (IPlugin *pPlugin) noexcept=0
 Releases the internal reference to a given plugin object and frees the library. More...
 
- Public Member Functions inherited from nvneural::IRefObject
virtual RefCount addRef () const noexcept=0
 Increments the object's reference count. More...
 
virtual const void * queryInterface (TypeId interface) const noexcept=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual void * queryInterface (TypeId interface) noexcept=0
 Retrieves a new object interface pointer. More...
 
virtual RefCount release () const noexcept=0
 Decrements the object's reference count and destroy the object if the reference count reaches zero. More...
 

Static Public Attributes

static const IRefObject::TypeId typeID = 0x8c3c1cd6b49fa3eaul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IRefObject
static const TypeId typeID = 0x14ecc3f9de638e1dul
 Interface TypeId for InterfaceOf purposes.
 

Additional Inherited Members

- Public Types inherited from nvneural::IRefObject
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.
 
- Protected Member Functions inherited from nvneural::IRefObject
virtual ~IRefObject ()=default
 A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
 

Detailed Description

Platform-agnostic plugin loader interface.

Member Function Documentation

◆ 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
pluginIndexPlugin 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
pPluginPlugin to query
ppPluginPathOutVariable 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
pPathnameDirectory to load
pNumberLoadedOutOptional 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
pFilenameLibrary filename to load
ppPluginOutOptional 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()

virtual NeuralResult nvneural::IPluginLoader::releasePlugin ( IPlugin pPlugin)
pure virtualnoexcept

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: