Hi, I have an abstract class like this:
class Descriptor
{
public:
virtual ULONG dispatch(char*, size_t, Stream) = 0;
};
and I have a subclass like this:
class ConsoleShell : public Descriptor
{
public:
ULONG dispatch(char*, size_t, Stream*);
};
#include "services/console/Console.cpp"
and in Console.cpp:
ULONG ConsoleShell::dispatch(char *cmd, size_t len, Stream *s)
{
return (ACE_OS::strcmp(cmd, "quit") == 0) ? s->close() : s->printf(cmd);
}
So I would think I'm all set to instantiate ConsoleShell, but I gcc gives me this:
/export/home/levk/r6/services/console/Console.cpp: In member function `ULONG
Console<Connection, Address>::start() [with Connection = LSOCKConnection,
Address = ACE_UNIX_Addr]':
/export/home/levk/r6/utility/connection/LSOCKConnection.h:17: instantiated from here
/export/home/levk/r6/services/console/Console.cpp:38: error: cannot allocate an
object of type `ConsoleShell'
/export/home/levk/r6/services/console/Console.cpp:38: error: because the
following virtual functions are abstract:
/export/home/levk/r6/utility/connection/Connection.h:71: error: virtual ULONG
Descriptor::dispatch(char*, unsigned int, Stream)
Where Console.cpp:38 is where I'm trying to instantiate ConsoleShell and Connection.h:71 is Descriptor::dispatch
Am I missing something syntactically from the snippet I just gave you?
Thank you in advance