L
Luca
Hi, I have a quite complex question to ask you:
I have defined a base class where I would like to have a map holding
pointers to member functions defined in derived classes.
To be more precise I would like my base class to have the following
member:
map<string, pointer_to_member_function> myClassMap;
my base class also has a string member - say m_sValue - whose value
can be the same of one of the string values contained in the map
My base class should also have a public method, say "execute" that
does the following:
1.retrieve the map pair whose key has the same value as m_sValue
2.dereference the poniter to member function contained in the second
member of the map pair element, thus invoking the member function
defined in the derived class
Is that possible to do?
Thank you
Luca
I have defined a base class where I would like to have a map holding
pointers to member functions defined in derived classes.
To be more precise I would like my base class to have the following
member:
map<string, pointer_to_member_function> myClassMap;
my base class also has a string member - say m_sValue - whose value
can be the same of one of the string values contained in the map
My base class should also have a public method, say "execute" that
does the following:
1.retrieve the map pair whose key has the same value as m_sValue
2.dereference the poniter to member function contained in the second
member of the map pair element, thus invoking the member function
defined in the derived class
Is that possible to do?
Thank you
Luca