NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::ZlibResourceAggregator Class Reference

Resource aggregator that compresses payloads using Zlib. More...

#include <ZlibResourceAggregator.h>

Inheritance diagram for nvneural::ZlibResourceAggregator:
nvneural::refobj::RefObjectBase< refobj::Implements< IResourceAggregator > >

Public Member Functions

NeuralResult addResource (IResourceAggregator::ResourceId *pResourceIdOut, const void *pBuffer, std::uint32_t bufferBytes) noexcept
 Adds a resource to the dictionary, avoiding duplicates. More...
 
NeuralResult finalize () noexcept
 Finalizes the resource collection, allowing for compression and serialization to take place. More...
 
const void * resourceBufferByIndex (std::size_t resourceIndex) const noexcept
 Returns a pointer to the Nth finalized resource buffer in the object. More...
 
std::size_t resourceBufferSizeByIndex (std::size_t resourceIndex) const noexcept
 Returns the byte count associated with the Nth finalized resource buffer in the object. More...
 
IResourceAggregator::ResourceId resourceIdByIndex (std::size_t resourceIndex) const noexcept
 Returns the Nth resource ID in the object. More...
 
std::size_t resourceIdCount () const noexcept
 Returns the number of finalized resources in the object. More...
 
- Public Member Functions inherited from nvneural::refobj::RefObjectBase< refobj::Implements< IResourceAggregator > >
IRefObject::RefCount addRef () const noexcept
 Increment the object's reference count. More...
 
const void * queryInterface (IRefObject::TypeId interfaceId) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void * queryInterface (IRefObject::TypeId interfaceId) noexcept
 Retrieves a new object interface pointer. More...
 
 RefObjectBase ()
 Default constructor. Logs object creation.
 
IRefObject::RefCount release () const noexcept
 Decrements the object's reference count and destroys the object if the reference count reaches zero. More...
 

Detailed Description

Resource aggregator that compresses payloads using Zlib.

Pair this class with ZlibResourceDictionary to unpack resources in generated code.

Member Function Documentation

◆ addResource()

NeuralResult ZlibResourceAggregator::addResource ( IResourceAggregator::ResourceId pResourceIdOut,
const void *  pBuffer,
std::uint32_t  bufferBytes 
)
noexcept

Adds a resource to the dictionary, avoiding duplicates.

It is an error to add resources after finalize has been called.

Parameters
pResourceIdOutVariable receiving the stored resource ID
pBufferPointer to the resource
bufferBytesSize of the buffer in bytes

◆ finalize()

NeuralResult ZlibResourceAggregator::finalize ( )
noexcept

Finalizes the resource collection, allowing for compression and serialization to take place.

◆ resourceBufferByIndex()

const void * ZlibResourceAggregator::resourceBufferByIndex ( std::size_t  resourceIndex) const
noexcept

Returns a pointer to the Nth finalized resource buffer in the object.

Parameters
resourceIndexIndex value in the range [0, resourceIdCount())

◆ resourceBufferSizeByIndex()

size_t ZlibResourceAggregator::resourceBufferSizeByIndex ( std::size_t  resourceIndex) const
noexcept

Returns the byte count associated with the Nth finalized resource buffer in the object.

Parameters
resourceIndexIndex value in the range [0, resourceIdCount())

◆ resourceIdByIndex()

ZlibResourceAggregator::ResourceId ZlibResourceAggregator::resourceIdByIndex ( std::size_t  resourceIndex) const
noexcept

Returns the Nth resource ID in the object.

Parameters
resourceIndexIndex value in the range [0, resourceIdCount())

◆ resourceIdCount()

size_t ZlibResourceAggregator::resourceIdCount ( ) const
noexcept

Returns the number of finalized resources in the object.


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