New plugin creation in TensorRT

In the plugin documentation here, adding a plugin layer to a network with plugin name set to pluginName and version set to pluginVersion, we need to do the following.

//Use the extern function getPluginRegistry to access the global TensorRT Plugin Registry 

auto creator = getPluginRegistry()->getPluginCreator(pluginName, pluginVersion); 
const PluginFieldCollection* pluginFC = creator->getFieldNames(); 
//populate the field parameters (say layerFields) for the plugin layer 
PluginFieldCollection *pluginData = parseAndFillFields(pluginFC, layerFields); 
//create the plugin object using the layerName and the plugin meta data 
IPluginV2 *pluginObj = creator->createPlugin(layerName, pluginData); 
//add the plugin to the TensorRT network using the network API 
auto layer = network.addPluginV2(&inputs[0], int(inputs.size()), pluginObj); 
… (build rest of the network and serialize engine) pluginObj->destroy()
 // Destroy the plugin object … (destroy network, engine, builder) …
 (free allocated pluginData)

When looked at the sample sampleUffPluginV2Ext, I didn’t see all these implementation.
I am quite confused, how UffPoolPluginV2 is added into the network during SampleUffPluginV2Ext's build process?

Hi @edit_or,
Did you check the below link
https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#example4_add_custlay_int8

Thanks!