NVIDIA NvNeural SDK  2021.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::ZlibResourceDictionary Class Reference

Resource dictionary that decompresses payloads using Zlib. More...

#include <ZlibResourceDictionary.h>

Inheritance diagram for nvneural::ZlibResourceDictionary:
nvneural::refobj::RefObjectBase< refobj::Implements< IResourceDictionary > >

Public Types

using ByteVector = std::vector< std::uint8_t >
 Convenience typedef representing a vector of bytes.
 
using ResourceMap = std::map< IResourceDictionary::ResourceId, ByteVector >
 Convenience typedef representing an associative array mapping resource IDs to ByteVector buffers.
 

Public Member Functions

NeuralResult getResource (IResourceDictionary::ResourceId resourceId, const void **ppBufferOut, std::size_t *pBufferSizeOut) const noexcept
 Retrieves a buffer that was stored in this dictionary. More...
 
 ZlibResourceDictionary (const ResourceMap &resourcePairs)
 Creates a ZlibResourceDictionary allowing unpacking of the provided resource map. More...
 
- Public Member Functions inherited from nvneural::refobj::RefObjectBase< refobj::Implements< IResourceDictionary > >
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 dictionary that decompresses payloads using Zlib.

Should be paired with the ZlibResourceAggregator class to create the ResourceMap.

Constructor & Destructor Documentation

◆ ZlibResourceDictionary()

ZlibResourceDictionary::ZlibResourceDictionary ( const ResourceMap resourcePairs)
explicit

Creates a ZlibResourceDictionary allowing unpacking of the provided resource map.

Resources are decompressed at construction time to avoid frame rate hitches during runtime.

Parameters
resourcePairsMap of { resource ID, compressed-data } pairs

Member Function Documentation

◆ getResource()

NeuralResult ZlibResourceDictionary::getResource ( IResourceDictionary::ResourceId  resourceId,
const void **  ppBufferOut,
std::size_t *  pBufferSizeOut 
) const
noexcept

Retrieves a buffer that was stored in this dictionary.

Parameters
resourceIdHandle identifying the resource
ppBufferOutAddress of a const void* that will point to the buffer
pBufferSizeOutAddress of a size_t that will contain the buffer size in bytes

If the resource ID is invalid, neither ppBufferOut nor pBufferSizeOut will be updated.


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