00001 #include <string> 00002 using namespace std; 00003 00004 // wheel element, there are four wheels with unique names 00005 class Wheel : public CarElement 00006 { 00007 public: 00008 explicit Wheel(const string& name) : 00009 name_(name) 00010 { 00011 } 00012 const string& getName() const 00013 { 00014 return name_; 00015 } 00016 void accept(const CarElementVisitor& visitor) 00017 { 00018 visitor.visit(*this); 00019 } 00020 private: 00021 string name_; 00022 };