Public Member Functions | List of all members
Urban Class Reference

#include <urban.h>

Inheritance diagram for Urban:
Bike

Public Member Functions

 Urban ()
 
 Urban (string id, string name, int gears) throw ( invalid_argument )
 
void setID (string id) throw ( invalid_argument )
 
virtual void print (ostream &out=cout) const
 
virtual void read (istream &in) throw ( invalid_argument )
 
- Public Member Functions inherited from Bike
 Bike ()
 
 Bike (string id, string name, int gears) throw ( invalid_argument )
 
void setID (string id) throw ( invalid_argument )
 
void setName (string name)
 
void setGears (int gears) throw ( invalid_argument )
 
string getID () const
 
string getName () const
 
int getGears () const
 
virtual ~Bike ()
 

Additional Inherited Members

- Protected Attributes inherited from Bike
string id
 
string name
 
int gears
 

Detailed Description

Urban class for storing information about urban bike.

Author
Mark Maloof
Version
1.0, 1/14/13

Constructor & Destructor Documentation

Urban::Urban ( )

Default constructor.

Urban::Urban ( string  id,
string  name,
int  gears 
)
throw (invalid_argument
)

Explicit class constructor that initializes this bike object with the arguments id, name, and gears.

Parameters
ida string storing the id of this bike
namea string storing the name of this bike
gearsan int storing the gears of this bike
Exceptions
invalid_argumentif an argument is invalid

Member Function Documentation

void Urban::print ( ostream &  out = cout) const
virtual

Prints this urban bike to the ostream out, which defaults to cout.

Parameters
outan ostream for printing (defaults to cout)

Reimplemented from Bike.

void Urban::read ( istream &  in)
throw (invalid_argument
)
virtual

Reads information for an urban bike from the istream argument, storing the information in the respective data members.

Parameters
inan istream for reading
Exceptions
invalid_argumentif an argument is invalid

Reimplemented from Bike.

void Urban::setID ( string  id)
throw (invalid_argument
)

Sets this urban bike's ID, which must have the format U[0-9][0-9].

Parameters
ida string storing this bike's identifier
Exceptions
invalid_argumentif an argument is invalid

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