Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

type translation error about "function pointer"

i met a probelm about compulsory type translation error about "pointer of class function member " in Nios2 IDE.

firstly i defined :

class InterruptClass

{

public:

virtual ~InterruptClass() {};

};

class Interrupt

{

public:

typedef void (InterruptClass::*Callback)(int);

Interrupt(int vector);

~Interrupt() {};

void Initialize();

void SetCallback(InterruptClass *iclass, Callback handler, int arg= 0);

private:

.................

}

then i invoke SetCallback :

Interrupt timerIntr...;

timerIntr.SetCallback(this, (Interrupt::Callback)Timer::InterruptHandler);

Nios2 IDE info me a error that the type translation can not be executed.

i tried to compile the code in VC++ and VisualDSP++, it is ok.

So i wonder whether the IDE support this conversion.

is there any approach to solve this problem?