RES: RTEMS with C++
joel.sherrill at oarcorp.com
Thu Oct 19 19:35:56 UTC 2006
Fabrício de Novaes Kucinskis wrote:
> Hi Chris,
>> I tend to look at classes and threads in the opposite way. I write a
>> class for a specific purpose and if it needs a thread I embed one in
>> that class where a member function is the thread body.
> And how do you do this? Do you pass a method of an object as the entry point
> for a task?
> I tried this:
> rtems_task_start(id, MyObj.Method, 0);
> Where 'Method' is defined in the class definition as:
> rtems_task Method(rtems_task_argument);
> But it didn't work. The compiler argues that there's "no matches converting
> function 'Method' to type 'rtems_task'".
I am sure there are better methods but the simplest one I have found is
to have a
static function that is the thread. It can take a single argument which
helps it find a pointer to the instance and then call a member function
be the thread body.
> What I'm doing wrong?
> Thanks in advance,
> rtems-users mailing list
> rtems-users at rtems.com
More information about the users