I have the following code using multiple inheritance. The purpose is to use two interfaces as one in the derived class:
struct InterfaceA
{
virtual void register_stuff();
virtual void on_state_changed( const State state ) = 0;
};
struct InterfaceB
{
virtual void register_stuff();
virtual void on_state_changed( const State state ) = 0;
};
struct Derived : InterfaceA, InterfaceB
{
void register_stuff() override
{
InterfaceA::register_stuff();
InterfaceB::register_stuff();
}
void on_state_changed( const State state ) override
{
// how can I know who is responding?
}
};
Registering the interfaces will cause an asynchronous call to on_state_changed
. Is it possible to discern which interface is calling it?