Task class reference
A class that helps creating tasks - that is, processes performed in another thread that collect data and then allow "pseudo asynchronous" widget's production in the main graphical thread.
Functions documentation
Task
();
Default constructor.
virtual ~
Task
();
Default destructor. It does not destroy the memory allocated by the user. The user have to write his own destructor.
void Run();
Function that starts the task thread.
void Join(bool terminate);
A function that allows synchronization between threads. It waits for the task to finish, but it can also terminate it (if the thread is well implemented).
virtual M Make();
Creates a new object (executed at the place of the call - usually the main thread).
virtual void EntryPoint();
Thread 'main' function.
F Fetch();
A function helpful in implementing the Make() function. Returns the next data packet needed to create a specific object.
void Feed(F data);
Adds a data packet to the buffer.
bool IfDone();
Returns the status of the thread (whether it works or has already end).
void Done(bool mode = true);
Signals the end of the thread.
Variables documentation
std::list<F> m_Data;
Stores data packets.
std::thread m_Thread;
Thread handler.
size_t m_iFetchPoint;
Stores the current position for Fetch() function.
bool m_bDone;
Flag indicationg the state of the thread.