MultiThreadedVectorProcessor< T > Class Template Referenceabstract

#include <ThreadPool.h>

Public Member Functions

 MultiThreadedVectorProcessor (const std::vector< T * > &v)
 
virtual ~MultiThreadedVectorProcessor ()
 
void Start (size_t numThreads)
 
void Stop ()
 
void ProcessVectorContents ()
 
void Run ()
 
virtual void Work (T *)=0
 

Protected Attributes

std::atomic< size_t > m_NextIdx
 
std::atomic< size_t > m_NumComplete
 
const std::vector< T * > & m_Vector
 
bool m_Stop
 
std::mutex m_Mutex
 
std::vector< std::thread > m_Threads
 

Constructor & Destructor Documentation

◆ MultiThreadedVectorProcessor()

template<typename T >
MultiThreadedVectorProcessor< T >::MultiThreadedVectorProcessor ( const std::vector< T * > &  v)
inline

◆ ~MultiThreadedVectorProcessor()

template<typename T >
virtual MultiThreadedVectorProcessor< T >::~MultiThreadedVectorProcessor ( )
inlinevirtual

Member Function Documentation

◆ ProcessVectorContents()

template<typename T >
void MultiThreadedVectorProcessor< T >::ProcessVectorContents ( )
inline

◆ Run()

template<typename T >
void MultiThreadedVectorProcessor< T >::Run ( )
inline

◆ Start()

template<typename T >
void MultiThreadedVectorProcessor< T >::Start ( size_t  numThreads)
inline

◆ Stop()

template<typename T >
void MultiThreadedVectorProcessor< T >::Stop ( )
inline

◆ Work()

template<typename T >
virtual void MultiThreadedVectorProcessor< T >::Work ( T *  )
pure virtual

Member Data Documentation

◆ m_Mutex

template<typename T >
std::mutex MultiThreadedVectorProcessor< T >::m_Mutex
protected

◆ m_NextIdx

template<typename T >
std::atomic<size_t> MultiThreadedVectorProcessor< T >::m_NextIdx
protected

◆ m_NumComplete

template<typename T >
std::atomic<size_t> MultiThreadedVectorProcessor< T >::m_NumComplete
protected

◆ m_Stop

template<typename T >
bool MultiThreadedVectorProcessor< T >::m_Stop
protected

◆ m_Threads

template<typename T >
std::vector<std::thread> MultiThreadedVectorProcessor< T >::m_Threads
protected

◆ m_Vector

template<typename T >
const std::vector<T*>& MultiThreadedVectorProcessor< T >::m_Vector
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.