From: <qua...@us...> - 2009-10-06 15:38:31
|
Revision: 35 http://stdair.svn.sourceforge.net/stdair/?rev=35&view=rev Author: quannaus Date: 2009-10-06 15:38:25 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:25:09 UTC (rev 34) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:38:25 UTC (rev 35) @@ -28,12 +28,15 @@ // Define the pair of string and pointer of BOM_CONTENT. typedef typename std::pair<std::string, BOM_CONTENT*> value_type; + // Definition allowing the retrieve the ITERATOR type. + typedef ITERATOR iterator_type; + // Definition allowing the retrieve the difference type of the ITERATOR. typedef typename ITERATOR::difference_type difference_type; public: /** Normal constructor. */ - BomIterator_T (ITERATOR iIterator) + BomIterator_T (iterator_type iIterator) : _itBomStructureObject (iIterator) { } /** Default constructor. */ @@ -47,6 +50,10 @@ ~BomIterator_T() { } public: + /** Return _itBomStructureObject, used for underlying work. */ + iterator_type base() const { return _itBomStructureObject; } + + public: // ///////////// Operators ////////////// /** Incrementing (prefix and postfix) operators. */ void operator++ () { ++_itBomStructureObject; } @@ -126,7 +133,7 @@ private: ///////////// Attributes ////////////// /** Iterator for the current BOM structure on the non-ordered list. */ - ITERATOR _itBomStructureObject; + iterator_type _itBomStructureObject; /** Helper attribute. <br>It is necessary to define that value at the attribute @@ -147,7 +154,7 @@ inline typename ITERATOR::difference_type operator-(const BomIterator_T<BOM_CONTENT, ITERATOR>& l, const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { - return l._itBomStructureObject - r._itBomStructureObject; + return l.base() - r.base(); } template<typename BOM_CONTENT, typename ITERATOR> @@ -156,8 +163,7 @@ const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { // Definition allowing to retrieve the Parent_T of BomIterator_T. typedef typename BomIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; - return BomIterator_T<BOM_CONTENT, ITERATOR> - (n+r._itBomStructureObject); + return BomIterator_T<BOM_CONTENT, ITERATOR> (n+r.base()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |