NVIDIA DeepStream SDK API Reference

6.4 Release
INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer > Class Template Reference

Detailed Description

template<typename Key, typename UniqBuffer>
class INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >

Template class for a map of buffer pools.

Template Parameters
KeyType of the map key.
UniqBufferType of the unique pointers to the buffers.

Definition at line 501 of file infer_utils.h.

Public Types

using SharedPool = SharedBufPool< UniqBuffer >
 
using RecylePtr = typename BufferPool< UniqBuffer >::RecylePtr
 

Public Member Functions

 MapBufferPool (const std::string &name)
 Construct the buffer pool map with a name. More...
 
virtual ~MapBufferPool ()
 Destructor. More...
 
bool setBuffer (const Key &key, UniqBuffer buf)
 Add a buffer to the pool map. More...
 
uint32_t getPoolSize (const Key &key)
 Get the size of a pool from the map. More...
 
RecylePtr acquireBuffer (const Key &key)
 Acquire a buffer from the selected pool. More...
 
void clear ()
 Remove all pools from the map. More...
 
 MapBufferPool (const MapBufferPool &other)=delete
 Disable copy operations. More...
 
MapBufferPooloperator= (const MapBufferPool &other)=delete
 

Member Typedef Documentation

◆ RecylePtr

template<typename Key , typename UniqBuffer >
using INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::RecylePtr = typename BufferPool<UniqBuffer>::RecylePtr

Definition at line 504 of file infer_utils.h.

◆ SharedPool

template<typename Key , typename UniqBuffer >
using INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::SharedPool = SharedBufPool<UniqBuffer>

Definition at line 503 of file infer_utils.h.

Constructor & Destructor Documentation

◆ MapBufferPool() [1/2]

template<typename Key , typename UniqBuffer >
INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::MapBufferPool ( const std::string &  name)
inline

Construct the buffer pool map with a name.

Definition at line 509 of file infer_utils.h.

◆ ~MapBufferPool()

template<typename Key , typename UniqBuffer >
virtual INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::~MapBufferPool ( )
inlinevirtual

Destructor.

Print a debug message of number of pools in the map.

Definition at line 513 of file infer_utils.h.

References InferDebug, and INFER_EXPORT_API::safeStr().

◆ MapBufferPool() [2/2]

template<typename Key , typename UniqBuffer >
INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::MapBufferPool ( const MapBufferPool< Key, UniqBuffer > &  other)
delete

Disable copy operations.

Member Function Documentation

◆ acquireBuffer()

template<typename Key , typename UniqBuffer >
RecylePtr INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::acquireBuffer ( const Key &  key)
inline

Acquire a buffer from the selected pool.

Parameters
keyMap key to identify the pool.
Returns
Unique pointer to the buffer with deleter function to return the buffer to the pool.

Definition at line 571 of file infer_utils.h.

References InferDebug, InferWarning, and INFER_EXPORT_API::safeStr().

◆ clear()

template<typename Key , typename UniqBuffer >
void INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::clear ( )
inline

Remove all pools from the map.

Definition at line 586 of file infer_utils.h.

References InferDebug, and INFER_EXPORT_API::safeStr().

◆ getPoolSize()

template<typename Key , typename UniqBuffer >
uint32_t INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::getPoolSize ( const Key &  key)
inline

Get the size of a pool from the map.

Parameters
keyMap key of the pool.
Returns
Number of buffers in the pool if found, 0 otherwise.

Definition at line 558 of file infer_utils.h.

◆ operator=()

template<typename Key , typename UniqBuffer >
MapBufferPool& INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::operator= ( const MapBufferPool< Key, UniqBuffer > &  other)
delete

◆ setBuffer()

template<typename Key , typename UniqBuffer >
bool INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::setBuffer ( const Key &  key,
UniqBuffer  buf 
)
inline

Add a buffer to the pool map.

This function adds a new buffer to the pool specified by the key. If the pool for the key is not found, a new one is created.

Parameters
keyMap key of the pool in the map.
bufUnique pointer to the buffer to be added.
Returns
Boolean error status. True if success.

Definition at line 536 of file infer_utils.h.

References InferDebug, and INFER_EXPORT_API::safeStr().


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