Task and classes

The most common approach is to make the task method in question static, and passing the class instance by reference as an optional argument.

MyClass.h

class MyClass
{
    public:
        MyClass();

        static AsyncTask::DoneStatus example_method(GenericAsyncTask *task, void *data);

    private:
        PT(AsyncTaskManager) task_mgr;
        PT(GenericAsyncTask) example_task;
}

MyClass.cpp

MyClass::MyClass()
{
    this->task_mgr = AsyncTaskManager::get_global_ptr();

    this->example_task = new GenericAsyncTask("exampleTask", example_method, this);
    this->task_mgr->add(this->example_task);
}

AsyncTask::DoneStatus MyClass::example_method(GenericAsyncTask *task, void *data)
{
	MyClass *self = (MyClass*)data;

	return AsyncTask::DS_cont;
}