>Is there a way that the TaskManager does not delete the Task after it is completed.
No. A Task will automatically notify the manager when runTask() completes and manager shall remove it from the list.
What you can do is:
* prevent it from completing by looping inside the runTask()
or
* give a duplicate to TaskManager~058~~058~start() to cause your task to outlive the run by manager and, after completion, start it again:
- Code: Select all
TaskManager tm;
AutoPtr<SimpleTask> pTT = new SimpleTask;
tm.start(pTT.duplicate()); // send in duplicate
tm.joinAll(); // run to completion
tm.start(pTT.duplicate()); // start it again
HTH
Alex