I have class B and C which inherit from class A.
I have a static method:
A* aRequest(unsigned char *byte_buffer, size_t length)
{
A *foo;
if(something == true)
{
foo = new B;
return foo;
}
else
{
foo = new C;
return foo;
}
}
So that when the method aRequest is called from my parser it should
return a pointer to one of the subclass types B or C.
Problem is when I try to use this:
XMLRequest *foggy;
foggy = A::aRequest(buffer, len);
foggy->someOtherBMethod();
It says the referenced object "someOtherMethod" is not a member of
class A. Can anybody help me out here? I'm not really sure how to do it
properly.