00001 00013 #ifndef PATHRESULT_H_INCLUDED 00014 #define PATHRESULT_H_INCLUDED 00015 00016 #include <list> 00017 #include <boost/shared_ptr.hpp> 00018 #include <boost/noncopyable.hpp> 00019 00020 class Station; 00021 class Line; 00022 typedef boost::shared_ptr<const Station> SharedConstStation; 00023 typedef boost::shared_ptr<const Line> SharedConstLine; 00024 00026 00029 class PathResult : boost::noncopyable 00030 { 00031 unsigned int totalSecondDuration_; 00032 00033 public: 00034 00036 00042 struct Step 00043 { 00044 SharedConstStation station1; 00045 SharedConstStation station2; 00046 SharedConstLine line; 00047 unsigned int changeDuration; 00048 unsigned int transportDuration; 00049 00050 Step( 00051 SharedConstStation sta1, 00052 SharedConstStation sta2, 00053 SharedConstLine li, 00054 unsigned int chaDur, 00055 unsigned int traDur 00056 ); 00057 }; 00058 00059 private: 00060 typedef std::list<Step> StepList; 00061 00062 public: 00063 typedef StepList::iterator iterator; 00064 typedef StepList::const_iterator const_iterator; 00065 00066 private: 00067 std::list<Step> stepList_; 00068 00069 public: 00070 PathResult(); 00071 00072 void addStep(const Step &newStep); 00073 00074 unsigned int getTotalMinuteDuration() const; 00075 00076 size_t size() const; 00077 00078 bool empty() const; 00079 00080 const_iterator begin() const; 00081 const_iterator end() const; 00082 }; 00083 00084 inline unsigned int PathResult::getTotalMinuteDuration() const 00085 { 00086 return totalSecondDuration_; 00087 } 00088 00089 inline PathResult::const_iterator PathResult::begin() const 00090 { 00091 return stepList_.begin(); 00092 } 00093 00094 inline PathResult::const_iterator PathResult::end() const 00095 { 00096 return stepList_.end(); 00097 } 00098 00099 inline size_t PathResult::size() const 00100 { 00101 return stepList_.size(); 00102 } 00103 00104 inline bool PathResult::empty() const 00105 { 00106 return stepList_.empty(); 00107 } 00108 00109 #endif // PATHRESULT_H_INCLUDED 00110