I'm trying to create a task scheduler using the Bela AuxilliaryTask.
I want to be able to have an auxiliary task within a class or struct, which I will keep a vector of E.g.
class TaskClass
{
public:
TaskClass(unsigned int _priority /*Other arguments for related useful variables and references.*/)
{
task = Bela_createAuxiliaryTask(aux_task, priority, "aux_task_name");
}
void scheduleTask()
{
Bela_scheduleAuxiliaryTask(task);
}
void aux_task(void *)
{
/*Do some non-static function using useful variables.*/
}
private:
/*
Related useful variables and references.
*/
AuxiliaryTask task;
};
And then having a std::vector<TaskClass> which I could iterate over, change and relaunch the tasks.
I'm getting an error that says "reference to non-static function must be called".
Can anyone help with this? I need the aux_task to be non-static so that I can process different data between calls.
If anyone can shed some light on my situation I would be really, really grateful!
Jamie