A
Angus
I have a base class CEventSelect a bit like this:
class CEventSelect
{
virtual void OnConnected();
}
and a network interface class a bit like this:
class networkinterface : public CEventSelect
{
virtual void OnConnected();
}
The base CEventSelect class calls it's OnConnected() function when a
client receives notification from the network that it is connected.
But I wanted my networkinterface::OnConnected() method to be called?
But it wasn't. I understand polymorphic functions and I think I
understand why it is not working the way I wanted. Because
CEventSelect calls its own OnConnected() method does mean that the
inheriting OnConnected() will be called. But this is the behaviour I
want.
The actual connection is notified by the base class - but I want my
interface class to someone get notified of the connection.
How can I get the networkinterface class to be notified about the
connection?
class CEventSelect
{
virtual void OnConnected();
}
and a network interface class a bit like this:
class networkinterface : public CEventSelect
{
virtual void OnConnected();
}
The base CEventSelect class calls it's OnConnected() function when a
client receives notification from the network that it is connected.
But I wanted my networkinterface::OnConnected() method to be called?
But it wasn't. I understand polymorphic functions and I think I
understand why it is not working the way I wanted. Because
CEventSelect calls its own OnConnected() method does mean that the
inheriting OnConnected() will be called. But this is the behaviour I
want.
The actual connection is notified by the base class - but I want my
interface class to someone get notified of the connection.
How can I get the networkinterface class to be notified about the
connection?