#include <urban.h>
Urban class for storing information about urban bike.
- Author
- Mark Maloof
- Version
- 1.0, 1/14/13
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. Indirectly throws an exception if an argument is invalid.
- Parameters
-
id | a string storing the id of this bike |
name | a string storing the name of this bike |
gears | an int storing the gears of this bike |
- Exceptions
-
invalid_argument | if an argument is invalid |
void Urban::print |
( |
ostream & |
out = cout | ) |
const |
|
virtual |
Prints this urban bike to the ostream out, which defaults to cout.
- Parameters
-
out | an 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. Indirectly throws an exception if an argument in the stream is invalid.
- Parameters
-
- Exceptions
-
invalid_argument | if an argument in the stream 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]. Directly throws an exception if the argument is invalid.
- Parameters
-
id | a string storing this bike's identifier |
- Exceptions
-
invalid_argument | if the argument is invalid |
The documentation for this class was generated from the following files: