F
foggy
Given class A as the client of IFace and IFace is defined as:
int switcher;
class IFace
{
public:
virtual method1()=0;
virtual method2()=0;
};
class B : public IFace
{
// switcher is 0
C c;
// switcher is -1
(D d
// switcher is 1
(E e
};
c, d, or e is created at run-time but not more than one will.
How to do the implementation? Thanks!
int switcher;
class IFace
{
public:
virtual method1()=0;
virtual method2()=0;
};
class B : public IFace
{
// switcher is 0
C c;
// switcher is -1
(D d
// switcher is 1
(E e
};
c, d, or e is created at run-time but not more than one will.
How to do the implementation? Thanks!