Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Dog Class Reference

#include <dog.h>

Inheritance diagram for Dog:

Animal GuideDog List of all members.

Public Member Functions

 Dog ()
 Dog (string name, char gender, string cid, double weight)
void setCountyID (string cid)
void setWeight (double weight)
string getCountyID () const
double getWeight () const
virtual void read (ifstream &fin)
virtual void print (ostream &out=cout) const
virtual ~Dog ()

Protected Attributes

string cid
double weight

Detailed Description

Dog class, publically derived from the Animal class, for storing information about dogs being treated. Such dogs have County IDs (cids) and weights in addition to the name and gender they inherit from the Animal class.

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


Constructor & Destructor Documentation

Dog::Dog  ) 
 

Default class constructor.

Dog::Dog string  name,
char  gender,
string  cid,
double  weight
 

Explicit class constructor initializing this dog object using the arguments name, gender, County ID (cid), and weight

Parameters:
name a string storing this dog's name
gender a string containing this dog's gender
cid a string storing this dog's County ID (cid)
weight a double storing this dog's weight

Dog::~Dog  )  [virtual]
 

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


Member Function Documentation

string Dog::getCountyID  )  const
 

Returns this dog's County ID (cid).

Returns:
a string storing this dog's County ID (cid)

double Dog::getWeight  )  const
 

Returns this dog's weight.

Returns:
a double storing this dog's weight

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

Prints this dog's name, gender, County ID (cid), and weight to the ostream out, which defaults to cout.

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

Reimplemented from Animal.

Reimplemented in GuideDog.

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

Reads this dog's name, gender, County ID (cid), and weight from the ifstream argument

Parameters:
fin an ifstream for reading

Reimplemented from Animal.

Reimplemented in GuideDog.

void Dog::setCountyID string  cid  ) 
 

Sets this dog's County ID (cid)

Parameters:
cid a string storing this dog's County ID (cid)

void Dog::setWeight double  weight  ) 
 

Sets this dog's weight

Parameters:
weight a double storing this dog's weight, which must be greater than or equal to zero


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