Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Animal Class Reference

#include <animal.h>

Inheritance diagram for Animal:

Dog GuideDog List of all members.

Public Member Functions

 Animal ()
 Animal (string name, char gender)
void setName (string name)
void setGender (char gender)
string getName () const
char getGender () const
virtual void print (ostream &out=cout) const
virtual void read (ifstream &fin)
virtual ~Animal ()

Protected Attributes

string name
char gender

Detailed Description

Animal class for storing information about animals, each of which have a name and a gender.

Author:
Mark Maloof
Version:
1.0 1/27/05


Constructor & Destructor Documentation

Animal::Animal  ) 
 

Default constructor.

Animal::Animal string  name,
char  gender
 

Explicit class constructor initializing a animal object using the arguments name and gender.

Parameters:
name a string storing the name of this animal
gender a string storing the gender of this animal

Animal::~Animal  )  [virtual]
 

Destructor. Does nothing but is recommended for classes with virtual methods.


Member Function Documentation

char Animal::getGender  )  const
 

Returns this animal's gender

Returns:
a char storing this animal's gender

string Animal::getName  )  const
 

Returns this animal's name

Returns:
a string storing this animal's name

void Animal::print ostream &  out = cout  )  const [virtual]
 

Prints this animal's name and gender to the ostream out, which defaults to cout.

Parameters:
out an ostream for printing (defaults to cout)

Reimplemented in Dog, and GuideDog.

void Animal::read ifstream &  fin  )  [virtual]
 

Reads this animal's name and gender from the ifstream argument, storing them in the respective data members.

Parameters:
fin an ifstream for reading

Reimplemented in Dog, and GuideDog.

void Animal::setGender char  gender  ) 
 

Sets this animal's gender

Parameters:
gender a char storing this animal's gender

void Animal::setName string  name  ) 
 

Sets this animal's name

Parameters:
name a string storing this animal's name


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 16:33:09 2005 by doxygen1.3