00001 #include "macros.h" // needs to be declared as first entry in .cpp or .h file! 00002 #include <iostream> 00003 #include <string> 00004 #include <typeinfo> 00005 using namespace std; 00006 #include "AbstractExercise.h" 00007 #include "ExerciseStore.h" 00008 00015 AbstractExercise::AbstractExercise(){ 00016 init(typeid(this).name()); 00017 } 00018 00019 AbstractExercise::AbstractExercise(string name){ 00020 init(name); 00021 } 00022 00023 void AbstractExercise::getInput(){ 00024 } 00025 00026 void AbstractExercise::start(){ 00027 cout << "Exercise <" << getName() << "> started" << endl; 00028 getInput(); 00029 execute(); 00030 } 00031 00032 void AbstractExercise::init(string name){ 00033 fName = name; 00034 ExerciseStore::instance()->putExercise(this); 00035 // cout << "created Exercise <" << getName() << ">" <<endl; 00036 } 00037 00038 AbstractExercise::~AbstractExercise(){ 00039 // cout << "destroyed Exercise <" << getName() << ">" << endl; 00040 } 00041 00042 void AbstractExercise::execute(){ 00043 cout << "AbstractExercise::execute " << endl; 00044 }