OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::ThreadManager< TDatums, TWorker, TQueue > Class Template Reference

#include <threadManager.hpp>

Public Member Functions

 ThreadManager (const ThreadManagerMode threadManagerMode=ThreadManagerMode::Synchronous)
 
virtual ~ThreadManager ()
 
void setDefaultMaxSizeQueues (const long long defaultMaxSizeQueues=-1)
 
void add (const unsigned long long threadId, const std::vector< TWorker > &tWorkers, const unsigned long long queueInId, const unsigned long long queueOutId)
 
void add (const unsigned long long threadId, const TWorker &tWorker, const unsigned long long queueInId, const unsigned long long queueOutId)
 
void reset ()
 
void exec ()
 
void start ()
 
void stop ()
 
std::shared_ptr< std::atomic< bool > > getIsRunningSharedPtr ()
 
bool isRunning () const
 
bool tryEmplace (TDatums &tDatums)
 
bool waitAndEmplace (TDatums &tDatums)
 
bool tryPush (const TDatums &tDatums)
 
bool waitAndPush (const TDatums &tDatums)
 
bool tryPop (TDatums &tDatums)
 
bool waitAndPop (TDatums &tDatums)
 

Detailed Description

template<typename TDatums, typename TWorker = std::shared_ptr<Worker<TDatums>>, typename TQueue = Queue<TDatums>>
class op::ThreadManager< TDatums, TWorker, TQueue >

Definition at line 16 of file threadManager.hpp.

Constructor & Destructor Documentation

◆ ThreadManager()

template<typename TDatums , typename TWorker , typename TQueue >
op::ThreadManager< TDatums, TWorker, TQueue >::ThreadManager ( const ThreadManagerMode  threadManagerMode = ThreadManagerMode::Synchronous)
explicit

Definition at line 108 of file threadManager.hpp.

◆ ~ThreadManager()

template<typename TDatums , typename TWorker , typename TQueue >
op::ThreadManager< TDatums, TWorker, TQueue >::~ThreadManager
virtual

Definition at line 116 of file threadManager.hpp.

Member Function Documentation

◆ add() [1/2]

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::add ( const unsigned long long  threadId,
const std::vector< TWorker > &  tWorkers,
const unsigned long long  queueInId,
const unsigned long long  queueOutId 
)

Definition at line 134 of file threadManager.hpp.

◆ add() [2/2]

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::add ( const unsigned long long  threadId,
const TWorker &  tWorker,
const unsigned long long  queueInId,
const unsigned long long  queueOutId 
)

Definition at line 150 of file threadManager.hpp.

◆ exec()

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::exec

Definition at line 181 of file threadManager.hpp.

◆ getIsRunningSharedPtr()

template<typename TDatums , typename TWorker = std::shared_ptr<Worker<TDatums>>, typename TQueue = Queue<TDatums>>
std::shared_ptr<std::atomic<bool> > op::ThreadManager< TDatums, TWorker, TQueue >::getIsRunningSharedPtr ( )
inline

Definition at line 49 of file threadManager.hpp.

◆ isRunning()

template<typename TDatums , typename TWorker = std::shared_ptr<Worker<TDatums>>, typename TQueue = Queue<TDatums>>
bool op::ThreadManager< TDatums, TWorker, TQueue >::isRunning ( ) const
inline

Definition at line 54 of file threadManager.hpp.

◆ reset()

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::reset

Definition at line 166 of file threadManager.hpp.

◆ setDefaultMaxSizeQueues()

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::setDefaultMaxSizeQueues ( const long long  defaultMaxSizeQueues = -1)

It sets the maximum number of elements in the queue. For maximum speed, set to a very large number, but the trade-off would be:

  • Latency will hugely increase.
  • The program might go out of RAM memory (so the computer might freeze). For minimum latency while keeping an optimal speed, set to -1, that will automatically detect the ideal number based on how many elements are connected to that queue.
    Parameters
    defaultMaxSizeQueueslong long element with the maximum number of elements on the queue.

Definition at line 121 of file threadManager.hpp.

◆ start()

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::start

Definition at line 207 of file threadManager.hpp.

◆ stop()

template<typename TDatums , typename TWorker , typename TQueue >
void op::ThreadManager< TDatums, TWorker, TQueue >::stop

Definition at line 226 of file threadManager.hpp.

◆ tryEmplace()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::tryEmplace ( TDatums &  tDatums)

Definition at line 248 of file threadManager.hpp.

◆ tryPop()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::tryPop ( TDatums &  tDatums)

Definition at line 324 of file threadManager.hpp.

◆ tryPush()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::tryPush ( const TDatums &  tDatums)

Definition at line 286 of file threadManager.hpp.

◆ waitAndEmplace()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::waitAndEmplace ( TDatums &  tDatums)

Definition at line 267 of file threadManager.hpp.

◆ waitAndPop()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::waitAndPop ( TDatums &  tDatums)

Definition at line 343 of file threadManager.hpp.

◆ waitAndPush()

template<typename TDatums , typename TWorker , typename TQueue >
bool op::ThreadManager< TDatums, TWorker, TQueue >::waitAndPush ( const TDatums &  tDatums)

Definition at line 305 of file threadManager.hpp.


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