Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Dogs Class Reference

#include <dogs.h>

List of all members.

Public Member Functions

 Dogs ()
 Dogs (string filename)
void print (ostream &out=cout)
bool read (string filename)
double getTotalWeight ()
 ~Dogs ()


Detailed Description

The Dogs class, derived through private inheritance from the vector class, stores information about undergraduate and graduate students. The vector stores pointers to these objects, and provides methods for destructing, reading, printing, and totaling the weight of such objects.

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


Constructor & Destructor Documentation

Dogs::Dogs  ) 
 

Default class constructor.

Dogs::Dogs string  filename  ) 
 

Explicit class constructor initializing this dogs class using the information in the file filename.

Parameters:
filename a string containing the name of the file to be read

Dogs::~Dogs  ) 
 

Class destructor.


Member Function Documentation

double Dogs::getTotalWeight  ) 
 

Returns the total weight of the dogs stored in the vector.

Returns:
a double storing the total weight of the dogs stored

void Dogs::print ostream &  out = cout  ) 
 

Prints to the ostream out this object's dogs, their names, gender, County ID, weights, and, for guide dogs, their Guide-Dog ID. The ostream defaults to cout.

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

bool Dogs::read string  filename  ) 
 

Reads dogs from the file named filename and stores them in a vector. Guide dogs are marked with a 'G', and all other dogs are marked with a 'D'. If the file is opened successfully, then the method returns true; otherwise, it returns false;

Parameters:
filename a string containing the name of the file to read
Returns:
a bool indicating whether the file successfully opened


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