#include <MultiThreadedAlgorithm.h>

Public Types | |
| enum | ReportTypeEnum { THREAD_NO_REPORT = 0x0, THREAD_PROGRESS = 0x1, THREAD_ERROR = 0x2, THREAD_COMPLETE = 0x4, THREAD_WORK = 0x8 } |
| typedef EnumWrapper < ReportTypeEnum > | ReportType |
Public Member Functions | |
| MultiThreadReporter (int threadCount, Result *pResult, BMutex &mutexA, BThreadSignal &signalA, BMutex &mutexB, BThreadSignal &signalB) | |
| virtual | ~MultiThreadReporter () |
| MultiThreadReporter (MultiThreadReporter &reporter) | |
| Result | reportProgress (int threadIndex, int percentDone) |
| Result | reportCompletion (int threadIndex) |
| Result | reportError (std::string errorText) |
| int | getProgress () const |
| int | getProgress (int threadIndex) const |
| std::string | getErrorText () const |
| void | runInMainThread (ThreadCommand &command) |
| void | setReportType (ReportType type) |
| unsigned int | getReportType () const |
| ThreadCommand * | getThreadCommand () |
Definition at line 132 of file MultiThreadedAlgorithm.h.
| typedef EnumWrapper<ReportTypeEnum> mta::MultiThreadReporter::ReportType |
The EnumWrapper contains a given enum value and provides a isValid() method which returns true if the contained enum value is valid.
Please see How To Use EnumWrapper for more information. The wrapped enum values are MultiThreadReporter::ReportTypeEnum.
Definition at line 150 of file MultiThreadedAlgorithm.h.
| mta::MultiThreadReporter::MultiThreadReporter | ( | int | threadCount, | |
| Result * | pResult, | |||
| BMutex & | mutexA, | |||
| BThreadSignal & | signalA, | |||
| BMutex & | mutexB, | |||
| BThreadSignal & | signalB | |||
| ) |
Constructor.
| threadCount | The number of threads to executre. | |
| pResult | The result of execution will be stored here. | |
| mutexA | The first mutex used to coordinate the threads. | |
| signalA | The first signal used to coordinate the threads. | |
| mutexB | The second mutex used to coordinate the threads. | |
| signalB | The second signal used to coordinate the threads. |
| virtual mta::MultiThreadReporter::~MultiThreadReporter | ( | ) | [virtual] |
| mta::MultiThreadReporter::MultiThreadReporter | ( | MultiThreadReporter & | reporter | ) |
Copy constructor.
| reporter | The other |
| Result mta::MultiThreadReporter::reportProgress | ( | int | threadIndex, | |
| int | percentDone | |||
| ) | [virtual] |
Send a progress report form a thread.
| threadIndex | ID number for the current thread. | |
| percentDone | How much of this thread's progress has completed. |
Implements mta::ThreadReporter.
| Result mta::MultiThreadReporter::reportCompletion | ( | int | threadIndex | ) | [virtual] |
Indicate that a thread has completed execution.
| threadIndex | ID number for the current thread. |
Implements mta::ThreadReporter.
| Result mta::MultiThreadReporter::reportError | ( | std::string | errorText | ) | [virtual] |
Report an error.
| errorText | Description of the error. |
Implements mta::ThreadReporter.
| int mta::MultiThreadReporter::getProgress | ( | ) | const |
Get the current thread's progress.
| int mta::MultiThreadReporter::getProgress | ( | int | threadIndex | ) | const [virtual] |
Access the progress of a thread.
| threadIndex | The ID of the thread to check. |
Implements mta::ThreadReporter.
| std::string mta::MultiThreadReporter::getErrorText | ( | ) | const [virtual] |
Access the most recent error.
Implements mta::ThreadReporter.
| void mta::MultiThreadReporter::runInMainThread | ( | ThreadCommand & | command | ) | [virtual] |
Perform an action in the main thread.
| command | The action to run in the main thread. |
Implements mta::ThreadReporter.
| void mta::MultiThreadReporter::setReportType | ( | ReportType | type | ) |
Set the type of report.
| type | The report type. |
| unsigned int mta::MultiThreadReporter::getReportType | ( | ) | const |
Access the report type.
| ThreadCommand* mta::MultiThreadReporter::getThreadCommand | ( | ) |
Access the current thread command.