PluginRegistry interface class that contains all the methods user can use to interface with the registry object.
More...
#include <NvInferSafePlugin.h>
PluginRegistry interface class that contains all the methods user can use to interface with the registry object.
◆ ~ISafePluginRegistry()
| virtual nvinfer2::safe::ISafePluginRegistry::~ISafePluginRegistry |
( |
| ) |
|
|
protectedvirtualdefaultnoexcept |
◆ deregisterCreator()
Deregister a previously registered plugin creator.
- Precondition
- INIT API
Since there may be a desire to limit the number of plugins, this function provides a mechanism for removing plugin creators registered in TensorRT. The plugin creator that is specified by creator is removed from TensorRT and no longer tracked.
- Parameters
-
| creator | The plugin creator to deregister. |
- Returns
- Returns kSUCCESS if the plugin creator was successfully deregistered. Returns kINVALID_CONFIG if the plugin creator was not found in the registry or otherwise could not be deregistered.
- Allowed context for the API call
◆ getAllCreators()
Return all the registered plugin creators and the number of registered plugin creators.
- Precondition
- INIT API
- Parameters
-
| [out] | creators | The start address of an IPluginCreatorInterface* array of length numCreators if at least one plugin creator has been registered, or nullptr if there are no registered plugin creators. |
| [out] | numCreators | If the call completes successfully, the number of registered plugin creators (which will be an integer between 0 and 100 inclusive). |
- Returns
- Returns kSUCCESS if the call completes successfully and at least one plugin creator is registered. Returns kINVALID_ARGUMENT if numCreators or creators is a nullptr. Returns kUNSPECIFIED_ERROR if an unexpected error occurs.
- Allowed context for the API call
◆ getCreator()
Return plugin creator based on plugin name, version, and namespace associated with plugin during network creation.
- Precondition
- INIT API
- Warning
- The strings pluginName, pluginVersion, and pluginNamespace must be NULL terminated and have a length of 1024 bytes or less including the NULL terminator.
- Parameters
-
| [out] | creator | Pointer to the plugin creator pointer to be returned. |
| pluginName | The plugin name string. |
| pluginVersion | The plugin version string. |
| pluginNamespace | The plugin namespace (by default empty string). |
- Returns
- Returns kSUCCESS if a plugin creator corresponding to the passed name, version, and namespace can be found in the registry. Returns kINVALID_ARGUMENT if any of the input arguments is nullptr or exceeds the string length limit. Returns kINVALID_CONFIG if no plugin creator corresponding to the input arguments can be found in the registry or if a plugin creator can be found but its stored namespace attribute does not match the pluginNamespace.
- Allowed context for the API call
◆ getSafeRecorder()
Get the message recorder assigned to this interface.
- Precondition
- INIT API
Retrieves the assigned error recorder object for the given class. A default error recorder does not exist, so recorder parameter will be set to nullptr (pointer to nullptr) if setSafeRecorder has not been called, or an message recorder has not been inherited.
- Parameters
-
- Returns
- Returns kSUCCESS if the message recorder is successfully retrieved. Returns kINVALID_ARGUMENT if the recorder parameter is nullptr.
- See also
- setSafeRecorder()
- Allowed context for the API call
◆ registerCreator()
Register a plugin creator.
- Precondition
- INIT API
- Parameters
-
| creator | The plugin creator to be registered. |
| pluginNamespace | A NULL-terminated namespace string, which must be 1024 bytes or less including the NULL terminator. It must be identical with the result of calling ISafePluginCreatorV3One::getPluginNamespace() on the creator object. |
| recorder | The error recorder to register with this interface |
- Returns
- Returns kSUCCESS if the plugin creator is successfully registered. Returns kINVALID_ARGUMENT if the pluginNamespace string is a nullptr, exceeds the maximum length, or does not match the result of creator.getPluginNamespace(). Returns kINVALID_CONFIG if there have already been 100 plugin creators registered or another plugin creator with the same combination of plugin name, version, and namespace has already been registered.
- Allowed context for the API call
- Thread-safe: Yes; calls to this method will be synchronized by a mutex.
◆ setSafeRecorder()
Set the message recorder for this interface.
- Precondition
- INIT API
Assigns the message recorder to this interface. The message recorder will track all errors during execution. This function will call incRefCount of the registered message recorder at least once.
- Note
- Since the pluginRegistry is a global static object, the recorder used for the registry must have an equal or longer life time than the registry. I.e., when the process terminates the registry needs to hold a global static error recorder.
- Parameters
-
| recorder | The error recorder to register with this interface, or nullptr to deregister the current recorder. |
- Returns
- Returns kSUCCESS if the message recorder is successfully registered or deregistered. Returns kINVALID_ARGUMENT if the recorder is set to nullptr and the recorder has been registered.
- See also
- getSafeRecorder()
- Allowed context for the API call
The documentation for this class was generated from the following file: