00001 00013 #ifndef LINE_H_INCLUDED 00014 #define LINE_H_INCLUDED 00015 00016 #include <string> 00017 #include <vector> 00018 #include <boost/noncopyable.hpp> 00019 #include <boost/shared_ptr.hpp> 00020 00021 class Station; 00022 typedef boost::shared_ptr<const Station> SharedConstStation; 00023 00025 class Line : boost::noncopyable 00026 { 00028 const std::wstring name_; 00030 const int id_; 00032 std::vector<SharedConstStation> stationVect_; 00033 00034 Line( 00035 int id , 00036 const std::wstring &name ); 00037 00038 00039 public: 00040 typedef std::vector<SharedConstStation>::iterator iterator; 00041 typedef std::vector<SharedConstStation>::const_iterator const_iterator; 00042 00043 static boost::shared_ptr<Line> Create( 00044 int id , 00045 const std::wstring &name ); 00046 00047 const std::wstring& getName() const; 00048 00049 int getID() const; 00050 00051 void addStation( 00052 SharedConstStation newStation ); 00053 00055 00063 SharedConstStation getEndStationInThisDirection( 00064 SharedConstStation X, 00065 SharedConstStation Y) const; 00066 00067 const_iterator begin() const; 00068 const_iterator end() const; 00069 }; 00070 00071 typedef boost::shared_ptr<Line> SharedLine; 00072 typedef boost::shared_ptr<const Line> SharedConstLine; 00073 00074 inline const std::wstring& Line::getName() const 00075 { 00076 return name_; 00077 } 00078 00079 inline int Line::getID() const 00080 { 00081 return id_; 00082 } 00083 00084 inline Line::const_iterator Line::begin() const 00085 { 00086 return stationVect_.begin(); 00087 } 00088 00089 inline Line::const_iterator Line::end() const 00090 { 00091 return stationVect_.end(); 00092 } 00093 00094 #endif // LINE_H_INCLUDED