bachra04
asked on
calling back function with same name and different signature
Hi Guys,
I need help to perform the following
I have a the following class that has 3 functions with same name but different parameters type
class A : public ParentClass {
void handleEvent (EventA ){}
void handleEvent(EventB){}
void handleEvent(EventC){}
}
Is there a way to store them in a map as function pointer and then call them back based on the type of event received ?
I was going to do :
Map<string, void*> map;
Map[eventAId] = &handleEvent // here is the issue all the functions have the same name
Is there a way to fix that ?
I am using C++ 11 and stl library.
I need help to perform the following
I have a the following class that has 3 functions with same name but different parameters type
class A : public ParentClass {
void handleEvent (EventA ){}
void handleEvent(EventB){}
void handleEvent(EventC){}
}
Is there a way to store them in a map as function pointer and then call them back based on the type of event received ?
I was going to do :
Map<string, void*> map;
Map[eventAId] = &handleEvent // here is the issue all the functions have the same name
Is there a way to fix that ?
I am using C++ 11 and stl library.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.