TensorRT 10.16.1
nvinfer2::safe::ISafePluginRegistry Class Referenceabstract

PluginRegistry interface class that contains all the methods user can use to interface with the registry object. More...

#include <NvInferSafePlugin.h>

Public Member Functions

virtual ErrorCode registerCreator (IPluginCreatorInterface &creator, AsciiChar const *const pluginNamespace, ISafeRecorder &recorder) noexcept=0
 Register a plugin creator. More...
 
virtual ErrorCode getAllCreators (IPluginCreatorInterface *const *&creators, int32_t &numCreators) const noexcept=0
 Return all the registered plugin creators and the number of registered plugin creators. More...
 
virtual ErrorCode getCreator (IPluginCreatorInterface *&creator, AsciiChar const *const pluginName, AsciiChar const *const pluginVersion, AsciiChar const *const pluginNamespace="") noexcept=0
 Return plugin creator based on plugin name, version, and namespace associated with plugin during network creation. More...
 
virtual ErrorCode setSafeRecorder (ISafeRecorder &recorder) noexcept=0
 Set the message recorder for this interface. More...
 
virtual ErrorCode getSafeRecorder (ISafeRecorder *&recorder) const noexcept=0
 Get the message recorder assigned to this interface. More...
 
virtual ErrorCode deregisterCreator (IPluginCreatorInterface const &creator) noexcept=0
 Deregister a previously registered plugin creator. More...
 

Protected Member Functions

virtual ~ISafePluginRegistry () noexcept=default
 

Detailed Description

PluginRegistry interface class that contains all the methods user can use to interface with the registry object.

Constructor & Destructor Documentation

◆ ~ISafePluginRegistry()

virtual nvinfer2::safe::ISafePluginRegistry::~ISafePluginRegistry ( )
protectedvirtualdefaultnoexcept

Member Function Documentation

◆ deregisterCreator()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::deregisterCreator ( IPluginCreatorInterface const &  creator)
pure virtualnoexcept

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
creatorThe 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
    • Thread-safe: Yes

◆ getAllCreators()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::getAllCreators ( IPluginCreatorInterface *const *&  creators,
int32_t &  numCreators 
) const
pure virtualnoexcept

Return all the registered plugin creators and the number of registered plugin creators.

Precondition
INIT API
Parameters
[out]creatorsThe 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]numCreatorsIf 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
    • Thread-safe: No

◆ getCreator()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::getCreator ( IPluginCreatorInterface *&  creator,
AsciiChar const *const  pluginName,
AsciiChar const *const  pluginVersion,
AsciiChar const *const  pluginNamespace = "" 
)
pure virtualnoexcept

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]creatorPointer to the plugin creator pointer to be returned.
pluginNameThe plugin name string.
pluginVersionThe plugin version string.
pluginNamespaceThe 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
    • Thread-safe: Yes

◆ getSafeRecorder()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::getSafeRecorder ( ISafeRecorder *&  recorder) const
pure virtualnoexcept

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
[out]recorderPointer to the ISafeRecorder object to be returned.
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
    • Thread-safe: Yes

◆ registerCreator()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::registerCreator ( IPluginCreatorInterface creator,
AsciiChar const *const  pluginNamespace,
ISafeRecorder recorder 
)
pure virtualnoexcept

Register a plugin creator.

Precondition
INIT API
Parameters
creatorThe plugin creator to be registered.
pluginNamespaceA 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.
recorderThe 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()

virtual ErrorCode nvinfer2::safe::ISafePluginRegistry::setSafeRecorder ( ISafeRecorder recorder)
pure virtualnoexcept

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
recorderThe 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
    • Thread-safe: No

The documentation for this class was generated from the following file:

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact