AbstractExercise Class Reference

#include <AbstractExercise.h>

Inheritance diagram for AbstractExercise:

Exercise2 Exercise3 GcdExercise LifeExercise PalindromeExercise Pounds2KilosExercise List of all members.

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

Detailed Description

The Abstract Exercise. Superclass of all Exercises

© Bernhard Wagner, xmlizer.net, 2002.

Definition at line 13 of file AbstractExercise.h.


Constructor & Destructor Documentation

AbstractExercise::AbstractExercise (  ) 

Default constructor.

Definition at line 15 of file AbstractExercise.cpp.

References init().

AbstractExercise::AbstractExercise ( string  name  ) 

Constructor.

Parameters:
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.


Member Function Documentation

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.

Returns:
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().


Member Data Documentation

string AbstractExercise::fName [private]

Definition at line 66 of file AbstractExercise.h.

Referenced by getName(), and init().


The documentation for this class was generated from the following files:
Generated on Thu Jul 3 19:12:45 2008 for Exercise Framework by  doxygen 1.5.1