|
Public Member Functions |
bool | StartThreads (int numThreads, int stackSize) |
void | StopThreads (void) |
| Stops all threads.
|
void | AddInput (OutputType(*workerThreadCallback)(InputType, bool *returnOutput), InputType inputData) |
bool | HasOutput (void) |
bool | HasOutputFast (void) |
OutputType | GetOutput (void) |
void | Clear (void) |
| Clears internal buffers.
|
void | LockInput (void) |
void | UnlockInput (void) |
| Unlock the input buffer after you are done with the functions InputSize, GetInputAtIndex, and RemoveInputAtIndex.
|
unsigned | InputSize (void) |
| Length of the input queue.
|
InputType | GetInputAtIndex (unsigned index) |
| Get the input at a specified index.
|
void | RemoveInputAtIndex (unsigned index) |
| Remove input from a specific index. This does NOT do memory deallocation - it only removes the item from the queue.
|
void | LockOutput (void) |
void | UnlockOutput (void) |
| Unlock the output buffer after you are done with the functions OutputSize, GetOutputAtIndex, and RemoveOutputAtIndex.
|
unsigned | OutputSize (void) |
| Length of the output queue.
|
OutputType | GetOutputAtIndex (unsigned index) |
| Get the output at a specified index.
|
void | RemoveOutputAtIndex (unsigned index) |
| Remove output from a specific index. This does NOT do memory deallocation - it only removes the item from the queue.
|
void | ClearInput (void) |
| Removes all items from the input queue.
|
void | ClearOutput (void) |
| Removes all items from the output queue.
|
Protected Attributes |
SimpleMutex | inputQueueMutex |
SimpleMutex | outputQueueMutex |
DataStructures::Queue< OutputType(*)(InputType, bool *returnOutput)> | inputFunctionQueue |
DataStructures::Queue< InputType > | inputDataQueue |
DataStructures::Queue< OutputType > | outputQueue |
bool | threadsRunning |
int | numThreadsRunning |
SimpleMutex | numThreadsRunningMutex |
Friends |
template<class InputType, class OutputType> |
void * | WorkerThread (void *arguments) |