mthread 0.5
|
A class for running several Thread objects simultaneously. More...
#include <mthread.h>
Public Member Functions | |
ThreadList (bool keep=false) | |
Constructor. | |
~ThreadList () | |
Destructor. | |
bool | add_thread (Thread *t) |
Adds a Thread to the ThreadList. | |
Protected Member Functions | |
bool | loop () |
The main loop. | |
Private Attributes | |
Thread ** | thread |
An array of pointers to the Thread objects in the list. | |
unsigned | thread_count |
The number of Thread objects in the list. | |
unsigned | thread_index |
The index number of the active Thread. | |
bool | keep_flag |
Indicates whether or not to continue running the ThreadList after it has run out of Thread objects. |
A class for running several Thread objects simultaneously.
A ThreadList object is a Thread in and of itself. This allows the creation of tiered ThreadList objects by placing a lower-priority ThreadList inside of a higher-priority ThreadList.
ThreadList::ThreadList | ( | bool | keep = false | ) |
Constructor.
keep | If true, the ThreadList will continue to run even after it's empty, otherwise it will automatically destroy itself once all of its Thread objects have finished. |
bool ThreadList::add_thread | ( | Thread * | t | ) |
Adds a Thread to the ThreadList.
t | A pointer to the Thread to be added. |
bool ThreadList::loop | ( | ) | [protected, virtual] |