Public Member Functions | Private Attributes | List of all members
Bikes Class Reference

#include <bikes.h>

Public Member Functions

 Bikes ()
 
int getTotalGears () const
 
int getTotalCapacity () const
 
void print (ostream &out=cout) const
 
void read (string filename) throw ( logic_error, invalid_argument )
 
unsigned size () const
 
 ~Bikes ()
 

Private Attributes

vector< Bike * > bikes
 

Detailed Description

The Bikes class. vector class, stores information about bikes. The vector stores pointers to these objects, and provides methods for destructing, reading, printing, and totaling the volume of such objects.

Author
Mark Maloof
Version
1.0, 1/24/13

Constructor & Destructor Documentation

Bikes::Bikes ( )

Default class constructor.

Bikes::~Bikes ( )

Class destructor.

Member Function Documentation

int Bikes::getTotalCapacity ( ) const

Computes and returns the total capacity of the bikes stored in the vector.

Returns
an int storing the total capacity of the bikes
int Bikes::getTotalGears ( ) const

Computes and returns the total number of gears of the bikes stored in the vector.

Returns
an int storing the total volume of the bikes
void Bikes::print ( ostream &  out = cout) const

Prints to the ostream out this object's bikes. The ostream defaults to cout.

Parameters
outan ostream for printing (defaults to cout)
void Bikes::read ( string  filename)
throw ( logic_error,
invalid_argument
)

Uses the BikeFactory to read and make Bike objects from the file named filename, storing them the bikes vector. Directly throws an exception if the file does open successfully. Indirectly throws an exception if an argument in the stream is invalid.

Parameters
filenamea string containing the make of the file to read
Exceptions
logic_errorif the file does not open successfully
invalid_argumentif an argument in the stream is invalid
unsigned Bikes::size ( ) const

Returns the number of bikes.

Returns
the number of bikes

Member Data Documentation

vector<Bike *> Bikes::bikes
private

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