NVIDIA DeepStream SDK API Reference

6.4 Release
INFER_EXPORT_API::QueueThread< Container > Class Template Reference

Detailed Description

template<typename Container>
class INFER_EXPORT_API::QueueThread< Container >

Template class for running the specified function on the queue items in a separate thread.

Template Parameters
ContainerThe container class for the queue, e.g. std::queue, std::list.

Definition at line 287 of file infer_utils.h.

Public Types

using Item = typename Container::value_type
 
using RunFunc = std::function< bool(Item)>
 

Public Member Functions

 QueueThread (RunFunc runFunc, const std::string &name)
 Create a new thread that runs the specified function over the queued items in a loop. More...
 
void setThreadName (const std::string &name)
 Set the internal (m_Name) name of the thread and system name using pthread_setname_np(). More...
 
 ~QueueThread ()
 Destructor. More...
 
void join ()
 
bool queueItem (Item item)
 Add an item to the queue for processing. More...
 

Member Typedef Documentation

◆ Item

template<typename Container >
using INFER_EXPORT_API::QueueThread< Container >::Item = typename Container::value_type

Definition at line 289 of file infer_utils.h.

◆ RunFunc

template<typename Container >
using INFER_EXPORT_API::QueueThread< Container >::RunFunc = std::function<bool(Item)>

Definition at line 290 of file infer_utils.h.

Constructor & Destructor Documentation

◆ QueueThread()

template<typename Container >
INFER_EXPORT_API::QueueThread< Container >::QueueThread ( RunFunc  runFunc,
const std::string &  name 
)
inline

Create a new thread that runs the specified function over the queued items in a loop.

Parameters
[in]runFuncThe processing function of the thread.
[in]nameName for the thread.

Definition at line 299 of file infer_utils.h.

References InferDebug.

◆ ~QueueThread()

template<typename Container >
INFER_EXPORT_API::QueueThread< Container >::~QueueThread ( )
inline

Destructor.

Send a wake up trigger to the queue, wait for the thread to join and clear the queue.

Definition at line 333 of file infer_utils.h.

Member Function Documentation

◆ join()

template<typename Container >
void INFER_EXPORT_API::QueueThread< Container >::join ( )
inline

Definition at line 334 of file infer_utils.h.

References InferDebug, and INFER_EXPORT_API::safeStr().

◆ queueItem()

template<typename Container >
bool INFER_EXPORT_API::QueueThread< Container >::queueItem ( Item  item)
inline

Add an item to the queue for processing.

Definition at line 345 of file infer_utils.h.

◆ setThreadName()

template<typename Container >
void INFER_EXPORT_API::QueueThread< Container >::setThreadName ( const std::string &  name)
inline

Set the internal (m_Name) name of the thread and system name using pthread_setname_np().

Definition at line 314 of file infer_utils.h.

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


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