#include <AbstractExercise.h>
Inheritance diagram for AbstractExercise:
Public Member Functions | |
AbstractExercise () | |
AbstractExercise (string name) | |
virtual | ~AbstractExercise () |
void | start () |
string | getName () |
Protected Member Functions | |
virtual void | getInput () |
virtual void | execute () |
Private Member Functions | |
void | init (string name) |
Private Attributes | |
string | fName |
© Bernhard Wagner, xmlizer.net, 2002.
Definition at line 13 of file AbstractExercise.h.
AbstractExercise::AbstractExercise | ( | ) |
AbstractExercise::AbstractExercise | ( | string | name | ) |
Constructor.
name | The name of the Exercise |
Definition at line 19 of file AbstractExercise.cpp.
References init().
AbstractExercise::~AbstractExercise | ( | ) | [virtual] |
Destructor.
Definition at line 38 of file AbstractExercise.cpp.
void AbstractExercise::start | ( | ) |
Starts the exercise. (Template Method Design Pattern)
Definition at line 26 of file AbstractExercise.cpp.
References execute(), getInput(), and getName().
Referenced by Driver::instantiate().
string AbstractExercise::getName | ( | ) | [inline] |
Gets the exercise's name.
Definition at line 43 of file AbstractExercise.h.
References fName.
Referenced by Exercise2::execute(), ExerciseStore::putExercise(), and start().
void AbstractExercise::getInput | ( | ) | [protected, virtual] |
Gets the input for this exercise. To be overridden in subclasses. (Hook Method)
Reimplemented in GcdExercise, PalindromeExercise, and Pounds2KilosExercise.
Definition at line 23 of file AbstractExercise.cpp.
Referenced by start().
void AbstractExercise::execute | ( | ) | [protected, virtual] |
Executes this exercise. To be overridden in subclasses. (Hook Method)
Reimplemented in Exercise2, GcdExercise, LifeExercise, PalindromeExercise, and Pounds2KilosExercise.
Definition at line 42 of file AbstractExercise.cpp.
Referenced by start().
void AbstractExercise::init | ( | string | name | ) | [private] |
Initializes this Exercise. Used to factor out common code of both constructors.
Definition at line 32 of file AbstractExercise.cpp.
References fName, ExerciseStore::instance(), and ExerciseStore::putExercise().
Referenced by AbstractExercise().
string AbstractExercise::fName [private] |