Question Class Reference

#include <Question.h>

Inheritance diagram for Question:

Inheritance graph
[legend]

Detailed Description

Abstract Question base class.

Definition at line 39 of file Question.h.


Public Member Functions

string getAnswer ()
 Return the answer previously given.
void setAnswer (string answer)
 Set the answer.
void setExplanation (string explanation)
 Define an explanation for the question, that will be shown when the question is answered with '?'.
void setQuestion (string question)
 Define the question to ask.
void setDefault (string defval)
 Define a default value to use when the question is answered with a <return>.
virtual string ask ()=0
 Ask the question, and return the value given.
virtual void explain ()
 Display the explanation.

Protected Attributes

string mAnswer
 The stored answer.
string mExplanation
 An explanation for the question.
string mQuestion
 The question to ask.
string mDefault
 Default value.

Member Function Documentation

string Question::getAnswer (  )  [inline]

Return the answer previously given.

Definition at line 45 of file Question.h.

References mAnswer.

Referenced by add_disks(), and main().

void Question::setAnswer ( string  answer  )  [inline]

Set the answer.

Definition at line 53 of file Question.h.

References mAnswer.

Referenced by add_disks(), and main().

void Question::setExplanation ( string  explanation  )  [inline]

Define an explanation for the question, that will be shown when the question is answered with '?'.

Definition at line 62 of file Question.h.

References mExplanation.

Referenced by add_disks(), and main().

void Question::setQuestion ( string  question  )  [inline]

Define the question to ask.

Definition at line 70 of file Question.h.

References mQuestion.

Referenced by add_disks(), and main().

void Question::setDefault ( string  defval  )  [inline]

Define a default value to use when the question is answered with a <return>.

Definition at line 79 of file Question.h.

References mDefault.

Referenced by add_disks(), and main().

virtual string Question::ask (  )  [pure virtual]

Ask the question, and return the value given.

Implemented in FreeTextQuestion, MultipleChoiceQuestion, and NumberQuestion.

virtual void Question::explain (  )  [inline, virtual]

Display the explanation.

Reimplemented in MultipleChoiceQuestion.

Definition at line 92 of file Question.h.

References mExplanation.

Referenced by FreeTextQuestion::ask(), and MultipleChoiceQuestion::explain().


Field Documentation

string Question::mAnswer [protected]

string Question::mExplanation [protected]

An explanation for the question.

Definition at line 102 of file Question.h.

Referenced by explain(), and setExplanation().

string Question::mQuestion [protected]

The question to ask.

Definition at line 105 of file Question.h.

Referenced by FreeTextQuestion::ask(), and setQuestion().

string Question::mDefault [protected]

Default value.

Definition at line 108 of file Question.h.

Referenced by FreeTextQuestion::ask(), and setDefault().


The documentation for this class was generated from the following file:

SourceForge.net Logo
Project space on SourceForge.net