S
Snyke
Ok this is a bit fishy actually:
I have a class (a socket wrapper) which reads some data from a stream
and then should respond to it. This is done in two function (OnRead,
which reads from the stream, and OnCommand which then decides what to
do). The proble is that I have an inherited class which overloads the
OnCommand function (but not OnRead). In some way it looks like the
non-overloaded one is executed even if the Object is of the inherited
class.
The problem as described above is that Socket1::OnCommand is executed
and not Socket2::OncCommand.
Anybody got an idea why? Or did I misunderstand something.
Snyke
I have a class (a socket wrapper) which reads some data from a stream
and then should respond to it. This is done in two function (OnRead,
which reads from the stream, and OnCommand which then decides what to
do). The proble is that I have an inherited class which overloads the
OnCommand function (but not OnRead). In some way it looks like the
non-overloaded one is executed even if the Object is of the inherited
class.
Code:
class Socket1 {
public:
...
private:
void OnCommand(string comm);
void OnRead();
}
class Socket2 {
private:
OnCommand(string comm);
}
int main(int argc,char *argv[]){
Socket2 s;
s.go();
}
The problem as described above is that Socket1::OnCommand is executed
and not Socket2::OncCommand.
Anybody got an idea why? Or did I misunderstand something.
Snyke