The most common way of implementing a new task is using a static void in an object's class. The compressor class uses a task to monitor the air flow, etc. If you want to write a task, you can take a look at the .cpp of the compressor class. Here is some sample code too.
This is a sample header file.
Code:
class Sample {
public:
//constructor, other functions
private:
Task task;
static void TaskRunner(Sample *s);
};
And here is the corresponding .cpp
Code:
Sample::Sample() :
task("Sample Task", (FUNCPTR) TaskRunner)
{
task.Start((INT32)this);
}
void Sample::TaskRunner(Sample *s) {
//Task code here
}