A class that loads data in a pool of threads.
Any data that needs to be processed in a thread is required to implement the IYIRunOnThread interface. Internally, it instantiates a thread and configures it with the data.
#include <thread/YiLoadThreadManager.h>

Public Member Functions | |
| CYILoadThreadManager (int32_t nThreads) | |
| ~CYILoadThreadManager () | |
| void | StopManager () |
| void | Load (std::unique_ptr< IYIRunOnThread > pResource) |
| void | Unload (const IYIRunOnThread *pResource) |
Public Member Functions inherited from CYIThread | |
| CYIThread (const CYIString &name=CYIString(), YI_PRIORITY ePriority=YI_PRIORITY_DEFAULT, uint32_t uStackSize=DEFAULT_STACK_SIZE) | |
| virtual | ~CYIThread () |
| bool | StartThread (YI_START_TYPE eStartType=BLOCK_UNTIL_STARTED) |
| void | Terminate () |
| void | EnableTermination () |
| void | DisableTermination () |
| bool | IsTerminationEnabled () |
| bool | Join () |
| bool | Join (uint32_t uTimeoutMs) |
| bool | IsRunning () const |
| CYIThreadHandle | GetThreadId () const |
| void | SetName (const CYIString &name) |
| const CYIString & | GetName () const |
| void | SetPriority (YI_PRIORITY priority) |
| YI_PRIORITY | GetPriority () const |
| bool | AddThreadListener (Listener *pListener) |
| bool | RemoveThreadListener (Listener *pListener) |
| bool | SetStackSize (uint32_t uStackSize) |
| uint32_t | GetStackSize () const |
Additional Inherited Members | |
Public Types inherited from CYIThread | |
| enum | YI_START_TYPE { BLOCK_UNTIL_STARTED = true, NON_BLOCKING = false } |
Static Public Member Functions inherited from CYIThread | |
| static CYIThreadHandle | GetCurrentThreadId () |
| static const CYIThreadHandle & | GetUIThreadId () |
| static int32_t | GetOSIdealThreadCount () |
| static void | Sleep (uint32_t uMillis) |
| static void | YieldCurrentThread () |
| static void | ReportDefaults () |
Static Public Attributes inherited from CYIThread | |
| static const uint32_t | DEFAULT_STACK_SIZE = 128 * 1024 |
Protected Member Functions inherited from CYIThread | |
| bool | IsTerminationRequested () const |
| CYILoadThreadManager::CYILoadThreadManager | ( | int32_t | nThreads | ) |
Initializes a pool of nThreads threads.
| CYILoadThreadManager::~CYILoadThreadManager | ( | ) |
| void CYILoadThreadManager::Load | ( | std::unique_ptr< IYIRunOnThread > | pResource | ) |
Loads pResource in a thread available in the pool.
| void CYILoadThreadManager::StopManager | ( | ) |
| void CYILoadThreadManager::Unload | ( | const IYIRunOnThread * | pResource | ) |
Removes pResource from the manager.