#include <iostream>
#include <list>
using namespace std;
//
struct IResume
{
public:
virtual ~IResume() { }
virtual void SetPersonalInfo() = 0;
virtual void SetEducationInfo() = 0;
virtual void SetWorkInfo() = 0;
void FillResume()
{
SetPersonalInfo();
SetEducationInfo();
SetWorkInfo();
}
};
class CResumeA : public IResume
{
public:
virtual ~CResumeA() { }
virtual void SetPersonalInfo() { cout<<"A person info."<<endl; }
virtual void SetEducationInfo() { cout<<"A education info."<<endl; }
virtual void SetWorkInfo() { cout<<"A work info."<<endl; }
};
class CResumeB : public IResume
{
public:
virtual ~CResumeB() { }
virtual void SetPersonalInfo() { cout<<"B person info."<<endl; }
virtual void SetEducationInfo() { cout<<"B education info."<<endl; }
virtual void SetWorkInfo() { cout<<"B work info."<<endl; }
};
//
void main()
{
IResume *pResume = new CResumeA();
pResume->FillResume();
delete pResume;
pResume = new CResumeB();
pResume->FillResume();
delete pResume;
}