#include <iostream>
using namespace std;
class singlecore{
public:
virtual void show(){};
};
class coreA :public singlecore{
void show(){
cout<<"in class coreA" <<endl;
}
};
class coreB :public singlecore{
void show(){
cout<<"in class coreB"<<endl;
}
};
class factory{
public: singlecore *create_operation(char type){
if (type =='a'){
cout<<"creating coreA"<<endl;
return new coreA();
}
if (type =='b'){
cout<<"creating coreB"<<endl;
return new coreB();
}
}
};
int main(){
factory fac;
fac.create_operation('a');
cout<<endl;
fac.create_operation('b');
}