Work Manager class (interface), it will work like a thread pool.
More...
#include <WorkManager.h>
Work Manager class (interface), it will work like a thread pool.
virtual int esnlib::WorkManager::Abort |
( |
| ) |
|
|
pure virtual |
Force to stop anything
- Returns
- Current state of the work manager
virtual int esnlib::WorkManager::AddWorkTask |
( |
WorkPtr |
work, |
|
|
BufferPtr |
workdata |
|
) |
| |
|
pure virtual |
Add a new work task
- Parameters
-
work | The work object, which will provide the callback function for the threads |
workdata | The working data for the task |
- Returns
- The total number of the tasks
virtual int esnlib::WorkManager::GetState |
( |
| ) |
|
|
pure virtual |
Get current state of the work manager
- Returns
- Current state of the work manager
virtual int esnlib::WorkManager::GetTaskCount |
( |
| ) |
|
|
pure virtual |
Get total number of the tasks
- Returns
- The total number of the tasks
virtual WorkPtr esnlib::WorkManager::GetWork |
( |
int |
key | ) |
|
|
pure virtual |
Get a work object by an integer key
- Parameters
-
- Returns
- The pointer of the work object
virtual WorkPtr esnlib::WorkManager::GetWork |
( |
const std::string & |
key | ) |
|
|
pure virtual |
Get a work object by a string key
- Parameters
-
- Returns
- The pointer of the work object
virtual int esnlib::WorkManager::GetWorkerCount |
( |
| ) |
|
|
pure virtual |
Get total number of the workers(threads)
- Returns
- The total number of the workers(threads)
virtual int esnlib::WorkManager::PutWork |
( |
int |
key, |
|
|
WorkPtr |
work |
|
) |
| |
|
pure virtual |
Add a work object with an integer key
- Parameters
-
key | The integer key |
work | The work object, which will provide the callback function for the threads |
- Returns
- The total number of the works mapped by integer keys
virtual int esnlib::WorkManager::PutWork |
( |
const std::string & |
key, |
|
|
WorkPtr |
work |
|
) |
| |
|
pure virtual |
Add a work object with a string key
- Parameters
-
key | The string key |
work | The work object, which will provide the callback function for the threads |
- Returns
- The total number of the works mapped by string keys
virtual void esnlib::WorkManager::SetBufferManager |
( |
BufferManagerPtr |
manager | ) |
|
|
pure virtual |
Set Buffer Manager (memory pool)
- Parameters
-
manager | The pointer of the buffer manager |
virtual int esnlib::WorkManager::Stop |
( |
| ) |
|
|
pure virtual |
Stop running gently
- Returns
- Current state of the work manager
The documentation for this class was generated from the following file: