hello all
im facing a problem that confusing me allot dealing member functions
here is the thing :
i have class A :
class A {
getCallBack(void (*)()){
}
}
then i have class B:
that has few member functions that i like to pass to class A function
class B {
void CallBack1(void){
}
}
now no matter what i do im keep getting compiler errors
for example when i try to do
B b = new B()
A::getCallBack(b->CallBack1);
now the second question is how can i construct factory class that will return me the void callback members functions
accourding to something .
here im also facing allots of problems for example if i try to do something like this :
void (*B::CreateCallBack(int type))(void){
void (*p)(void);
switch(type){
case 1: {
p= B.*CallBack1();
break;
}
default:
break;
}
return p;
}
what im doing wrong here ?
im facing a problem that confusing me allot dealing member functions
here is the thing :
i have class A :
class A {
getCallBack(void (*)()){
}
}
then i have class B:
that has few member functions that i like to pass to class A function
class B {
void CallBack1(void){
}
}
now no matter what i do im keep getting compiler errors
for example when i try to do
B b = new B()
A::getCallBack(b->CallBack1);
now the second question is how can i construct factory class that will return me the void callback members functions
accourding to something .
here im also facing allots of problems for example if i try to do something like this :
void (*B::CreateCallBack(int type))(void){
void (*p)(void);
switch(type){
case 1: {
p= B.*CallBack1();
break;
}
default:
break;
}
return p;
}
what im doing wrong here ?
Last edited: