From: <got...@us...> - 2009-04-19 21:37:17
|
Revision: 225 http://scstudio.svn.sourceforge.net/scstudio/?rev=225&view=rev Author: gotthardp Date: 2009-04-19 21:37:05 +0000 (Sun, 19 Apr 2009) Log Message: ----------- typename construct simplified, properties fixed Modified Paths: -------------- trunk/src/data/time.h Property Changed: ---------------- trunk/tests/interval_set_test.cpp Modified: trunk/src/data/time.h =================================================================== --- trunk/src/data/time.h 2009-04-19 20:45:31 UTC (rev 224) +++ trunk/src/data/time.h 2009-04-19 21:37:05 UTC (rev 225) @@ -726,7 +726,8 @@ class MscTimeIntervalSet { private: - std::list< MscTimeInterval<T> > m_set; + typedef std::list< MscTimeInterval<T> > IntervalList; + IntervalList m_set; public: MscTimeIntervalSet(){} @@ -751,7 +752,7 @@ return m_set.front(); } // Dealing with the right place for m_begin - typename std::list <MscTimeInterval<T> >::iterator it; + typename IntervalList::iterator it; for(it=m_set.begin();it!=m_set.end();it++) { // interval.m_begin x it->m_begin @@ -803,7 +804,7 @@ } // end of for // Dealing with the end of interval - typename std::list <MscTimeInterval<T> >::iterator it2; + typename IntervalList::iterator it2; it2=it; // keeping position iterator, just in case for(;it2!=m_set.end();m_set.erase(it2++)) @@ -879,12 +880,12 @@ const MscTimeIntervalSet<T> operator+(MscTimeIntervalSet<T>& set) { MscTimeIntervalSet<T> new_set; - typename std::list<MscTimeInterval<T> >::iterator it; - typename std::list<MscTimeInterval<T> >::iterator it2; - for(it=m_set.begin();it!=m_set.end();it++) + for(typename IntervalList::iterator it=m_set.begin(); + it != m_set.end(); it++) { - for(it2=set.m_set.begin();it2!=set.m_set.end();it2++) + for(typename IntervalList::iterator it2 = set.m_set.begin(); + it2 != set.m_set.end(); it2++) { new_set.insert(*it+*it2); } @@ -896,12 +897,12 @@ const MscTimeIntervalSet<T> operator-(MscTimeIntervalSet<T>& set) { MscTimeIntervalSet<T> new_set; - typename std::list<MscTimeInterval<T> >::iterator it; - typename std::list<MscTimeInterval<T> >::iterator it2; - for(it=m_set.begin();it!=m_set.end();it++) + for(typename IntervalList::iterator it = m_set.begin(); + it != m_set.end(); it++) { - for(it2=set.m_set.begin();it2!=set.m_set.end();it2++) + for(typename IntervalList::iterator it2 = set.m_set.begin(); + it2 != set.m_set.end(); it2++) { new_set.insert(*it-*it2); } @@ -935,9 +936,11 @@ { MscTimeIntervalSet<T> new_set; new_set.m_set = left.m_set; - typename std::list<MscTimeInterval<T> >::iterator it; - for(it=right.m_set.begin();it!=right.m_set.end();it++) - new_set.insert(*it); + for(typename IntervalList::iterator it = right.m_set.begin(); + it != right.m_set.end(); it++) + { + new_set.insert(*it); + } return new_set; } @@ -945,11 +948,11 @@ MscTimeIntervalSet<T> right) { MscTimeIntervalSet<T> new_set; - typename std::list<MscTimeInterval<T> >::iterator it; - typename std::list<MscTimeInterval<T> >::iterator it2; - for(it=left.m_set.begin();it!=left.m_set.end();it++)\ + for(typename IntervalList::iterator it = left.m_set.begin(); + it != left.m_set.end(); it++) { - for(it2=right.m_set.begin();it2!=right.m_set.end();it2++) + for(typename IntervalList::iterator it2 = right.m_set.begin(); + it2 != right.m_set.end(); it2++) { MscTimeInterval<T> tmp; tmp = MscTimeInterval<T>::interval_intersection(*it,*it2); @@ -964,11 +967,11 @@ MscTimeIntervalSet<T> right) { MscTimeIntervalSet<T> new_set; - typename std::list<MscTimeInterval<T> >::iterator it; - typename std::list<MscTimeInterval<T> >::iterator it2; - for(it=left.m_set.begin();it!=left.m_set.end();it++)\ + for(typename IntervalList::iterator it = left.m_set.begin(); + it != left.m_set.end(); it++) { - for(it2=right.m_set.begin();it2!=right.m_set.end();it2++) + for(typename IntervalList::iterator it2 = right.m_set.begin(); + it2 != right.m_set.end(); it2++) { MscTimeInterval<T> tmp; tmp = MscTimeInterval<T>::components_max(*it,*it2); @@ -986,8 +989,8 @@ return os << ""; std::list <MscTimeInterval<T> > set; set=interval.m_set; - typename std::list <MscTimeInterval<T> >::iterator it; - for(it=set.begin();it!=set.end();it++) + for(typename IntervalList::iterator it = set.begin(); + it != set.end(); it++) { os << *it << " "; } Property changes on: trunk/tests/interval_set_test.cpp ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |