/* * This files contains a Car class definition. * * The only public functionality supported is to output a car and to * 'break' a car. * * The Dealer class has additional access to constructing a new car * using the signature: * Car(std::string c, int doors); * * and has the ability to fix a broken car, using the signature: * void fixIt(); * * Noone, either in the public or a Dealer, is allowed to copy a car. */ #ifndef CAR_H #define CAR_H #include #include class Car { public: // General public can only break cars (or print info) void breakIt(); std::string toString() const; private: bool valid; bool broken; std::string color; int numDoors; // Dealers can order new cars and fix cars friend class Dealer; Car(std::string c, int doors); void fixIt(); // NOONE IS ALLOWED TO COPY A CAR Car(const Car& other); Car& operator=(const Car& other); }; std::ostream& operator<<(std::ostream& out, const Car& c); #endif