Changeset 3300
- Timestamp:
- 11/06/09 17:39:17 (2 weeks ago)
- Location:
- MOAB/trunk
- Files:
-
- 2 modified
-
MBRange.cpp (modified) (2 diffs)
-
MBRange.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MOAB/trunk/MBRange.cpp
r3297 r3300 234 234 MBRange::iterator MBRange::insert( MBRange::iterator hint, MBEntityHandle val ) 235 235 { 236 237 // if this is empty, just add it and return an iterator to it 236 // don't allow zero-valued handles in MBRange 238 237 if(val == 0) 239 238 return end(); 240 239 240 // if this is empty, just add it and return an iterator to it 241 241 if(&mHead == mHead.mNext) 242 242 { … … 734 734 } 735 735 736 737 MBEntityID 738 operator-( const MBRange::const_iterator& it2, const MBRange::const_iterator& it1 ) 739 { 740 assert( !it2.mValue || *it2 >= *it1 ); 741 if (it2.mNode == it1.mNode) { 742 return *it2 - *it1; 743 } 744 745 MBEntityID result = it1.mNode->second - it1.mValue + 1; 746 for (MBRange::PairNode* n = it1.mNode->mNext; n != it2.mNode; n = n->mNext) 747 result += n->second - n->first + 1; 748 if (it2.mValue) // (it2.mNode != &mHead) 749 result += it2.mValue - it2.mNode->first; 750 return result; 751 } 752 753 736 754 MBRange::const_iterator MBRange::lower_bound(MBRange::const_iterator first, 737 755 MBRange::const_iterator last, -
MOAB/trunk/MBRange.hpp
r3297 r3300 421 421 friend class pair_iterator; 422 422 friend class const_pair_iterator; 423 friend MBEntityID operator-( const const_iterator&, const const_iterator& ); 423 424 public: 424 425 //! default constructor - intialize base default constructor … … 686 687 operator-( MBEntityID step, const MBRange::const_iterator& it ) 687 688 { MBRange::const_iterator tmp(it); return tmp -= step; } 689 690 MBEntityID 691 operator-( const MBRange::const_iterator& it1, const MBRange::const_iterator& it2 ); 688 692 689 693 //! Use as you would an STL back_inserter
![(please configure the [header_logo] section in trac.ini)](/projects/ITAPS/chrome/common/trac_banner.png)